summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorKristina <kristina@10gen.com>2012-11-12 11:50:12 -0500
committerKristina <kristina@10gen.com>2012-11-12 11:50:12 -0500
commit3abcc53d43145bcda52016c753e10ff139d41e4d (patch)
tree8ed28904a6e433949420ccd9229e6d9721eaa4d9 /jstests
parent074431815cdfc44ad757675a159e3e51739d1d95 (diff)
downloadmongo-3abcc53d43145bcda52016c753e10ff139d41e4d.tar.gz
Revert "SERVER-2771 Retry index builds on startup"
This reverts commit ab9ff1d3ecc7163fc93188efd997bbacd8fe7406.
Diffstat (limited to 'jstests')
-rw-r--r--jstests/slowNightly/index_retry.js88
1 files changed, 0 insertions, 88 deletions
diff --git a/jstests/slowNightly/index_retry.js b/jstests/slowNightly/index_retry.js
deleted file mode 100644
index 6c3a68348f8..00000000000
--- a/jstests/slowNightly/index_retry.js
+++ /dev/null
@@ -1,88 +0,0 @@
-// Check index rebuild when MongoDB is killed
-
-var ports = allocatePorts(1);
-mongod = new MongodRunner(ports[0], "/data/db/index_retry", null, null, ["--journal"]);
-var conn = mongod.start();
-
-var test = conn.getDB("test");
-
-var name = 'jstests_slownightly_index_retry';
-t = test.getCollection(name);
-t.drop();
-
-// Insert a large number of documents, enough to ensure that an index build on these documents can
-// be interrupted before complete.
-for (i = 0; i < 1e6; ++i) {
- t.save( { a:i } );
- if (i % 10000 == 0) {
- print("i: " + i);
- }
-}
-test.getLastError();
-
-function debug(x) {
- printjson(x);
-}
-
-/**
- * @return if there's a current running index build
- */
-function indexBuildInProgress() {
- inprog = test.currentOp().inprog;
- debug(inprog);
- indexBuildOpId = -1;
- inprog.forEach(
- function( op ) {
- // Identify the index build as an insert into the 'test.system.indexes'
- // namespace. It is assumed that no other clients are concurrently
- // accessing the 'test' database.
- if ( op.op == 'insert' && op.ns == 'test.system.indexes' ) {
- debug(op.opid);
- indexBuildOpId = op.opid;
- }
- }
- );
- return indexBuildOpId != -1;
-}
-
-function abortDuringIndexBuild(options) {
-
- // Create an index asynchronously by using a new connection.
- new Mongo(test.getMongo().host ).getCollection( t.toString() ).createIndex( { a:1 }, options);
-
- // Wait for the index build to start.
- var times = 0;
- assert.soon(
- function() {
- return indexBuildInProgress() && times++ >= 2;
- }
- );
-
- print("killing the mongod");
- stopMongod(ports[0], /* signal */ 9);
-}
-
-abortDuringIndexBuild({background:true});
-
-print("sleeping");
-sleep(2000);
-
-conn = mongod.start(/* reuseData */ true);
-
-assert.soon(
- function() {
- try {
- printjson(conn.getDB("test").getCollection(name).find({a:42}).hint({a:1}).next());
- } catch (e) {
- print(e);
- return false;
- }
- return true;
- },
- 'index builds successfully'
-);
-
-print("Index built");
-
-stopMongod(ports[0]);
-print("SUCCESS!");