Skip to content

Commit

Permalink
update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cbi42 committed Feb 19, 2025
1 parent a88606f commit c341e95
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions memtable/wbwi_memtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace ROCKSDB_NAMESPACE {
// of the given write batch with index (WBWI) object. This can be used to ingest
// a transaction (which is based on WBWI) into the DB as an immutable memtable.
//
// REQUIRE overwrite_key to be true for the WBWI
// REQUIRES: overwrite_key to be true for the WBWI
// Since the keys in WBWI do not have sequence number, this class is responsible
// for assigning sequence numbers to the keys. This memtable needs to be
// assigned a range of sequence numbers through AssignSequenceNumbers(seqno)
Expand All @@ -23,10 +23,13 @@ namespace ROCKSDB_NAMESPACE {
// sequence number assigned is seqno.lower_bound + update_count - 1. So more
// recent updates will have higher sequence number.
//
// WBWI with overwrite mode keeps track of the most recent update for each key,
// so this memtable contains one update per key usually. However, there is a
// special case where this memtable needs to emit an extra SingleDelete even
// when the SD is overwritten by another update.
// Since WBWI with overwrite mode keeps track of the most recent update for
// each key, this memtable contains one update per key usually. However, there
// are two exceptions:
// 1. Merge operations: Each Merge operation do not overwrite existing entries,
// if a user uses Merge, multiple entries may be kept.
// 2. Overwriten SingleDelete: this memtable needs to emit an extra
// SingleDelete even when the SD is overwritten by another update.
// Consider the following scenario:
// - WBWI has SD(k) then PUT(k, v1)
// - DB has PUT(k, v2) in L1
Expand Down

0 comments on commit c341e95

Please sign in to comment.