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

fix(ludicrous_mode): fixing type inversion in ludicrous mode #7614

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

aman-bansal
Copy link
Contributor

@aman-bansal aman-bansal commented Mar 19, 2021

This PR aims to solve the crashes we have seen in ludicrous mode due to type inversion error. One such crash is

I0315 18:37:10.987252      18 log.go:34] 2 [logterm: 45, index: 1734160, vote: 2] rejected MsgPreVote from 1 [logterm: 44, index: 1734158] at term 45
panic: interface conversion: interface {} is string, not time.Time
goroutine 3766 [running]:
github.com/dgraph-io/dgraph/tok.DayTokenizer.Tokens(0x1b661e0, 0xc01646c470, 0x1e, 0x1e, 0xdb1ac1f11fa1c8e2, 0x7f1300000000, 0x1b661e0)
	/ext-go/1/src/github.com/dgraph-io/dgraph/tok/tok.go:249 +0x2f8
github.com/dgraph-io/dgraph/tok.BuildTokens(0x1b661e0, 0xc01646c470, 0x1fb6c20, 0x2e2ff78, 0x1fb6c20, 0x2e2ff78, 0xc01646c470, 0x0, 0x0)
	/ext-go/1/src/github.com/dgraph-io/dgraph/tok/tok.go:108 +0x63
github.com/dgraph-io/dgraph/worker.generateTokenKeys(0xc00e546c00, 0xc01646c450, 0x1, 0x1, 0x12, 0xc01646c400, 0x1, 0x1, 0xc00ebf6e00)
	/ext-go/1/src/github.com/dgraph-io/dgraph/worker/executor.go:83 +0x237
github.com/dgraph-io/dgraph/worker.generateConflictKeys(0x1faf2e0, 0xc000046070, 0xc0a093a300, 0x0)
	/ext-go/1/src/github.com/dgraph-io/dgraph/worker/executor.go:120 +0x47d
github.com/dgraph-io/dgraph/worker.(*executor).processMutationCh(0xc00e3bf220, 0x1faf2e0, 0xc000046070, 0xc02ae403c0)
	/ext-go/1/src/github.com/dgraph-io/dgraph/worker/executor.go:220 +0x46d
created by github.com/dgraph-io/dgraph/worker.(*executor).getChannel
	/ext-go/1/src/github.com/dgraph-io/dgraph/worker/executor.go:279 +0x130
[Sentry] 2021/03/15 18:37:12 Sending fatal event [215c647f319d41d2aa93a0e0d4d01b84] to o318308.ingest.sentry.io project: 5208688
[Sentry] 2021/03/15 18:37:13 Buffer flushed successfully.

The catch here is that, if there is no way to type cast values, do create tokens, skip it.


This change is Reviewable

Copy link
Contributor

@ahsanbarkati ahsanbarkati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We should write some unit tests for these functions.

@aman-bansal
Copy link
Contributor Author

This fixes the crashes we are seeing with the tokenizers. We have planned major refactoring around ludicrous mode. would be better to write tests then :).

@aman-bansal aman-bansal merged commit 3236a4d into release/v21.03 Mar 25, 2021
@aman-bansal aman-bansal deleted the aman/fix_crash_ludicrous branch March 25, 2021 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants