-
Notifications
You must be signed in to change notification settings - Fork 5.7k
SERVER-32721 Explain output should indicate when a backup plan is used #1231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
d-d-ddl
wants to merge
14
commits into
mongodb:master
Choose a base branch
from
d-d-ddl:server-32721
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ed35209
SERVER-19904 Added command to check element's type
d-d-ddl a7c1914
SERVER-22480: Changed DocumentSource's member variable name to start …
d-d-ddl b9c7aed
Added backup plan indicator
d-d-ddl 6316125
Added backup plan incator to explain output
d-d-ddl 8731c80
Added OriginalWinningPlan to explain output
d-d-ddl 3ec2451
Removed changes for another ticket
d-d-ddl 9c66dab
Added if condition to prevent segmentation fault
d-d-ddl fa97a62
Formatted Files
d-d-ddl d0f1174
Add Helper Function for jstest
d-d-ddl e2f2483
Modified Testing Function
d-d-ddl 22982fd
Modified Testing Function
d-d-ddl ca5e444
SERVER-32721
d-d-ddl ffd904b
SERVER-32721 Almost Done?
d-d-ddl d86caa4
Server-32721
d-d-ddl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Test that the explain will use backup plan if the original winning plan ran out of memory in the | ||
// "executionStats" mode | ||
// This test was designed to reproduce SERVER-32721" | ||
|
||
load("jstests/libs/analyze_plan.js"); | ||
(function() { | ||
"use strict"; | ||
|
||
const explain_backup_plan_test = db.explain_backup_plan; | ||
explain_backup_plan_test.drop(); | ||
|
||
let bulk = explain_backup_plan_test.initializeUnorderedBulkOp(); | ||
|
||
for (let i = 0; i < 100000; ++i) { | ||
bulk.insert({_id: i, x: i, y: i}); | ||
} | ||
|
||
bulk.execute(); | ||
explain_backup_plan_test.ensureIndex({x: 1}); | ||
|
||
db.adminCommand({setParameter: 1, internalQueryExecMaxBlockingSortBytes: 100}); | ||
|
||
const test1 = explain_backup_plan_test.find({x: {$gte: 90}}).sort({_id: 1}).explain(true); | ||
const test2 = explain_backup_plan_test.find({x: {$gte: 90000}}).sort({_id: 1}).explain(true); | ||
// This query will not use the backup plan, hence it generates only two stages: winningPlan and | ||
// rejectedPlans. | ||
assert(!backupPlanUsed(test1), "test1 did not use a backup plan"); | ||
// This query will use backup plan, the exaplin output for this query will generate three | ||
// stages: winningPlan, rejectedPlans and originalWinningPlan. | ||
assert(backupPlanUsed(test2), "backup plan invoked in test2"); | ||
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the contents of this test in an immediately-invoked-function-expression (https://en.wikipedia.org/wiki/Immediately-invoked_function_expression)