File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,8 @@ type VersionEdit struct {
150150
151151 // LastSeqNum is an upper bound on the sequence numbers that have been
152152 // assigned in flushed WALs. Unflushed WALs (that will be replayed during
153- // recovery) may contain sequence numbers greater than this value.
153+ // recovery) may contain sequence numbers greater than this value. They're
154+ // also allowed to contain sequence numbers less than or equal to this value.
154155 LastSeqNum base.SeqNum
155156
156157 // A file num may be present in both deleted files and new files when it
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ const manifestMarkerName = `manifest`
3434// to the MANIFEST file, which is replayed at startup.
3535type versionSet struct {
3636 // Next seqNum to use for WAL writes.
37+ //
38+ // Note that unflushed WALs may contain sequence numbers less than, equal
39+ // to, or greater than logSeqNum. This is because every version edit
40+ // includes the current logSeqNum, so any version edits applied after a
41+ // write and before the flush of the write to a sstable will update
42+ // logSeqNum beyond the write's sequence number.
3743 logSeqNum base.AtomicSeqNum
3844
3945 // The upper bound on sequence numbers that have been assigned so far. A
You can’t perform that action at this time.
0 commit comments