Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-80328

Fix race condition in cancel_coordinate_txn_commit_with_tickets_exhausted.js

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • QE 2023-09-04
    • 30

      Test cancel_coordinate_txn_commit_with_tickets_exhausted.js checks that transaction coordinator will correctly timeout and abort transaction even if all write tickets from WiredTiger are exhausted.

      It uses hangWithLockDuringBatchRemove to create threads that exhaust write tickets and transaction coordinator server status to determine when transaction is past certain point: https://github.com/mongodb/mongo/blob/a4f458fe4d7a44eba056f5c150753e73067c8e4d/jstests/sharding/cancel_coordinate_txn_commit_with_tickets_exhausted.js#L135

      After the transaction is past kWaitingForVotes, it disabled the fail points.

      It used to work, because we used to do everything inside transaction coordinator synchronously, but as a side effect of SERVER-79091 we know delete coordinator doc asynchronously and the test run one transaction before starting the test to initialize transaction_coordinator system: 

      https://github.com/mongodb/mongo/blob/a4f458fe4d7a44eba056f5c150753e73067c8e4d/jstests/sharding/cancel_coordinate_txn_commit_with_tickets_exhausted.js#L86

      In rare cases it is possible that the check (line 135) that supposed to check our main transaction (line 99) will be satisfied by prior transaction (line 86) and fail point will disabled before we are able to satisfy check on line 106

            Assignee:
            ivan.fefer@mongodb.com Ivan Fefer
            Reporter:
            ivan.fefer@mongodb.com Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: