Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RUBY-2520 Change estimatedDocumentCount() to use the $collStats Agg S…
…tage Instead of Count Command
- Loading branch information
Showing
17 changed files
with
296 additions
and
112 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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
47 changes: 0 additions & 47 deletions
47
lib/mongo/operation/shared/op_msg_or_list_indexes_command.rb
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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
60 changes: 60 additions & 0 deletions
60
spec/spec_tests/data/retryable_reads/estimatedDocumentCount-4.9.yml
This file contains 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,60 @@ | ||
runOn: | ||
- minServerVersion: "4.9.0" | ||
|
||
database_name: &database_name "retryable-reads-tests" | ||
collection_name: &collection_name "coll" | ||
|
||
data: | ||
- { _id: 1, x: 11 } | ||
- { _id: 2, x: 22 } | ||
|
||
tests: | ||
- | ||
description: "EstimatedDocumentCount succeeds on first attempt" | ||
operations: | ||
- &retryable_operation_succeeds | ||
<<: &retryable_operation | ||
name: estimatedDocumentCount | ||
object: collection | ||
result: 2 | ||
expectations: | ||
- &retryable_command_started_event | ||
command_started_event: | ||
command: | ||
aggregate: *collection_name | ||
pipeline: &pipeline | ||
- $collStats: { count: {} } | ||
- $group: { _id: 1, n: { $sum: $count }} | ||
database_name: *database_name | ||
- | ||
description: "EstimatedDocumentCount succeeds on second attempt" | ||
failPoint: &failCommand_failPoint | ||
configureFailPoint: failCommand | ||
mode: { times: 1 } | ||
data: | ||
failCommands: [aggregate] | ||
closeConnection: true | ||
operations: [*retryable_operation_succeeds] | ||
expectations: | ||
- *retryable_command_started_event | ||
- *retryable_command_started_event | ||
- | ||
description: "EstimatedDocumentCount fails on first attempt" | ||
clientOptions: | ||
retryReads: false | ||
failPoint: *failCommand_failPoint | ||
operations: | ||
- &retryable_operation_fails | ||
<<: *retryable_operation | ||
error: true | ||
expectations: | ||
- *retryable_command_started_event | ||
- | ||
description: "EstimatedDocumentCount fails on second attempt" | ||
failPoint: | ||
<<: *failCommand_failPoint | ||
mode: { times: 2 } | ||
operations: [*retryable_operation_fails] | ||
expectations: | ||
- *retryable_command_started_event | ||
- *retryable_command_started_event |
2 changes: 2 additions & 0 deletions
2
...etryable_reads/estimatedDocumentCount.yml → ...e_reads/estimatedDocumentCount-pre4.9.yml
This file contains 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
Oops, something went wrong.