badger icon indicating copy to clipboard operation
badger copied to clipboard

[QUESTION]: maybe should pin the memtable and levelcontroller in a seqcst view when call db.get

Open mzygQAQ opened this issue 2 years ago • 0 comments

Question.

current logic of db::get

memtables := []
db.RLock()
append(memtables, mutableMemtable);
append(memtables, imuutableMemtable);
db.RUnlock()

for memtable in memtables {
    if memtable.got() 
       return got
}
// point1: after search memtable
// point2: find in the level sst
...
for i in 0..7 {
 level.get()
}

the logic of pin memtable and level-controller was not in an consistent view. if a flush or compaction finished between point 1 and point2, the sst distrubution and the pinned memtable is not match.

mzygQAQ avatar May 25 '23 07:05 mzygQAQ