From db689033a073f08ee752b36ec97a992e4dea5b68 Mon Sep 17 00:00:00 2001 From: Mitch Murphy Date: Fri, 5 Jun 2026 14:13:05 -0400 Subject: [PATCH] docs(pooler): fix godoc placement after sizes extraction --- pkg/cluster/connection_pooler.go | 41 +++++++++++++-------------- pkg/cluster/connection_pooler_test.go | 3 ++ 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/pkg/cluster/connection_pooler.go b/pkg/cluster/connection_pooler.go index d37b00d5d..ca740e12c 100644 --- a/pkg/cluster/connection_pooler.go +++ b/pkg/cluster/connection_pooler.go @@ -200,27 +200,6 @@ func (c *Cluster) generateConnectionPoolerAuthSecret(connectionPooler *Connectio } } -// Generate pool size related environment variables. -// -// MAX_DB_CONN would specify the global maximum for connections to a target -// -// database. -// -// MAX_CLIENT_CONN is not configurable at the moment, just set it high enough. -// -// DEFAULT_SIZE is a pool size per db/user (having in mind the use case when -// -// most of the queries coming through a connection pooler are from the same -// user to the same db). In case if we want to spin up more connection pooler -// instances, take this into account and maintain the same number of -// connections. -// -// MIN_SIZE is a pool's minimal size, to prevent situation when sudden workload -// -// have to wait for spinning up a new connections. -// -// RESERVE_SIZE is how many additional connections to allow for a pooler. - type connectionPoolerSizes struct { maxDBConn int32 defaultSize int32 @@ -267,6 +246,26 @@ func (c *Cluster) connectionPoolerSizes() connectionPoolerSizes { } } +// Generate pool size related environment variables. +// +// MAX_DB_CONN would specify the global maximum for connections to a target +// +// database. +// +// MAX_CLIENT_CONN is not configurable at the moment, just set it high enough. +// +// DEFAULT_SIZE is a pool size per db/user (having in mind the use case when +// +// most of the queries coming through a connection pooler are from the same +// user to the same db). In case if we want to spin up more connection pooler +// instances, take this into account and maintain the same number of +// connections. +// +// MIN_SIZE is a pool's minimal size, to prevent situation when sudden workload +// +// have to wait for spinning up a new connections. +// +// RESERVE_SIZE is how many additional connections to allow for a pooler. func (c *Cluster) getConnectionPoolerEnvVars() []v1.EnvVar { spec := &c.Spec connectionPoolerSpec := spec.ConnectionPooler diff --git a/pkg/cluster/connection_pooler_test.go b/pkg/cluster/connection_pooler_test.go index b5dfa2d60..a346201dc 100644 --- a/pkg/cluster/connection_pooler_test.go +++ b/pkg/cluster/connection_pooler_test.go @@ -1178,4 +1178,7 @@ func TestConnectionPoolerSizes(t *testing.T) { if sizes.reserveSize != 7 { t.Errorf("expected reserveSize 7, got %d", sizes.reserveSize) } + if sizes.minSize != 7 { + t.Errorf("expected minSize 7, got %d", sizes.minSize) + } }