summaryrefslogtreecommitdiff
path: root/jstests/slowNightly
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2013-04-02 13:28:11 -0400
committerEric Milkie <milkie@10gen.com>2013-04-08 16:26:37 -0400
commit6d8d4172c7388495b518ae6b8d4f836532f770d8 (patch)
tree79f8a47398eb92c86ecd30bd7cb15955a03085f2 /jstests/slowNightly
parent50c89129eaa8c77ce24bb1e2f2965996f3757143 (diff)
downloadmongo-6d8d4172c7388495b518ae6b8d4f836532f770d8.tar.gz
SERVER-8536 reenable index builds for incomplete indexes at startup
At startup time, we will once again attempt to rebuild any index builds that were in progress when the server was shut down. This is to support background index builds with replication.
Diffstat (limited to 'jstests/slowNightly')
-rw-r--r--jstests/slowNightly/index_retry.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/jstests/slowNightly/index_retry.js b/jstests/slowNightly/index_retry.js
index d6632c20543..64561d60f87 100644
--- a/jstests/slowNightly/index_retry.js
+++ b/jstests/slowNightly/index_retry.js
@@ -1,5 +1,3 @@
-
-if (0) { // SERVER-8536 / SERVER-8344
// Check index rebuild when MongoDB is killed
var ports = allocatePorts(1);
@@ -14,7 +12,7 @@ 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) {
+for (i = 0; i < 1e5; ++i) {
t.save( { a:i } );
if (i % 10000 == 0) {
print("i: " + i);
@@ -57,7 +55,8 @@ function indexBuildInProgress() {
function abortDuringIndexBuild(options) {
// Create an index asynchronously by using a new connection.
- new Mongo(test.getMongo().host ).getCollection( t.toString() ).createIndex( { a:1 }, options);
+ new Mongo(test.getMongo().host).getCollection(t.toString()).createIndex(
+ { a:1 }, { background:true } );
// Wait for the index build to start.
var times = 0;
@@ -71,13 +70,12 @@ function abortDuringIndexBuild(options) {
stopMongod(ports[0], /* signal */ 9);
}
-abortDuringIndexBuild({background:true});
-
-print("sleeping");
-sleep(2000);
+abortDuringIndexBuild();
conn = mongod.start(/* reuseData */ true);
+
+
assert.soon(
function() {
try {
@@ -96,4 +94,3 @@ print("Index built");
stopMongod(ports[0]);
print("SUCCESS!");
-}