1 Zero, 3 Nodes - Replication Factor of 3

EDIT: Apparently this is a known issue with 1.0.6. Don’t set replicas greater than one!!!

Hi,

I have seemingly a simple setup of Dgraph where I have 3 nodes and zero with the replica factor set to 3. In theory, this just means I have 3 servers with all the same data that should keep each other in sync.

However, I seem to be having an issue with this. Data loads fine from the initial bulk import but when writes have a occurred, it seems to load either old or new data based on which client the code decides to read. I’ve read the NodeJS client code and it seems it is just a Math.random() call to the client so it really just chooses one of the three servers. An example is loading a list of someone’s first degree network, based on which server it hits, would return 3 people or 9 people. It returns 9 people when it hits the server that happened to be written to.

It seems as if the code that is supposed to keep the nodes up-to-date is not working. I had run into this issue before but I had thought it was fixed.

This is my state for the zero:

{
	counter: "30587",
	groups: {
		1: {
			members: {
				1: {
					id: "1",
					groupId: 1,
					addr: "cluster0-node0:7080",
					leader: true,
					lastUpdate: "1532445491"
				},
				2: {
					id: "2",
					groupId: 1,
					addr: "cluster0-node1:7081"
				},
				3: {
					id: "3",
					groupId: 1,
					addr: "cluster0-node2:7082"
				}
			},
			tablets: {
				_group: {
					groupId: 1,
					predicate: "_group",
					space: "113013809"
				},
				_job: {
					groupId: 1,
					predicate: "_job",
					space: "16565143"
				},
				_predicate_: {
					groupId: 1,
					predicate: "_predicate_",
					space: "1120645620"
				},
				_profile: {
					groupId: 1,
					predicate: "_profile",
					space: "202333025"
				},
				_when: {
					groupId: 1,
					predicate: "_when",
					space: "1000007"
				},
				applied: {
					groupId: 1,
					predicate: "applied",
					space: "43924"
				},
				attached: {
					groupId: 1,
					predicate: "attached",
					space: "822111"
				},
				companyName: {
					groupId: 1,
					predicate: "companyName",
					space: "239475741"
				},
				contacted: {
					groupId: 1,
					predicate: "contacted",
					space: "18102"
				},
				email: {
					groupId: 1,
					predicate: "email",
					space: "243858805"
				},
				favorited: {
					groupId: 1,
					predicate: "favorited",
					space: "20055"
				},
				group: {
					groupId: 1,
					predicate: "group",
					space: "251350880"
				},
				hired: {
					groupId: 1,
					predicate: "hired",
					space: "401"
				},
				id: {
					groupId: 1,
					predicate: "id",
					space: "484887638"
				},
				knows: {
					groupId: 1,
					predicate: "knows",
					space: "112501873"
				},
				location: {
					groupId: 1,
					predicate: "location",
					space: "160687969"
				},
				match: {
					groupId: 1,
					predicate: "match",
					space: "343863263"
				},
				matchOrder: {
					groupId: 1,
					predicate: "matchOrder",
					space: "310257349"
				},
				name: {
					groupId: 1,
					predicate: "name",
					space: "277994018"
				},
				name @en: {
					groupId: 1,
					predicate: "name@en",
					space: "137817195"
				},
				owner: {
					groupId: 1,
					predicate: "owner",
					space: "834530"
				},
				potentialEmployers: {
					groupId: 1,
					predicate: "potentialEmployers",
					space: "255510670"
				},
				prospect: {
					groupId: 1,
					predicate: "prospect",
					space: "241119550"
				},
				rawLocation: {
					groupId: 1,
					predicate: "rawLocation",
					space: "128348385"
				},
				recommended: {
					groupId: 1,
					predicate: "recommended",
					space: "78844"
				},
				seniority: {
					groupId: 1,
					predicate: "seniority",
					space: "232464809"
				},
				skipped: {
					groupId: 1,
					predicate: "skipped",
					space: "56747"
				},
				title: {
					groupId: 1,
					predicate: "title",
					space: "276359434"
				},
				title @en: {
					groupId: 1,
					predicate: "title@en",
					space: "22385293"
				},
				when: {
					groupId: 1,
					predicate: "when",
					space: "1181826"
				}
			}
		}
	},
	zeros: {
		1: {
			id: "1",
			addr: "zero:5080",
			leader: true
		}
	},
	maxLeaseId: "10260000",
	maxTxnTs: "80000",
	maxRaftId: "3"
}

@emhagman
I have a similar problem to yours.But why isn’t anyone here talking about it?

It’s a problem with 1.06

Warning: Due to some issues with application of replication logs, we recommend only using --replicas=1 for this release. We’re working on solving these issues for the next release.

Can you try with v1.0.7-rc4, there’s a topic about that.

thank you!
I got the correct result in this version.:grinning:

1 Like