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(schema): log error instead of panic if schema not found for predicate #7502

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

NamanJain8
Copy link
Contributor

@NamanJain8 NamanJain8 commented Mar 2, 2021

This PR fixes alpha panic when drop operation and the query is run concurrently.
This may happen when some query that needs indexing over this predicate is executing while the predicate is dropped from the state (using drop operation).

I0226 23:00:24.621458      20 server.go:406] ALTER op: drop_all:true  done
I0226 23:00:24.623637      20 http.go:586] Got alter request via HTTP from 192.168.64.1:34114
I0226 23:00:24.623778      20 server.go:362] Received ALTER op: drop_all:true 
I0226 23:00:24.623808      20 server.go:1513] Got Alter request from: "192.168.64.1:34114"
I0226 23:00:24.625026      20 access_ee.go:1079] Successfully authorised the guardian of the galaxy
I0226 23:00:24.627030      20 log.go:34] DropAll called. Blocking writes...
I0226 23:00:24.627076      20 log.go:34] Writes flushed. Stopping compactions now...
2021/02/26 23:00:24 schema state not found for dgraph.type
github.com/dgraph-io/dgraph/x.AssertTruef
	/home/dmai/go/src/github.com/dgraph-io/dgraph/x/error.go:107
github.com/dgraph-io/dgraph/schema.(*state).Tokenizer
	/home/dmai/go/src/github.com/dgraph-io/dgraph/schema/schema.go:338
github.com/dgraph-io/dgraph/worker.pickTokenizer
	/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/tokens.go:86
github.com/dgraph-io/dgraph/worker.getInequalityTokens
	/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/tokens.go:128
github.com/dgraph-io/dgraph/worker.parseSrcFn
	/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/task.go:1772
github.com/dgraph-io/dgraph/worker.(*queryState).helpProcessTask
	/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/task.go:944
github.com/dgraph-io/dgraph/worker.processTask
	/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/task.go:926
github.com/dgraph-io/dgraph/worker.(*grpcWorker).ServeTask.func1
	/home/dmai/go/src/github.com/dgraph-io/dgraph/worker/task.go:1984
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1374

This change is Reviewable

@github-actions github-actions bot added the area/schema Issues related to the schema language and capabilities. label Mar 2, 2021
Copy link
Contributor Author

@NamanJain8 NamanJain8 left a comment

Choose a reason for hiding this comment

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

This fixes the above crash. But some thoughts about this edge case are needed.

Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on @manishrjain and @vvbalaji-dgraph)

@NamanJain8 NamanJain8 merged commit 96073fc into master Mar 2, 2021
@NamanJain8 NamanJain8 deleted the naman/tokenizer branch March 2, 2021 16:45
NamanJain8 added a commit that referenced this pull request Mar 3, 2021
…cate (#7502)

This PR fixes alpha panic when drop operation and the query is run concurrently.
This may happen when some query that needs indexing over this predicate is executing while the predicate is dropped from the state (using drop operation).

(cherry picked from commit 96073fc)
NamanJain8 added a commit that referenced this pull request Mar 8, 2021
…cate (#7502) (#7509)

This PR fixes alpha panic when drop operation and the query is run concurrently.
This may happen when some query that needs indexing over this predicate is executing while the predicate is dropped from the state (using drop operation).

(cherry picked from commit 96073fc)
aman-bansal pushed a commit that referenced this pull request Mar 9, 2021
…cate (#7502)

This PR fixes alpha panic when drop operation and the query is run concurrently.
This may happen when some query that needs indexing over this predicate is executing while the predicate is dropped from the state (using drop operation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema Issues related to the schema language and capabilities.
Development

Successfully merging this pull request may close these issues.

2 participants