With Replica Set To 3, Data Is Not Seeming To Be Available On Each Client Immediately

I have a server setup with 1 dgraph zero, 3 machines (dgraph) and 3 replicas. My use case is setting an XID and the reading it on one of my 2 clients I have running highly parallel. It seems that the data is not available to all clients right after writing. We have a distributed locking system setup in redis cache that has a key for the xid, and the UID value that is there for 5 seconds. When we get a high influx of data, it seems that right after the 5 seconds, if we go to query for a UID by the XID, if it hits the wrong machine (from one of the two clients running many messages in parallel) we do not get and XID back, thus creating a new node for that item. How long does it take to guarantee that data is propagated and available to all clients?

When I tried this with a replica = 1, it works fine, no issues at all with creating “duplicate nodes” that represent the same entity. So I have narrowed it down to an issue with the replication of data when we have a high influx of data coming in.

I suppose all three dgraph servers that you are running are replicas and you have two clients essentially doing an upsert?

This is probably happening because a client is supposed to read all the writes done by it but not necessarily by other clients. If you had a single client doing this operation, then you shouldn’t be seeing this issue.

So there is no way to have multiple clients? We have clients that get instantiated in each of our micro services. This won’t work for us, if that’s the case.

Many of our clients only do reads, but a fee of them write.

I understand the issue, let me discuss this and get back to you. The issue is there when you have replicas and you try to use multiple clients to do upserts.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.