-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Labels:None
-
Fully Compatible
-
Repl 2019-02-11
-
0
This came out of BF-11662.
prepare_conflict.js tests that when we attempt to read a document that a prepared transaction modified, it returns a prepare conflict. We do this by checking if a find command times out with the MaxTimeMSExpired error code. We then parse the profiler for the slow find command and make sure there's a prepare conflict.
The current timeout is 1 second. It is possible that the operation can time out while waiting for a collection level X lock, which is held by the prepared transaction. If it times out before it can acquire the lock, the find will not return a prepare conflict.
There are a few solutions we could try to address this issue:
1. Increase the timeout to account for slow machines (maybe 5 seconds)
2. Remove the parsing of the profiler log line and assume that if the find timed out, it would have run into a prepare conflict.
3. Introduce a fail point where if the command times out because of a prepare conflict, return a prepare conflict error. This way, we can explicitly check for this error code instead of checking for MaxTimeMSExpired.