Skip to content

Commit

Permalink
kv-client: ignore commit log without prewrite before initialized (pin…
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei authored Apr 10, 2020
1 parent 0e5d857 commit 966672c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cdc/kv/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,13 @@ func (s *eventFeedSession) singleEventFeed(
for _, cacheEntry := range matcher.cachedCommit {
value, ok := matcher.matchRow(cacheEntry)
if !ok {
return atomic.LoadUint64(&checkpointTs),
errors.Errorf("prewrite not match, key: %b, start-ts: %d",
cacheEntry.GetKey(), cacheEntry.GetStartTs())
// when cdc receives a commit log without a corresponding
// prewrite log before initialized, a committed log with
// the same key and start-ts must have been received.
log.Info("ignore commit event without prewrite",
zap.Binary("key", cacheEntry.GetKey()),
zap.Uint64("ts", cacheEntry.GetStartTs()))
continue
}
revent, err := assembleCommitEvent(cacheEntry, value)
if err != nil {
Expand Down

0 comments on commit 966672c

Please sign in to comment.