From 2befb68f84a5cad00c03f8fc93ef28f479b2d8b1 Mon Sep 17 00:00:00 2001 From: satoru Date: Fri, 28 Jun 2019 16:36:52 +0800 Subject: [PATCH] Document limitations of the modified scan --- pump/storage/vlog.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pump/storage/vlog.go b/pump/storage/vlog.go index 2421bf631..fcdfb4b46 100644 --- a/pump/storage/vlog.go +++ b/pump/storage/vlog.go @@ -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()