refactor(queue/mysql): clean up logging, metrics, errors, schema indexes, and write perf#128
Closed
behinddwalls wants to merge 1 commit into
Closed
refactor(queue/mysql): clean up logging, metrics, errors, schema indexes, and write perf#128behinddwalls wants to merge 1 commit into
behinddwalls wants to merge 1 commit into
Conversation
c7cd0c1 to
7f44e8d
Compare
…xes, and write perf - Add queue_mysql_ prefix to all Named() and SubScope() calls - Rename struct field `metrics` to `scope`, use bare `metrics` import for core/metrics - Remove redundant logs, elevate important ones (e.g. DLQ not-found to Warn) - Add domain sentinel errors: ErrPublisherClosed, ErrSubscriberClosed, ErrLeaseExpired, ErrAlreadyAcknowledged - Fix terse error messages to include topic/partition context - Remove unused constants (tagErrorType, errorBeginTx, errorCommit) - Drop redundant indexes: idx_consumer_group (PK prefix), idx_leased_by (no solo query) - Drop idx_topic_id by refactoring Delete/MoveToDLQ/SetVisibilityTimeout to accept partitionKey, so all queries use idx_topic_partition_id — reduces write amplification on messages table - Add inline index reasoning comments to all schema files - Update README.md: fix timeouts, add fair share and error types sections - Update sql-queue-rfc.md: add heartbeat table, fair share, DLQ reuse, observability
e8c261d to
f97e7bf
Compare
Collaborator
Author
|
Superseded — changes folded into stacked PRs from preetam/queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
queue_mysql_prefix to allNamed()andSubScope()calls for consistent log/metric scopingmetricstoscope, use baremetricsimport forcore/metricsErrPublisherClosed,ErrSubscriberClosed,ErrLeaseExpired,ErrAlreadyAcknowledgedtagErrorType,errorBeginTx,errorCommit)idx_consumer_group(PK prefix covers it),idx_leased_by(no solo query)idx_topic_idby refactoringDelete/MoveToDLQ/SetVisibilityTimeoutto acceptpartitionKey— all queries now useidx_topic_partition_id, reducing write amplification on the messages table (3 secondary indexes → 2)Test plan
make test— all 27 unit tests passmake integration-test— verify with real MySQL