From 61d144407a11a2cc37a37551652ea0d7e0404033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Thu, 11 Jan 2024 13:01:23 +0000 Subject: [PATCH] makes less verbose CRDB connection balacer moves logged messages for the CockroachDB connection balancer from Info/Debug to Trace. --- internal/datastore/crdb/pool/balancer.go | 6 +++--- internal/datastore/crdb/pool/pool.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/datastore/crdb/pool/balancer.go b/internal/datastore/crdb/pool/balancer.go index baa6b4186e..f4f388214b 100644 --- a/internal/datastore/crdb/pool/balancer.go +++ b/internal/datastore/crdb/pool/balancer.go @@ -208,7 +208,7 @@ func (p *nodeConnectionBalancer[P, C]) pruneConnections(ctx context.Context) { if count <= perNodeMax { continue } - log.Ctx(ctx).Info(). + log.Ctx(ctx).Trace(). Uint32("node", node). Uint32("poolmaxconns", p.pool.MaxConns()). Uint32("conncount", count). @@ -228,10 +228,10 @@ func (p *nodeConnectionBalancer[P, C]) pruneConnections(ctx context.Context) { } for _, c := range healthyConns[node][:numToPrune] { - log.Ctx(ctx).Debug().Str("pool", p.pool.ID()).Uint32("node", node).Msg("pruning connection") + log.Ctx(ctx).Trace().Str("pool", p.pool.ID()).Uint32("node", node).Msg("pruning connection") p.pool.GC(c.Conn()) } - log.Ctx(ctx).Info().Str("pool", p.pool.ID()).Uint32("node", node).Uint32("prunedCount", numToPrune).Msg("pruned connections") + log.Ctx(ctx).Trace().Str("pool", p.pool.ID()).Uint32("node", node).Uint32("prunedCount", numToPrune).Msg("pruned connections") } } diff --git a/internal/datastore/crdb/pool/pool.go b/internal/datastore/crdb/pool/pool.go index 443a681166..3c674935da 100644 --- a/internal/datastore/crdb/pool/pool.go +++ b/internal/datastore/crdb/pool/pool.go @@ -324,7 +324,7 @@ func (p *RetryPool) GC(conn *pgx.Conn) { } func (p *RetryPool) acquireFromDifferentNode(ctx context.Context, nodeID uint32) (*pgxpool.Conn, error) { - log.Ctx(ctx).Info().Uint32("node_id", nodeID).Msg("acquiring a connection from a different node") + log.Ctx(ctx).Trace().Uint32("node_id", nodeID).Msg("acquiring a connection from a different node") for { conn, err := p.pool.Acquire(ctx) if err != nil { @@ -342,7 +342,7 @@ func (p *RetryPool) acquireFromDifferentNode(ctx context.Context, nodeID uint32) conn.Release() continue } - log.Ctx(ctx).Info().Uint32("old node id", nodeID).Uint32("new node id", id).Msg("acquired a connection from a different node") + log.Ctx(ctx).Trace().Uint32("old node id", nodeID).Uint32("new node id", id).Msg("acquired a connection from a different node") return conn, nil } }