summaryrefslogtreecommitdiff
path: root/jstests/concurrency/fsm_workloads/findAndModify_remove_queue_unindexed.js
blob: 387c5467f04971b22ade281b7b7cc27cec8e92cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict';

/**
 * findAndModify_remove_queue_unindexed.js
 *
 * This is the same workload as findAndModify_remove_queue.js, but without the relevant index.
 *
 * The lack of an index that could satisfy the sort forces the findAndModify operations to scan all
 * the matching documents in order to find the relevant document. This increases the amount of work
 * each findAndModify operation has to do before getting to the matching document, and thus
 * increases the chance of a write conflict because each concurrent findAndModify operation is
 * trying to remove the same document from the queue.
 *
 * This workload was designed to reproduce SERVER-21434.
 */
load('jstests/concurrency/fsm_libs/extend_workload.js');                  // for extendWorkload
load('jstests/concurrency/fsm_workloads/findAndModify_remove_queue.js');  // for $config

var $config = extendWorkload($config, function($config, $super) {

    // Use the workload name as the database name, since the workload
    // name is assumed to be unique.
    $config.data.uniqueDBName = 'findAndModify_remove_queue_unindexed';

    $config.data.getIndexSpecs = function getIndexSpecs() {
        return [];
    };

    return $config;
});