fix(sei-db): fix flaky RocksDB parallel iteration test#2928
Closed
fix(sei-db): fix flaky RocksDB parallel iteration test#2928
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
5a7372d to
65d9a47
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2928 +/- ##
==========================================
- Coverage 58.12% 57.65% -0.48%
==========================================
Files 2111 2111
Lines 173544 173671 +127
==========================================
- Hits 100879 100130 -749
- Misses 63706 64586 +880
+ Partials 8959 8955 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The ReadOptions (and its timestamp slice) created by newTSReadOptions() was not stored after being passed to NewIteratorCF(), making it eligible for GC while the C++ iterator still held a dangling Slice pointer to the timestamp data. Under parallel access this caused iterators to read with corrupted timestamps, returning values from wrong versions. Store ReadOptions in the iterator struct and Destroy() it on Close(). Also fix the same leak in getSlice() used by Get/Has. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
65d9a47 to
8f3bc86
Compare
2 tasks
yzang2019
approved these changes
Feb 19, 2026
arajasek
approved these changes
Feb 20, 2026
Resolve conflicts in sei-db/db_engine/rocksdb/mvcc/: - db.go: remove redundant [:] on already-slice variables, drop trivial whitespace difference - iterator.go: keep main's sync.Once-guarded Close() with nil-checks for thread-safe iterator cleanup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
auto-merge was automatically disabled
February 27, 2026 14:22
Pull request was closed
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
TestDatabaseParallelIterationVersionsto flakeReadOptionsobject (and its timestamp slice) created bynewTSReadOptions()was passed toNewIteratorCF()but never stored, making it eligible for GC while the C++ iterator still held a danglingSlicepointer to the timestamp dataval002-011but gotval002-017)ReadOptionsin the iterator struct and callsDestroy()onClose(), ensuring the timestamp data remains valid for the iterator's lifetimeReadOptionsleak ingetSlice()(used byGet/Has)Test plan
TestDatabaseParallelIterationVersions— the previously flaky test should now pass consistently🤖 Generated with Claude Code