Add WriteBatch SliceParts APIs with user-defined timestampadd new apis - #15049
Add WriteBatch SliceParts APIs with user-defined timestampadd new apis#15049sherriiiliu wants to merge 1 commit into
Conversation
✅ clang-tidy: No findings on changed linesCompleted in 244.2s. |
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit a657e9a SummaryThe PR adds WriteBatch SliceParts APIs with user-defined timestamp support, mirroring the existing Slice-based timestamp APIs from PR #8946. The approach is sound: it fills a real gap in the API surface. The implementation is functionally correct but has significant code duplication and critically insufficient test coverage. High-severity findings (2):
Full review (click to expand)Findings🔴 HIGHH1. No happy-path data verification tests --
|
| Context | Assumptions hold? | Action needed? |
|---|---|---|
| WriteBatch (primary) | YES -- correctly sets flags | safe |
| WriteBatchWithIndex | YES -- falls through to Slice methods | safe |
| DB::Write | YES -- TimestampsUpdateNeeded check prevents dummy timestamps from reaching DB |
safe |
Assumption stress-test:
- "Dummy timestamps replaced before write" -- VERIFIED.
DB::Writerejects batches whereneeds_in_place_update_ts_is true (db_impl_write.cc:884-896). - "Explicit-ts APIs bypass dummy path" -- VERIFIED. They don't set
needs_in_place_update_ts_.
Positive Observations
- Approach correctly mirrors the Slice-based timestamp APIs
- Behavioral change (SliceParts now succeed on TS-enabled CFs) fills a real API gap
MaybeTrackTimestampSizecorrectly unified after if/else- Flag handling consistent with existing patterns
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
Current WriteBatch SliceParts APIs does not accept user-defined timestamp, and the following description of current APIs is not true because multiple WriteBatch APIs(e.g. Put, delete, etc.) accepting SliceParts args will return
Status::InvalidArgument( "Cannot call this method on column family enabling timestamp")error if I set key as user key + timestamp as described in comment. We need to use SliceParts as argument to avoid temporary buffer usage for concatenating our values.This patch adds new APIs for SliceParts that accept user-defined timestamp as this PR