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

Support for Dgraph exported data with original UIDs #2934

Closed
zhuyaoyhj opened this issue Jan 25, 2019 · 5 comments
Closed

Support for Dgraph exported data with original UIDs #2934

zhuyaoyhj opened this issue Jan 25, 2019 · 5 comments
Assignees
Labels
kind/feature Something completely new we should consider.

Comments

@zhuyaoyhj
Copy link

Experience Report

often use fixed UID to process the data. When upgrading the database, when exporting the data, it is found that the exported .rdf file uses an identifier instead of the original UID. The resulting exported data is not directly usable.

What you wanted to do

Provide a data to configure the export database by fixed UID

What you actually did

I find worker/export.go has code for export database
fmt.Sprintf("<_:uid%x>", p.Uid);to fmt.Sprintf("<_0x%x>", p.Uid)

Why that wasn't great, with examples

UID consistency cannot be guaranteed when restoring database data

Any external references to support your case

none

@MichelDiz
Copy link
Contributor

MichelDiz commented Jan 25, 2019

Hi,

Thank you for your report.

Sorry but that is not possible right now. There is other things that we should work to support this, but this will be supported with the binaries Backup.

Therefore, this is not supported in favor of:
#2710
b845363

And also I believe this issue is duplicated of #2850

@danielmai
Copy link
Contributor

Let's support this. This situation comes up enough that preserving UIDs in exports should be the default. There can also be an options to not preserve UIDs for backward compatibility.

Live Loader and Bulk Loader should correctly handle UID literals in the exported RDFs.

@danielmai danielmai reopened this Feb 8, 2019
@danielmai danielmai added the kind/feature Something completely new we should consider. label Feb 8, 2019
@danielmai danielmai changed the title Support for dgraph export database use original uid Support for Dgraph exported data with original UIDs Feb 8, 2019
@codexnull codexnull self-assigned this Feb 8, 2019
@codexnull
Copy link
Contributor

I would actually vote for keeping the blank UIDs as the default in order to discourage thinking that they will be preserved when the export is reloaded.

@MichelDiz
Copy link
Contributor

MichelDiz commented Feb 11, 2019

Yeah, me too. Cuz the binaries backup that Guz is working on already does this job.

And this could be problematic for "Live Load". If this were adopted by Live Load. For a DB that is already in use, may end up being overwritten on the hypothesis of a load the RDF with predetermined UIDs.

It could be catastrophic. Maybe not for BulkLoad, but for Live load it certainly does.

This could be useful in a controlled ingestion hypothesis and the user would assume the risks of having the overwritten data. But it would not be safe in the hypothesis of exporting to a DB in use.

@manishrjain
Copy link
Contributor

manishrjain commented Feb 12, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Something completely new we should consider.
Development

No branches or pull requests

5 participants