feat(logging): log transaction commit lifecycle (retries, success, snapshot adds) - #890
Open
kamcheungting-db wants to merge 2 commits into
Open
feat(logging): log transaction commit lifecycle (retries, success, snapshot adds)#890kamcheungting-db wants to merge 2 commits into
kamcheungting-db wants to merge 2 commits into
Conversation
Transaction::Commit runs through a retry runner but was completely silent, so operators could not tell whether a commit was retrying on a transient conflict or had failed permanently. This is the first real adoption of the logging component in the commit path. - WARN on each genuine retry (the runner only re-invokes the task when it decides to retry, so attempt > 1 marks a real retry), carrying the prior error. - INFO when a commit finally succeeds after > 1 attempt. - ERROR when retries are exhausted, with the attempt count and final error. Tests (TransactionRetryTest, via a CapturingLogger installed with ScopedDefaultLogger): assert the retry WARN + success INFO on a retry-then-succeed commit, and the exhaustion ERROR on an always-conflicting commit. Co-authored-by: Isaac
Extend the commit-path logging beyond retries: - Transaction::Commit now logs an INFO on every successful commit (previously only after a retry). When the commit advanced the current snapshot (a data commit) the message names the snapshot id and operation; metadata-only commits report a plain success. - TableMetadataBuilder::AddSnapshot logs a DEBUG naming the snapshot id and sequence number when a snapshot is added to the metadata. Tests: single-attempt commit emits the success INFO with no retry WARN (TransactionRetryTest.CommitSuccessEmitsInfoLog); AddSnapshot emits the DEBUG (TableMetadataBuilderTest.AddSnapshotEmitsDebugLog). Co-authored-by: Isaac
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.
Adds logging to the transaction commit path (first real use of the logging component from #722–#726). Commit-path only.
What gets logged
util/retry_utilis untouched; all logging lives at the commit call site.Tests (
CapturingLogger+ScopedDefaultLogger): retry→success, retry-exhausted→error, single-attempt success, and snapshot-add DEBUG.This pull request and its description were written by Isaac.