summaryrefslogtreecommitdiff
path: root/jstests/queryoptimizer5.js
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2011-12-14 15:43:02 -0800
committerAaron <aaron@10gen.com>2011-12-14 17:20:04 -0800
commit716dc72fc03be867c1166640f24f335e71607157 (patch)
tree6c7ebf2310c4cde92d000e43e277e33770914f54 /jstests/queryoptimizer5.js
parentdd62235d71bd2afcf2c9713a33f07892186ae458 (diff)
downloadmongo-716dc72fc03be867c1166640f24f335e71607157.tar.gz
add comment and test for query optimizer failed yield of a cached plan with retry
Diffstat (limited to 'jstests/queryoptimizer5.js')
-rw-r--r--jstests/queryoptimizer5.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/jstests/queryoptimizer5.js b/jstests/queryoptimizer5.js
new file mode 100644
index 00000000000..62875d65dec
--- /dev/null
+++ b/jstests/queryoptimizer5.js
@@ -0,0 +1,27 @@
+// Don't crash attempting to retry additional query plans if a recorded plan failed because a cursor was dropped.
+
+t = db.jstests_queryoptimizer5;
+t.drop();
+
+function reset() {
+ t.drop();
+ for( var i = 0; i < 5000; ++i ) {
+ t.save({a:i,b:i});
+ }
+ t.ensureIndex({a:1});
+ t.ensureIndex({b:1});
+}
+
+s = startParallelShell( "for( i = 0; i < 30; ++i ) { sleep( 200 ); db.jstests_queryoptimizer5.drop(); }" );
+
+for( var i = 0; i < 10; ++i ) {
+ try {
+ reset();
+ t.find( {$or:[{a:{$gte:0},b:{$gte:0}}]} ).batchSize( 10000 ).itcount();
+ t.find( {$or:[{a:{$gte:0},b:{$gte:0}}]} ).batchSize( 10000 ).itcount();
+ } catch (e) {
+// printjson(e);
+ }
+}
+
+s();