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

Use manifest to only restore preds assigned to each group. #3648

Merged
merged 8 commits into from
Jul 11, 2019

Conversation

martinmr
Copy link
Contributor

@martinmr martinmr commented Jul 10, 2019

This PR changes the restore logic so that only the keys corresponding to
the predicates that were assigned to the group at the time of the last
backup are restored. This change is intended to properly deal with
predicate moves.


This change is Reviewable

This change converts the keys and posting lists to a
backwards-compatible format so that backups work accross versions of
Dgraph. The restore logic is also changed to convert the data back to
the internal Dgraph formats.
This PR changes the restore logic so that only the keys corresponding to
the predicates that were assigned to the group at the time of the last
backup are restored. This change is intended to properly deal with
predicate moves.
@martinmr
Copy link
Contributor Author

Marked as draft since the base is another branch currently on review but this change is ready for review.

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.

Reviewed 5 of 5 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @martinmr)


ee/backup/restore.go, line 58 at r1 (raw file):

			return nil
		}
		return loadFromBackup(db, gzReader, 16, preds)

Remove 16 from here.


ee/backup/restore.go, line 64 at r1 (raw file):

// loadFromBackup reads the backup, converts the keys and values to the required format,
// and loads them to the given badger DB.
func loadFromBackup(db *badger.DB, r io.Reader, maxPendingWrites int, preds predicateSet) error {

Remove maxPendingWrites here.

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:

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @martinmr)

Copy link
Contributor Author

@martinmr martinmr 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: 3 of 5 files reviewed, 2 unresolved discussions (waiting on @manishrjain)


ee/backup/restore.go, line 58 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

Remove 16 from here.

Done.


ee/backup/restore.go, line 64 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

Remove maxPendingWrites here.

Done.

@martinmr martinmr changed the base branch from martinmr/use-backup-format to master July 11, 2019 21:55
@martinmr martinmr marked this pull request as ready for review July 11, 2019 21:55
@martinmr martinmr requested a review from a team as a code owner July 11, 2019 21:55
@martinmr martinmr merged commit 92bc5da into master Jul 11, 2019
@martinmr martinmr deleted the martinmr/restore-zero-info branch July 11, 2019 23:43
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
…#3648)

This PR changes the restore logic so that only the keys corresponding to
the predicates that were assigned to the group at the time of the last
backup are restored. This change is intended to properly deal with
predicate moves.
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