diff options
author | Aaron <aaron@10gen.com> | 2012-01-30 22:20:40 -0800 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2012-02-06 22:12:27 -0800 |
commit | 9d86d5290fa8a13ac803c783311fea03702e6970 (patch) | |
tree | bf2b76ca96dad28a920b40b01af6d69037a2e51f /jstests/index12.js | |
parent | db19b8864f4e8c6591ea017e2d6d8b4026a449ab (diff) | |
download | mongo-9d86d5290fa8a13ac803c783311fea03702e6970.tar.gz |
SERVER-4820 test
Diffstat (limited to 'jstests/index12.js')
-rw-r--r-- | jstests/index12.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/index12.js b/jstests/index12.js new file mode 100644 index 00000000000..74dadcac360 --- /dev/null +++ b/jstests/index12.js @@ -0,0 +1,22 @@ +// Test renaming a collection during a background index build. SERVER-4820 + +c = db.jstests_index12; +c.drop(); + +s = startParallelShell ( +' for( i = 0; i < 100; ++i ) {' + +' db.getSisterDB( "admin" ).runCommand( {renameCollection:"test.jstests_index12", to:"test.jstests_index12b"} );' + +' db.jstests_index12b.drop();' + +' sleep( 30 );' + +' }' +); + +for( i = 0; i < 10; ++i ) { + for( j = 0; j < 1000; ++j ) { + c.save( {a:j} ); + } + c.ensureIndex( {i:1}, {background:true} ); + assert( !db.getLastError() ); +} + +s(); |