-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix: Skip bad events in CDC. #8076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message can now look similar to the one below instead of panicking:
E1013 16:34:48.129933 19 cdc_ee.go:208] error while marshalling batch for event [&{Operation:set Uid:2097730 Attr:myEdge Value:53565-01-01 00:00:00 +0000 UTC ValueType:datetime}]: json: error calling MarshalJSON for type time.Time: Time.MarshalJSON: year outside of range [0,9999]
E1013 16:34:48.130017 19 cdc_ee.go:208] error while marshalling batch for event [&{Operation:set Uid:2097730 Attr:myEdge Value:53584-01-01 00:00:00 +0000 UTC ValueType:datetime}]: json: error calling MarshalJSON for type time.Time: Time.MarshalJSON: year outside of range [0,9999]
E1013 16:34:48.131383 19 cdc_ee.go:220] error while sending cdc event to sink kafka: Failed to deliver 2 messages.
E1013 16:34:48.131426 19 cdc_ee.go:355] unable to send events kafka: Failed to deliver 2 messages.
unable to send messages to sink
github.com/dgraph-io/dgraph/worker.(*CDC).processCDCEvents.func2
/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/cdc_ee.go:299
github.com/dgraph-io/dgraph/worker.(*CDC).processCDCEvents.func3
/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/cdc_ee.go:334
github.com/dgraph-io/dgraph/worker.(*CDC).processCDCEvents
/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/cdc_ee.go:354
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1581
CDC: unable to process raft entry
github.com/dgraph-io/dgraph/worker.(*CDC).processCDCEvents.func3
/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/cdc_ee.go:335
github.com/dgraph-io/dgraph/worker.(*CDC).processCDCEvents
/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/cdc_ee.go:354
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1581
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @manishrjain)
7861a82
to
075d6c8
Compare
This can have an error 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
075d6c8
to
991cc9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
A CDC event can return an error during JSON marshalling like the following. This change skips these events from being sent to CDC. 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 Co-authored-by: Aman Mangal <[email protected]>
A CDC event can return an error during JSON marshalling like the following. This change skips these events from being sent to CDC. 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 Co-authored-by: Aman Mangal <[email protected]>
A CDC event can return an error during JSON marshalling like the following:
This change skips these events from being sent to CDC.