transaction: add contextual logging with start_ts (#267)#548
Conversation
Enrich the transaction lifecycle, plan/retry, and region-cache logging with each transaction's start_ts and region/store context; add commit/rollback outcome logs, log dropping an active transaction under all check levels, and a terminal warn when region-error retries are exhausted. Truncate keys in the one full-key error log. Fix message typos/duplicates and remove dead logger-threading comments. Add a dependency-free capture-logger test and a RUST_LOG note to the README. Refs tikv#267 Signed-off-by: Eduard Ralph <eduard@ralphovi.net>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR expands logging across the client-rust crate: adds debug/warn/info logs with contextual details (start_ts, region/store ids, key counts) to region cache invalidation, region error retry handling, transaction client operations, and transaction/2PC lifecycle code; adds a pub(crate) key formatter, a test CaptureLogger, and README documentation. ChangesLogging improvements
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant Transaction
participant Committer
participant TiKVStore
participant Logger
Transaction->>Logger: debug!(commit start, start_ts)
Transaction->>Committer: commit()
Committer->>Logger: debug!(prewrite start, start_ts, mutation count)
Committer->>TiKVStore: prewrite request
TiKVStore-->>Committer: response
Committer->>Logger: debug!(commit_primary start, start_ts)
Committer->>TiKVStore: commit_primary request
TiKVStore-->>Committer: commit_ts
Committer->>Logger: debug!(commit_secondary start, start_ts, mutation count)
Committer->>TiKVStore: commit_secondary request
Committer-->>Transaction: Ok(commit_ts)
Transaction->>Logger: debug!(commit success, commit_ts, elapsed)
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Enrich the transaction lifecycle, plan/retry, and region-cache logging with each transaction's start_ts and region/store context; add commit/rollback outcome logs, log dropping an active transaction under all check levels, and a terminal warn when region-error retries are exhausted. Truncate keys in the one full-key error log. Fix message typos/duplicates and remove dead logger-threading comments. Add a dependency-free capture-logger test and a RUST_LOG note to the README.
Refs #267
Signed-off-by: Eduard Ralph eduard@ralphovi.net
Summary by CodeRabbit
Documentation
RUST_LOGconfiguration.Bug Fixes
Improvements