[SERVER-18744] Add a new test for background index build concurrency Created: 29/May/15  Updated: 25/Nov/15  Resolved: 19/Nov/15

Status: Closed
Project: Core Server
Component/s: Storage, Testing Infrastructure
Affects Version/s: 3.1.4
Fix Version/s: 3.2.0-rc4

Type: Improvement Priority: Major - P3
Reporter: Igor Canadi Assignee: Jonathan Abrahams
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 6 07/17/15, Sharding 7 08/10/15, Sharding 8 08/28/15, TIG 9 (09/18/15), TIG A (10/09/15), TIG B (10/30/15), TIG C (11/20/15), TIG D (12/11/15)
Participants:

 Description   

We had a bug in RocksDB where building background index concurrently with deleting records led to trouble (some deleted records were still there in the background index). We're fixing this, but it's tricky a behavior, so I propose we add a new test for this. The test that currently fails (consistently) with MongoDB on RocksDB: https://gist.github.com/igorcanadi/ea4cd0fcb042fe9af3c5

I didn't test this on mmap or WT.



 Comments   
Comment by Githook User [ 19/Nov/15 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-18744 New FSM workload for createIndex in background
Branch: master
https://github.com/mongodb/mongo/commit/23bc70948368cdd0f504e932904f8f885826057d

Comment by Kamran K. [ 05/Jun/15 ]

Thanks for the report and test, igor. I'll work on incorporating a similar test into our concurrency test suite (in jstests/concurrency/) for 3.1.5.

Code from the gist:

db.adminCommand({ setParameter: 1, internalQueryExecYieldIterations: 100000 });
db.adminCommand({ setParameter: 1, internalQueryExecYieldPeriodMS: 10000 });
 
t = db.background_index_build;
t.drop();
 
for ( i=0; i< 100000; i++ ){
    t.save( { x : i } );
}
 
s = startParallelShell(
  "for (i=0; i < 50000; i++) { db.background_index_build.remove({x: i*12347 % 50000}); }"
);
 
t.createIndex( { x: 1 }, { background: true } );
s();
var a = t.find().sort({x:1});
assert.eq(a.length(), 50000);

Generated at Thu Feb 08 03:48:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.