[SERVER-39268] make prepare_conflict.js more robust Created: 29/Jan/19  Updated: 29/Oct/23  Resolved: 29/Jan/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.1.8

Type: Improvement Priority: Major - P3
Reporter: Pavithra Vetriselvan Assignee: Pavithra Vetriselvan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Repl 2019-02-11
Participants:
Linked BF Score: 0

 Description   

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.



 Comments   
Comment by Githook User [ 30/Jan/19 ]

Author:

{'email': 'pvselvan@umich.edu', 'name': 'Pavi Vetriselvan'}

Message: SERVER-39268 make prepare_conflict.js more robust
Branch: master
https://github.com/mongodb/mongo/commit/9c83ead9257d0d41d7b7ec92adf441bf34b0c3a8

Generated at Thu Feb 08 04:51:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.