Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions platform/extension/messagequeue/mysql/message_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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,
Expand Down
13 changes: 0 additions & 13 deletions platform/extension/messagequeue/mysql/partition_lease_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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
}

Expand Down
19 changes: 2 additions & 17 deletions platform/extension/messagequeue/mysql/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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)...,
)
}
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions platform/extension/messagequeue/mysql/subscriber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
})
}
Expand Down
Loading