You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the flow directory layer does not support snapshot reads. This in and of itself is a shortcoming of the flow bindings, but it is not so bad really. The flow binding tester attempts to get around this with the following bit of code:
if (isDirectory && isSnapshot) {
Version readVersion = wait(instruction->tr->getReadVersion());
instruction->tr = Reference<Transaction>(newTransaction(data->db));
instruction->tr->setVersion(readVersion);
}
The problem is that though this ensures that the "snapshot" transaction has the same view of the database as the regular transaction, it is missing read-your-writes support. This means that the tests can fail if there is something along the lines of:
Transaction starts.
The directories are modified.
The directories are read at snapshot isolation level.
The flow tester will miss the modifications, so it will print out different results.
I ran into this error when running the tests locally. Here is the input that I can give to the bindingtester to make it reproduce:
(The number of ops, 261, is the minimum needed to get it to reproduce with that seed.) I was running it against commit 5fdcd62 which, at the time, was the tip of the release-5.2 branch, to the extent that that is important for reproduction. Here is a print out of the relevant section of adding --print-test --all to the command:
I hacked up the binding tester to actual emit non-snapshot reads whenever it thinks it should actually emit a snapshot read, and then the test passed. So, I don't think it's actually a bug in the directory layer, just that the lack of RYW in snapshot tests.
This can cause spurious errors, so it would be nice to get it fixed. In some sense, the "correct" solution is to make the flow directory layer support snapshot reads. I'm not sure if there is an easier way. In theory, we could just give the snapshot tester a regular transaction. This can lead to a different kind of spurious error (additional not_committed errors), so that's not air-tight. In theory, we could also log all of the writes and replay them within the snapshot transaction or do something like keep two transactions around and use both of them for writes, but perform non-snapshot reads and commits on one and "snapshot" reads on the other. But this might be harder than just supporting snapshot reads.
The text was updated successfully, but these errors were encountered:
There are actually multiple problems with the directory layer testing that I'm tracking as part of my task to clean them up. We should probably just migrate that task into github.
It also looks like I've already implemented a fix for this locally that adds the ability to switch off snapshot reads in the binding layer directory tests, and the flow tester is marked as needing that. I think this is probably the most straightforward resolution until we add snapshot support to the flow directory layer.
Right now, the flow directory layer does not support snapshot reads. This in and of itself is a shortcoming of the flow bindings, but it is not so bad really. The flow binding tester attempts to get around this with the following bit of code:
The problem is that though this ensures that the "snapshot" transaction has the same view of the database as the regular transaction, it is missing read-your-writes support. This means that the tests can fail if there is something along the lines of:
The flow tester will miss the modifications, so it will print out different results.
I ran into this error when running the tests locally. Here is the input that I can give to the bindingtester to make it reproduce:
(The number of ops, 261, is the minimum needed to get it to reproduce with that seed.) I was running it against commit 5fdcd62 which, at the time, was the tip of the release-5.2 branch, to the extent that that is important for reproduction. Here is a print out of the relevant section of adding
--print-test --all
to the command:This leads to the following discrepancy between flow and python:
I hacked up the binding tester to actual emit non-snapshot reads whenever it thinks it should actually emit a snapshot read, and then the test passed. So, I don't think it's actually a bug in the directory layer, just that the lack of RYW in snapshot tests.
This can cause spurious errors, so it would be nice to get it fixed. In some sense, the "correct" solution is to make the flow directory layer support snapshot reads. I'm not sure if there is an easier way. In theory, we could just give the snapshot tester a regular transaction. This can lead to a different kind of spurious error (additional
not_committed
errors), so that's not air-tight. In theory, we could also log all of the writes and replay them within the snapshot transaction or do something like keep two transactions around and use both of them for writes, but perform non-snapshot reads and commits on one and "snapshot" reads on the other. But this might be harder than just supporting snapshot reads.The text was updated successfully, but these errors were encountered: