Dgraph missing mutations in Ludicrous mode (post mortem)

Problem

When running Dgraph in ludicrous mode, Dgraph overrides sequential upserts on any attribute.

For example, for the following schema:

name: string @index(exact) . 
email: string @index(exact) .
friends: [string] . 

If we send 3 mutations that add a friend to a friends list, only one friend i.e. the one added in the last mutation gets added.

Why this is happening?

We didn’t used to update startTs for upsert mutations post this change So, we end up assigning the same startTs across different mutations because we don’t increment the max assigned timestamp. This startTs is eventually passed as commitTs to CommitToDisk method in mvcc.go. So same commitTs across 2 different mutations leads to the latter mutation overriding former mutation. Hence the bug.

Fix is just a one line change

1 Like