forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
db: fix level checker use of stale iterator value
Recent refactors made it possible for the level checker to visit a point key twice if the point key's levelIter interleaved a boundary sentinel key. The corresponding level's simpleMergingIterItem's key and value were not updated, leaving the old point key on the heap. When the point key remained at the top of the heap, but the underlying levelIter had moved on, it was possible to access freed memory associated with the old point key's value. Fix cockroachdb#3556.
- Loading branch information
Showing
3 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -356,3 +356,21 @@ Level 1 | |
check merger=fail-merger | ||
---- | ||
merge processing error on key a#9,SINGLEDEL in L1: fileNum=000033: finish failed | ||
|
||
# Test a case where we pause at a range deletion end boundary at the end of a | ||
# file and the last point key of the same file has its value stored out-of-band | ||
# in a value block. | ||
|
||
define | ||
L | ||
[email protected] f.RANGEDEL.72057594037927935 | ||
[email protected]:a9 [email protected]:a6 a.RANGEDEL.5:f | ||
[email protected] [email protected] | ||
[email protected]:f6 | ||
---- | ||
Level 1 | ||
file 0: [a@9#9,SET-f#72057594037927935,RANGEDEL] | ||
file 1: [f@6#6,SET-f@6#6,SET] | ||
|
||
check | ||
---- |