feat(logging): add transaction commit lifecycle logging - #890
Merged
Merged
Conversation
kamcheungting-db
force-pushed
the
logging-commit-retry
branch
from
August 23, 2026 06:45
eb62358 to
f9cf129
Compare
wgtmac
reviewed
Aug 23, 2026
wgtmac
reviewed
Aug 23, 2026
wgtmac
reviewed
Aug 23, 2026
Contributor
Author
|
@wgtmac could you help me review this pr one more time? |
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
wgtmac
force-pushed
the
logging-commit-retry
branch
from
September 19, 2026 10:39
f757a00 to
b2be450
Compare
wgtmac
approved these changes
Sep 19, 2026
wgtmac
left a comment
Member
There was a problem hiding this comment.
I refined the commit logging to keep it aligned with the actual commit behavior. Empty or no-op transactions no longer emit a misleading success message, retry logs now use RetryRunner's attempt counter and include the table identifier, and snapshot details are formatted lazily through the logging path so logging failures cannot affect the commit result. This keeps the operational logs trustworthy during retries without changing the commit semantics.
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
Add operational logging to
Transaction::Commitso retry behavior and commitoutcomes are easier to diagnose.
Changes
WARNfor each retry, including the table identifier, attempt number,and previous error.
INFOonly after a real metadata commit succeeds.success log when available.
CommitStateUnknownas a confirmed failure.cannot affect the commit result.
The retry policy and retry decisions are unchanged.
Validation
table_update_testclang-format,pre-commit, andgit diff --checkpassed