Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv-client: ignore commit log without prewrite before initialized #448

Merged
merged 1 commit into from
Apr 10, 2020
Merged
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
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