dgraph icon indicating copy to clipboard operation
dgraph copied to clipboard

fix: Skip bad events in CDC.

Open danielmai opened this issue 3 years ago • 1 comments

A CDC event can return an error during JSON marshalling like the following:

2021/10/12 21:58:11 json: error calling MarshalJSON for type time.Time: Time.MarshalJSON: year outside of range [0,9999]

github.com/dgraph-io/dgraph/x.Check
    /ext-go/1/src/github.com/dgraph-io/dgraph/x/error.go:42
github.com/dgraph-io/dgraph/worker.(*CDC).processCDCEvents.func1
    /ext-go/1/src/github.com/dgraph-io/dgraph/worker/cdc_ee.go:207
github.com/dgraph-io/dgraph/worker.(*CDC).processCDCEvents.func2
    /ext-go/1/src/github.com/dgraph-io/dgraph/worker/cdc_ee.go:295
github.com/dgraph-io/dgraph/worker.(*CDC).processCDCEvents.func3
    /ext-go/1/src/github.com/dgraph-io/dgraph/worker/cdc_ee.go:331
github.com/dgraph-io/dgraph/worker.(*CDC).processCDCEvents
    /ext-go/1/src/github.com/dgraph-io/dgraph/worker/cdc_ee.go:351
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1371

This change skips these events from being sent to CDC.


This change is Reviewable

danielmai avatar Oct 12 '21 22:10 danielmai

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 29 '22 07:04 CLAassistant