Linearizability issue when doing explicit ICV validation

Hi,

We’ve added explicit ICV validation, which runs before .commit() as well as the ICV guard with runs at commit() time.

Using this kind of code:

ICVConnection validator = connection.as(ICVConnection.class);
Proof proof = validator.explain().proof();

We insert some data, do the validation check, then commit. Everything is great. Then we user the .get() to get back what we just inserted and we don’t seem to get anything.

Comment out Proof proof = validator.explain().proof(); and everything works fine.

Comment it back in, and we don’t get our data back.

Run it up in debug and suddenly we get our data back again. Very strange. Added a Thread.sleep(5000), doesn’t help.

We are quite stuck now. We want to get hold of explanation for why the validation failed, but we cant loose linearizability.

Can you include the code you’re using to execute the insert/check/commit and the get?

Connection in pool with reasoning.

	connection.begin();
			connection.add().graph(userModel, BRUKERE_GRAPH_NAME);
			
			validate(connection);
			
			connection.commit();

userModel is a sesame model.

	public void validate(Connection connection) {
		ICVConnection validator = connection.as(ICVConnection.class);

		Proof proof = validator.explain().proof();
//		recursiveProcessProof(proof);
	}

And to get the data back

connection.begin();

			Model model = new LinkedHashModel();

			try (Stream<Statement> statements = connection.get().subject(id).statements()) {
				statements.forEach(model::add);
			}

			connection.commit();

Where id is the subject of the resource that we added before. Connection here is taken freshly from a pool, but a different pool because we don’t use reasoning here!!!

The data we are adding and getting back out is user data. So along the lines of

<user1> a User;
    username "user1".

And one last thing, we are getting the error when running with embedded stardog in a unit test.