diff --git a/platform/extension/messagequeue/mysql/message_store.go b/platform/extension/messagequeue/mysql/message_store.go index 9801dcada..375a6d74d 100644 --- a/platform/extension/messagequeue/mysql/message_store.go +++ b/platform/extension/messagequeue/mysql/message_store.go @@ -62,12 +62,6 @@ func (s *sqlmessageStore) Insert(ctx context.Context, tenant string, topic strin return nil } - s.logger.Debugw("inserting messages", - logTenant, tenant, - logTopic, topic, - "count", len(messages), - ) - tx, err := s.db.BeginTx(ctx, nil) if err != nil { return fmt.Errorf("begin transaction tenant=%s topic=%s: %w", tenant, topic, err) @@ -135,12 +129,6 @@ func (s *sqlmessageStore) Insert(ctx context.Context, tenant string, topic strin return fmt.Errorf("commit transaction tenant=%s topic=%s: %w", tenant, topic, err) } - s.logger.Debugw("inserted messages", - logTenant, tenant, - logTopic, topic, - "count", len(messages), - ) - return nil } @@ -214,12 +202,14 @@ func (s *sqlmessageStore) FetchByOffset(ctx context.Context, tenant string, topi return nil, fmt.Errorf("row iteration tenant=%s topic=%s partition=%s: %w", tenant, topic, partitionKey, err) } - s.logger.Debugw("fetched messages", - logTenant, tenant, - logTopic, topic, - logPartitionKey, partitionKey, - "count", len(results), - ) + if len(results) > 0 { + s.logger.Debugw("fetched messages", + logTenant, tenant, + logTopic, topic, + logPartitionKey, partitionKey, + "count", len(results), + ) + } return results, nil } @@ -275,7 +265,7 @@ func (s *sqlmessageStore) MoveToDLQ(ctx context.Context, tenant string, topic st if err != nil { if err == sql.ErrNoRows { // Message already deleted or doesn't exist - s.logger.Debugw("message not found for DLQ move", + s.logger.Infow("message not found for DLQ move", logTenant, tenant, logTopic, topic, logMessageID, messageID, diff --git a/platform/extension/messagequeue/mysql/partition_lease_store.go b/platform/extension/messagequeue/mysql/partition_lease_store.go index 9ccc53377..609ec05a6 100644 --- a/platform/extension/messagequeue/mysql/partition_lease_store.go +++ b/platform/extension/messagequeue/mysql/partition_lease_store.go @@ -79,11 +79,6 @@ func (s *sqlpartitionLeaseStore) TryAcquireLease(ctx context.Context, tenant str acquired := owner == subscriberName if acquired { metrics.NamedCounter(s.scope, "try_acquire_lease", "acquired", 1, metrics.NewTag("topic", topic)) - s.logger.Debugw("acquired lease", - logTenant, tenant, - logTopic, topic, - logPartitionKey, partitionKey, - ) } else { metrics.NamedCounter(s.scope, "try_acquire_lease", "not_acquired", 1, metrics.NewTag("topic", topic)) } @@ -118,14 +113,6 @@ func (s *sqlpartitionLeaseStore) ReleaseLease(ctx context.Context, tenant string ) return 0, nil } - if rows > 0 { - s.logger.Debugw("released lease", - logTenant, tenant, - logTopic, topic, - logPartitionKey, partitionKey, - ) - } - return rows, nil } diff --git a/platform/extension/messagequeue/mysql/subscriber.go b/platform/extension/messagequeue/mysql/subscriber.go index 0b84d5b2f..3890664a0 100644 --- a/platform/extension/messagequeue/mysql/subscriber.go +++ b/platform/extension/messagequeue/mysql/subscriber.go @@ -362,13 +362,6 @@ func (d *sqlDelivery) Nack(ctx context.Context, f failure.Failure) error { return err } - d.subscriber.logger.Debugw("message nacked", - "topic", d.topic, - "partition_key", d.partitionKey, - "message_id", d.messageID, - "retry_delay_ms", retryDelayMs, - ) - d.acknowledged = true return nil } @@ -388,13 +381,6 @@ func (d *sqlDelivery) Postpone(ctx context.Context, delayMs int64) error { return err } - d.subscriber.logger.Debugw("message postponed", - "topic", d.topic, - "partition_key", d.partitionKey, - "message_id", d.messageID, - "delay_millis", delayMs, - ) - d.acknowledged = true return nil } @@ -596,7 +582,6 @@ func (s *subscriber) Subscribe(ctx context.Context, topic string, config extqueu // until the subscription context is cancelled (via Close or explicit cancel). go s.managePartitions(subCtx, sub) - s.logger.Debugw("subscription created", "topic", topic, "consumer_group", config.ConsumerGroup, "subscriber_name", config.SubscriberName) return sub.deliveryCh, nil } @@ -833,7 +818,7 @@ func (s *subscriber) discoverAndReconcileWorkers(ctx context.Context, sub *subsc s.stopPartitionWorker(sub, partition) if rows > 0 { s.recordLeaseReleased(sub, tenant, leaseReasonIdle, rows) - s.logger.Infow("released idle partition lease", + s.logger.Debugw("released idle partition lease", append(leaseLogFields(sub, tenant, pk), logReason, leaseReasonIdle)..., ) } @@ -1181,7 +1166,7 @@ func (w *partitionWorker) run(ctx context.Context) { // deliberately cancelled to interrupt any in-flight store call, so // the resulting error is part of normal teardown. if errors.Is(err, context.Canceled) && errors.Is(ctx.Err(), context.Canceled) { - w.subscriber.logger.Infow("poll canceled while stopping partition worker", + w.subscriber.logger.Debugw("poll canceled while stopping partition worker", "tenant", w.tenant, "topic", w.sub.topic, "partition_key", w.partitionKey, diff --git a/platform/extension/messagequeue/mysql/subscriber_test.go b/platform/extension/messagequeue/mysql/subscriber_test.go index 8e41f8f77..30350af2a 100644 --- a/platform/extension/messagequeue/mysql/subscriber_test.go +++ b/platform/extension/messagequeue/mysql/subscriber_test.go @@ -1998,7 +1998,7 @@ func TestPartitionWorker_RunPollErrorLogging(t *testing.T) { expectedLogError string }{ { - name: "worker cancellation is informational", + name: "worker cancellation during stop is not an error", pollError: func(ctx context.Context) error { <-ctx.Done() return ctx.Err() @@ -2040,7 +2040,7 @@ func TestPartitionWorker_RunPollErrorLogging(t *testing.T) { }, ).AnyTimes() - core, logs := observer.New(zap.InfoLevel) + core, logs := observer.New(zap.DebugLevel) s := NewSubscriber( zap.New(core).Sugar(), tally.NoopScope, @@ -2091,7 +2091,7 @@ func TestPartitionWorker_RunPollErrorLogging(t *testing.T) { } else { assert.Empty(t, pollFailures) require.Len(t, stoppedPolls, 1) - assert.Equal(t, zap.InfoLevel, stoppedPolls[0].Level) + assert.Equal(t, zap.DebugLevel, stoppedPolls[0].Level) } }) }