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-update): Start opIndexing only when index creation is required. #7845

Merged
merged 5 commits into from
May 24, 2021

Conversation

ahsanbarkati
Copy link
Contributor

@ahsanbarkati ahsanbarkati commented May 24, 2021

We were starting opIndexing while schema update irrespective of whether index building is required or not.
This caused Dgraph to be unable to create namespace while backup (or in fact any other conflicting task with opIndexing) is running.


This change is Reviewable

Copy link
Contributor

@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.

Minor commets. The rest looks good.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @ahsanbarkati, @manishrjain, and @vvbalaji-dgraph)


worker/mutation.go, line 250 at r1 (raw file):

		// Start opIndexing task only if schema update needs to build the indexes.
		if ok && rebuild.NeedIndexRebuild() && !gr.Node.isRunningTask(opIndexing) {

rebuild.NeedIndexRebuild() is used twice. Let's calculate it once?
Also, we can combine shouldRebuild := ok && rebuild.NeedIndexRebuild()

Copy link
Contributor Author

@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.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @manishrjain, @NamanJain8, and @vvbalaji-dgraph)


worker/mutation.go, line 250 at r1 (raw file):

Previously, NamanJain8 (Naman Jain) wrote…

rebuild.NeedIndexRebuild() is used twice. Let's calculate it once?
Also, we can combine shouldRebuild := ok && rebuild.NeedIndexRebuild()

Done. Thanks

@ahsanbarkati ahsanbarkati merged commit 5595f9c into master May 24, 2021
@ahsanbarkati ahsanbarkati deleted the ahsan/backup-ns branch May 24, 2021 09:39
ahsanbarkati added a commit that referenced this pull request May 24, 2021
…ired. (#7845)

We were starting opIndexing while schema update irrespective of whether index
building is required or not. This caused Dgraph to be unable to create namespaces
while backup is running, despite the fact that namespace creation doesn't need
any indexing. This PR fixes this issue.

(cherry picked from commit 5595f9c)
ahsanbarkati added a commit that referenced this pull request May 24, 2021
…ired. (#7845)

We were starting opIndexing while schema update irrespective of whether index
building is required or not. This caused Dgraph to be unable to create namespaces
while backup is running, despite the fact that namespace creation doesn't need
any indexing. This PR fixes this issue.

(cherry picked from commit 5595f9c)
ahsanbarkati added a commit that referenced this pull request May 24, 2021
…ired. (#7845) (#7846)

We were starting opIndexing while schema update irrespective of whether index
building is required or not. This caused Dgraph to be unable to create namespaces
while backup is running, despite the fact that namespace creation doesn't need
any indexing. This PR fixes this issue.

(cherry picked from commit 5595f9c)
ahsanbarkati added a commit that referenced this pull request May 24, 2021
…ired. (#7845) (#7847)

We were starting opIndexing while schema update irrespective of whether index
building is required or not. This caused Dgraph to be unable to create namespaces
while backup is running, despite the fact that namespace creation doesn't need
any indexing. This PR fixes this issue.

(cherry picked from commit 5595f9c)
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.

3 participants