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

opt(dropPrefix): do logical drop for deleting predicates and indexing #7764

Merged
merged 9 commits into from
May 5, 2021

Conversation

NamanJain8
Copy link
Contributor

@NamanJain8 NamanJain8 commented Apr 29, 2021

Addresses DGRAPH-3319 and Relates to dgraph-io/badger#1698

Issue:
DropPrefix is Stop The World operation. It blocks the incoming writes. Dgraph uses this API at couple of places like:

  • drop data
  • reindexing
  • dropping predicate

The last 2 usages can lead to bad user impact in a multi-tenant cluster.

Solution:
This PR replaces the usage of DropPrefix with DropPrefixNonBlocking. This API does a logical delete and does not block the writes.


This change is Reviewable

@NamanJain8 NamanJain8 marked this pull request as ready for review May 3, 2021 09:00
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.

We need to add a test here. If we have any tests for drop predicates, you could use the same one and keep doing writes. The writes should not get blocked.

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.

Shouldn't need to do this in Dgraph. Badger should work automatically, given an option.

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

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:

Reviewed 7 of 7 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @vvbalaji-dgraph)

@NamanJain8 NamanJain8 merged commit c86b855 into master May 5, 2021
@NamanJain8 NamanJain8 deleted the naman/drop-prefix-nb branch May 5, 2021 08:02
NamanJain8 added a commit that referenced this pull request May 5, 2021
…ing (#7764)

Issue:
DropPrefix is Stop The World operation. It blocks the incoming writes. Dgraph uses this API at a couple of places like:
- drop data
- reindexing
- dropping predicate
The last 2 usages can lead to bad user impact in a multi-tenant cluster.

Solution:
This PR allows DropPrefix to use the blocking/non-blocking DropPrefix based on DB option `AllowStopTheWorld` that can be set using `--badger` superflag.

(cherry picked from commit c86b855)
NamanJain8 added a commit that referenced this pull request May 5, 2021
…ing (#7764) (#7779)

Issue:
DropPrefix is Stop The World operation. It blocks the incoming writes. Dgraph uses this API at a couple of places like:
- drop data
- reindexing
- dropping predicate
The last 2 usages can lead to bad user impact in a multi-tenant cluster.

Solution:
This PR allows DropPrefix to use the blocking/non-blocking DropPrefix based on DB option `AllowStopTheWorld` that can be set using `--badger` superflag.

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

4 participants