Skip to content

Commit c341e95

Browse files
committed
update comment
1 parent a88606f commit c341e95

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

memtable/wbwi_memtable.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace ROCKSDB_NAMESPACE {
1212
// of the given write batch with index (WBWI) object. This can be used to ingest
1313
// a transaction (which is based on WBWI) into the DB as an immutable memtable.
1414
//
15-
// REQUIRE overwrite_key to be true for the WBWI
15+
// REQUIRES: overwrite_key to be true for the WBWI
1616
// Since the keys in WBWI do not have sequence number, this class is responsible
1717
// for assigning sequence numbers to the keys. This memtable needs to be
1818
// assigned a range of sequence numbers through AssignSequenceNumbers(seqno)
@@ -23,10 +23,13 @@ namespace ROCKSDB_NAMESPACE {
2323
// sequence number assigned is seqno.lower_bound + update_count - 1. So more
2424
// recent updates will have higher sequence number.
2525
//
26-
// WBWI with overwrite mode keeps track of the most recent update for each key,
27-
// so this memtable contains one update per key usually. However, there is a
28-
// special case where this memtable needs to emit an extra SingleDelete even
29-
// when the SD is overwritten by another update.
26+
// Since WBWI with overwrite mode keeps track of the most recent update for
27+
// each key, this memtable contains one update per key usually. However, there
28+
// are two exceptions:
29+
// 1. Merge operations: Each Merge operation do not overwrite existing entries,
30+
// if a user uses Merge, multiple entries may be kept.
31+
// 2. Overwriten SingleDelete: this memtable needs to emit an extra
32+
// SingleDelete even when the SD is overwritten by another update.
3033
// Consider the following scenario:
3134
// - WBWI has SD(k) then PUT(k, v1)
3235
// - DB has PUT(k, v2) in L1

0 commit comments

Comments
 (0)