dgraph
dgraph copied to clipboard
fix: Skip bad events in CDC.
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.