neo4jdirected-graphdgraph

Error while mutating Uid : [X] cannot be greater than lease: [Y]


I am trying to load a 2million records in dgraph, each is structured like

message_id : <>
message_id_replied_to: <references message_id>

I process them like

  1. Load all message_ids in dgraph using bulk loader
  2. Then start processing message_id_replied_to , if value of message_id_replied_to exists in exisitng nodes, I create a RDF using that uid.

  3. Then using liveloader I insert all message_id_replied_to links (predicates)

Now for running in another machine,

  1. I copy out directory which I got after step 1, start alphas using it.

  2. Then the RDF file generated after step 2, which looks like <0x15f91> <message_id_replied_to> <0x70271b> . and liveload it

I am assuming p directory in out file maintains same uid and so this liveload will work

The problem is liveloading second time it says Error while mutating Uid: [430060] cannot be greater than lease: [10000] and I didn't zw directory

Also is this approach correct? will it work if i keep a copy of zw too?enter code here


Solution

  • When using the Dgraph Bulk Loader you must use the same Zero (i.e., the same zw directory) you used for bulk loading. Dgraph Zero hands out UID leases used for UID assignment during the bulk load, so using a brand-new Zero would result in the error "[430060] cannot be greater than lease: [10000]".

    I recommend following the Dgraph docs about the bulk loader: https://docs.dgraph.io/deploy#bulk-loader.