Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/manifest/version_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ type VersionEdit struct {

// LastSeqNum is an upper bound on the sequence numbers that have been
// assigned in flushed WALs. Unflushed WALs (that will be replayed during
// recovery) may contain sequence numbers greater than this value.
// recovery) may contain sequence numbers greater than this value. They're
// also allowed to contain sequence numbers less than or equal to this value.
LastSeqNum base.SeqNum

// A file num may be present in both deleted files and new files when it
Expand Down
6 changes: 6 additions & 0 deletions version_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ const manifestMarkerName = `manifest`
// to the MANIFEST file, which is replayed at startup.
type versionSet struct {
// Next seqNum to use for WAL writes.
//
// Note that unflushed WALs may contain sequence numbers less than, equal
// to, or greater than logSeqNum. This is because every version edit
// includes the current logSeqNum, so any version edits applied after a
// write and before the flush of the write to a sstable will update
// logSeqNum beyond the write's sequence number.
logSeqNum base.AtomicSeqNum

// The upper bound on sequence numbers that have been assigned so far. A
Expand Down