Skip to content
Merged
Changes from 2 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
6 changes: 6 additions & 0 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ func (db *DB) replayFunction() func(Entry, valuePointer) error {
} else {
nv = vp.Encode()
meta = meta | bitValuePointer
// Update vhead. If the crash happens while replay was in progess
// and the head is not updated, we will end up replaying all the
// files again.
y.AssertTrue(!vp.Less(db.vhead))
db.vhead = vp
Comment thread
jarifibrahim marked this conversation as resolved.
Outdated
}

v := y.ValueStruct{
Expand Down Expand Up @@ -998,6 +1003,7 @@ func (db *DB) handleFlushTask(ft flushTask) error {
return nil
}

y.AssertTrue(!ft.vptr.IsZero())
// Store badger head even if vptr is zero, need it for readTs
db.opt.Debugf("Storing value log head: %+v\n", ft.vptr)
db.opt.Debugf("Storing offset: %+v\n", ft.vptr)
Expand Down