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

feat(schema): do schema versioning and make backup non-blocking for indexing #7852

Merged
merged 4 commits into from
May 26, 2021

Conversation

NamanJain8
Copy link
Contributor

@NamanJain8 NamanJain8 commented May 25, 2021

Issue:
We used to write schema/types at timestamp=1. That single bit violates the Snapshot Isolation. Hence, we couldn't run schema updates and other operations like backup concurrently. This is an issue in a multi-tenant cluster because if the backup is running we couldn't update the schema.
Fix:
This PR writes the schema/types at the startTs of the transaction and enables the schema updates to be made even if the backup is running.


This change is Reviewable

@github-actions github-actions bot added the area/schema Issues related to the schema language and capabilities. label May 25, 2021
@NamanJain8 NamanJain8 force-pushed the naman/index-nonblocking branch from 8edc558 to e683f87 Compare May 25, 2021 11:50
Copy link
Contributor

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

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

Got some comments.

posting/index.go Show resolved Hide resolved
systest/backup/filesystem/backup_test.go Show resolved Hide resolved
worker/draft.go Show resolved Hide resolved
Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm: Do test for predicate moves and snapshots, etc.

Reviewed 13 of 13 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @NamanJain8 and @vvbalaji-dgraph)


worker/draft.go, line 230 at r1 (raw file):

	case opIndexing:
		for otherId, otherCloser := range n.ops {
			if otherId == opBackup {

Ideally, we should look at the backup timestamp. If indexing has a higher ts, then it's OK. If not, then not.

@NamanJain8 NamanJain8 changed the title feat(schema): write schema at leased timestamp and make backup non-blocking for indexing feat(schema): do schema versioning and make backup non-blocking for indexing May 25, 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.

Dismissed @jarifibrahim and @manishrjain from 2 discussions.
Reviewable status: 10 of 13 files reviewed, all discussions resolved (waiting on @manishrjain and @vvbalaji-dgraph)


worker/draft.go, line 230 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

Ideally, we should look at the backup timestamp. If indexing has a higher ts, then it's OK. If not, then not.

Done.


worker/draft.go, line 626 at r1 (raw file):

Previously, jarifibrahim (Ibrahim Jarif) wrote…

The startTs is actually the MaxAssigned. See line 605. You might end up writing data at the wrong timestamp.

We should use the same timestamp as the one used for index rebuild (MaxAssigned). Max assigned is used here to index all the data that has been committed up until this point.

@NamanJain8 NamanJain8 merged commit f376a40 into master May 26, 2021
@NamanJain8 NamanJain8 deleted the naman/index-nonblocking branch May 26, 2021 07:34
NamanJain8 added a commit that referenced this pull request May 26, 2021
…ndexing (#7852)

Issue:
We used to write schema/types at timestamp=1. That single bit violates the Snapshot Isolation. Hence, we couldn't run schema updates and other operations like backup concurrently. This is an issue in a multi-tenant cluster because if the backup is running we couldn't update the schema.
Fix:
This PR writes the schema/types at the startTs of the transaction and enables the schema updates to be made even if the backup is running.

(cherry picked from commit f376a40)
NamanJain8 added a commit that referenced this pull request May 26, 2021
…g for i… (#7856)

* feat(schema): do schema versioning and make backup non-blocking for indexing (#7852)

Issue:
We used to write schema/types at timestamp=1. That single bit violates the Snapshot Isolation. Hence, we couldn't run schema updates and other operations like backup concurrently. This is an issue in a multi-tenant cluster because if the backup is running we couldn't update the schema.
Fix:
This PR writes the schema/types at the startTs of the transaction and enables the schema updates to be made even if the backup is running.

(cherry picked from commit f376a40)

* fix the predicate move
NamanJain8 added a commit that referenced this pull request Jun 1, 2021
… for i… (#7856)

* feat(schema): do schema versioning and make backup non-blocking for indexing (#7852)

Issue:
We used to write schema/types at timestamp=1. That single bit violates the Snapshot Isolation. Hence, we couldn't run schema updates and other operations like backup concurrently. This is an issue in a multi-tenant cluster because if the backup is running we couldn't update the schema.
Fix:
This PR writes the schema/types at the startTs of the transaction and enables the schema updates to be made even if the backup is running.

(cherry picked from commit f376a40)

* fix the predicate move

(cherry picked from commit eb0a04b)
NamanJain8 added a commit that referenced this pull request Jun 1, 2021
… for i… (#7856)

* feat(schema): do schema versioning and make backup non-blocking for indexing (#7852)

Issue:
We used to write schema/types at timestamp=1. That single bit violates the Snapshot Isolation. Hence, we couldn't run schema updates and other operations like backup concurrently. This is an issue in a multi-tenant cluster because if the backup is running we couldn't update the schema.
Fix:
This PR writes the schema/types at the startTs of the transaction and enables the schema updates to be made even if the backup is running.

(cherry picked from commit f376a40)

* fix the predicate move

(cherry picked from commit eb0a04b)
NamanJain8 added a commit that referenced this pull request Jun 1, 2021
#7856) (#7873)

* feat(schema): do schema versioning and make backup non-blocking for indexing (#7852)

Issue:
We used to write schema/types at timestamp=1. That single bit violates the Snapshot Isolation. Hence, we couldn't run schema updates and other operations like backup concurrently. This is an issue in a multi-tenant cluster because if the backup is running we couldn't update the schema.
Fix:
This PR writes the schema/types at the startTs of the transaction and enables the schema updates to be made even if the backup is running.

(cherry picked from commit f376a40)

* fix the predicate move

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

3 participants