Skip to content

Commit

Permalink
Document limitations of the modified scan
Browse files Browse the repository at this point in the history
  • Loading branch information
suzaku committed Jul 1, 2019
1 parent c3e7f0a commit 2befb68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pump/storage/vlog.go
Expand Up @@ -406,7 +406,11 @@ func (vlog *valueLog) scanRequests(start valuePointer, fn func(*request) error)
})
}

// currently we only use this in NewAppend** to scan the record which not write to KV but in the value log, so it's OK to hold the vlog.filesLock lock
// scan visits binlogs in order starting from the specified position.
// There are two limitations to the usage of scan:
// 1. Binlogs added in new logFiles after scan starts are not visible, so don't assume
// that every single binlog added would be visited
// 2. If GC is running concurrently, logFiles may be closed and deleted, thus breaking the scanning.
func (vlog *valueLog) scan(start valuePointer, fn func(vp valuePointer, record *Record) error) error {
vlog.filesLock.RLock()
fids := vlog.sortedFids()
Expand Down

0 comments on commit 2befb68

Please sign in to comment.