I recently saw this error when the zero and alpha are out of sync.
Specifically, I started the zero process in the wrong directory, so it created a new zw directory, and when the alpha tried to connect to the zero, having some metadata from the existing (correct) p and w directories with metadata about the zero, this error was returned.
To fix, I had to reset the metadata, by deleting the zeros zw directory and the alphas w directory (just a p dir left) and then manually setting the max timestamp and uid via curl:
curl “localhost:6080/assign?what=uids&num=2000000”
curl “localhost:6080/assign?what=timestamps&num=2000000”
For my DB, the 2000000 number was higher than the existing UID max used, and the max timestamp assigned. There are ways to get these numbers from the p directory using dgraph debug if you don’t know a safe number.
Full steps:
- shut down alpha(s) and zero(s).
- delete everything but the p dir. (this may lose some in-flight transaction info)
- start a zero (it will create an empty zw dir, with timestamp and maxUID set to 0 or a min value)
- run the two curl commands (plus one more if you use namespaces to set max namespace id)
- start the alpha