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

Make reshard_timeseries_disallow_writes.js more robust

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc12
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • Fully Compatible
    • ALL
    • v8.0
    • Cluster Scalability 06/24/24
    • 200

      reshard_timeseries_disallow_writes.js is a test for verifying that writes are correctly blocked during resharding. It runs insert, update, delete, createIndex, collMod, dropIndexes commands with a short maxTimeMS while resharding is in the "blocking-writes" state and asserts that they fail with MaxTimeMSExpired. Then, after resharding completes, it runs corresponding commands to verify that those writes did not get executed. Such setup is not robust because there is no guarantee that the maxTimeMS would expire on mongos and mongods at the same time. As shown in BF-33435, if the maxTimeMS is hit on the mongos first and that command is the last command that the test runs before letting resharding transitions out of the "blocking-writes" state (currently it's the dropIndexes command), the write command on the mongod may manage get unblocked before the maxTimeMS to hit and lead to failed checks later in the test. To make this test more robust, we should instead wait for all operations to no longer show up in currentOp before letting resharding transition out of the blocking state.

      It's worth pointing out the resharding_disallow_writes.js is written the same way. The only difference is that it uses maxTimeMS of 5 seconds instead of 3 seconds. It is unclear why we haven't this race in that test. 

            Assignee:
            kshitij.gupta@mongodb.com Kshitij Gupta
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: