# Documentation issue with bulk loader

**URL:** <https://discuss.dgraph.io/t/documentation-issue-with-bulk-loader/16627>\
**Category:** Dgraph\
**Tags:** dgraph\
**Created:** [January 21, 2022, 6:24pm UTC](https://discuss.dgraph.io/t/documentation-issue-with-bulk-loader/16627 "2022-01-21T18:24:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgoodall](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/jgoodall/32/1347_2.png) [@jgoodall](https://discuss.dgraph.io/u/jgoodall)\
**Post date:** [January 21, 2022, 6:24pm UTC](https://discuss.dgraph.io/t/documentation-issue-with-bulk-loader/16627/1 "2022-01-21T18:24:03Z")

</div>

If we run the bulk loader following [the instructions](https://dgraph.io/docs/deploy/fast-data-loading/bulk-loader/#for-bigger-datasets) using one `zero` node and one `bulk` instance, and then copy the `p` directories to each of the `alpha` nodes. Once we start the cluster, _all_ mutations on the graph fail with a message like the following:

`rpc error: code = Unknown desc = Uid: [195656434] cannot be greater than lease: [0]`

Before that, when the cluster comes up, there is a message about the GraphQL schema updating and then the indices are deleted:

```auto
I0121 14:32:30.032892 1 admin.go:709] namespace: 0. Skipping GraphQL schema update. newSchema
.Version: 10010, oldSchema.Version: 0, schemaChanged: true.
I0121 14:32:30.034067 1 mutation.go:204] Max open files limit: 1048576
I0121 14:32:30.034576 1 index.go:783] Deleting indexes for
I0121 14:32:30.034672 1 index.go:783] Deleting indexes for
I0121 14:32:30.034708 1 index.go:783] Deleting indexes for

```

This seems to be unrecoverable. To be clear, we followed [the instructions](https://dgraph.io/docs/deploy/fast-data-loading/bulk-loader/#for-bigger-datasets) exactly and copied the `p` directories to the `alpha` servers, but we did _not_ copy the `zw` directory to one of the `zero` servers (since that is not in the instructions).

To fix the problem, we copied the `zw` directory from the server we ran the `bulk` and `zero` processes on to one of the servers in the `zero` cluster. We are using docker swarm for orchestration and the service names for the original `zero` server (during bulk) and the `zero` server we copied the `zw` directory to are the same. There are some forum posts that hint at this (e.g. [Serving bulk-loaded data (HA cluster) - #12 by EnricoMi](http://discuss.hypermode.com/t/serving-bulk-loaded-data-ha-cluster/14110/12)).

I have not seen a definitive forum post and the documentation should be fixed to reflect the fact that the `zw` directory created during the bulk load process must be in the final cluster. This should be as easy as inserting a new step in the list [here](https://dgraph.io/docs/deploy/fast-data-loading/bulk-loader/#for-bigger-datasets):

1. Run bulk loader only on one server
2. Copy (or use rsync) the p directory to the other servers (the servers you will be using to start the other Alpha nodes)
3. Copy (or use rsync) the zw directory to one of the zero servers (the servers you will be using to start the other Zero nodes); note, the host name must match
4. Now, start all Alpha nodes at the same time

We are using `dgraph v21.03.2`, but I think this issue is the same for prior versions as well.

---

<div class="post-metadata">

**Author:** ![dmai](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/dmai/32/1254_2.png) [@dmai](https://discuss.dgraph.io/u/dmai)\
**Post date:** [January 22, 2022, 12:57am UTC](https://discuss.dgraph.io/t/documentation-issue-with-bulk-loader/16627/2 "2022-01-22T00:57:02Z")

</div>

You do need to keep the same Zero (zw directory) from the bulk loader run to the live cluster.

Alternatively, when you have the new Zero running you can bump up the UID lease by calling the [`/assign` endpoint](https://dgraph.io/docs/deploy/dgraph-zero/#endpoints) on Zero.

```bash
curl "localhost:6080/assign?what=uids&num=195656434"

```

---

<div class="post-metadata">

**Author:** ![jgoodall](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/jgoodall/32/1347_2.png) [@jgoodall](https://discuss.dgraph.io/u/jgoodall)\
**Post date:** [January 24, 2022, 2:06pm UTC](https://discuss.dgraph.io/t/documentation-issue-with-bulk-loader/16627/3 "2022-01-24T14:06:41Z")

</div>

Thanks @dmai ! I would suggest you update the documentation I linked to above. Anyone who, like us, does the bulk load on one cluster and copies the data to another cluster for production will run into the issue and the documentation does not make it clear that the `zw` directory needs to be copied as well.

Your workaround by calling the `/assign` endpoint is good to know - how do you determine the number to use for the UID lease?
