I couldn’t reproduce the problem even with a mutation of roughly ~10Mb (my sample code is below). Plus the error message says the header size is too long, is it possible for you to check what’s in the header? Thanks!
@Test
public void testLongMutation() {
String table = "abcdefghijklmnopqrstuvwxyz";
Random rand = new Random();
StringBuilder sb = new StringBuilder();
sb.append("<_:bob> <name> \"");
for (int i = 0; i < 10 * 1024 * 1024; i++) {
sb.append(table.charAt(rand.nextInt(26)));
}
sb.append("\" .");
try (Transaction txn = dgraphClient.newTransaction()) {
Mutation mutation =
Mutation.newBuilder()
.setSetNquads(ByteString.copyFromUtf8(sb.toString()))
.build();
Assigned ag = txn.mutate(mutation);
System.out.println("Got new id:" + ag.getUidsOrThrow("bob"));
txn.commit();
}
}
The problem is solved. Cause was a wrong encoded ‘’ inside the string.
Possibly one should catch such error cases with a meaningful error message. The problem itself was small, but the error message led to a completely wrong way to solve the problem.