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

`renameCollection` should handle write conflicts

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.14, 3.4.7, 3.5.6
    • Affects Version/s: 3.3.12
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • v3.4, v3.2
    • Hide

      Unfortunately I don't have a small test case that reproduces the error, but a write conflict can be reproduced by running the `agg_match.js` FSM concurrency test with an increased write conflict activation probability:

      1. Change `jstests/concurrency/fsm_all.js` to call `runWorkLoadsSerially` on an array only containing "jstests/concurrency/fsm_workloads/agg_match.js" (instead of `ls(dir)`

      2. In the function `setupWorkload` in `jstests/concurrency/fsm_libs/runner.js`, add the line `assert.commandWorked(myDB.adminCommand({configureFailPoint: "WTWriteConflictException", mode: {activationProbability: 0.0005}}));` (right after the declaration of the variable `myDB`)
      3. Run resmoke with `--repeat=10 --executor=conncurrency jstests/concurrency/fsm_all.js`. A write conflict will occur within the first five or so iterations.

      Show
      Unfortunately I don't have a small test case that reproduces the error, but a write conflict can be reproduced by running the `agg_match.js` FSM concurrency test with an increased write conflict activation probability: 1. Change `jstests/concurrency/fsm_all.js` to call `runWorkLoadsSerially` on an array only containing "jstests/concurrency/fsm_workloads/agg_match.js" (instead of `ls(dir)` 2. In the function `setupWorkload` in `jstests/concurrency/fsm_libs/runner.js`, add the line `assert.commandWorked(myDB.adminCommand({configureFailPoint: "WTWriteConflictException", mode: {activationProbability: 0.0005}}));` (right after the declaration of the variable `myDB`) 3. Run resmoke with `--repeat=10 --executor=conncurrency jstests/concurrency/fsm_all.js`. A write conflict will occur within the first five or so iterations.
    • Storage 2017-03-27, Storage 2017-04-17
    • 0

      renameCollection (in "src/mongo/db/catalog/rename_collection.cpp") does not currently handle write conflicts. To do this, a retry loop needs to be added to ensure that that command succeeds.

            Assignee:
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Reporter:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: