-
Notifications
You must be signed in to change notification settings - Fork 180
RUST-885 Support snapshot sessions #390
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e68b371
add snapshot option and client state
abr-egn fec46af
allow atClusterTime in relevant command responses
abr-egn 96f4c27
add an OperationResult trait
abr-egn bf6acfa
use ReadConcern struct rather than document construction
abr-egn 0519bf3
capture timestamp in Distinct result
abr-egn c2a6619
test fixes
abr-egn a0f487a
more test fixes
abr-egn 9524df4
pull in spec test updates
abr-egn e178ab7
support sessions for more unified runner operations
abr-egn 7c571b1
show result mismatch
abr-egn e65ecff
fix casing of at_cluster_time
abr-egn 45fb940
print event mismatch
abr-egn c46d378
directly parse snapshot timestamp from response bson
abr-egn 5227c3a
undo OperationResult
abr-egn f03d936
update error message
abr-egn 9f2e7cc
remove debug prints
abr-egn ad2f7ec
use session in runCommand in the test runner
abr-egn 609af01
clippy and rustfmt fixes
abr-egn c038b60
remove some spurious deltas
abr-egn 702a463
error on snapshot operations for server versions < 5.0
abr-egn 31030f7
rename error
abr-egn 02df866
update comment and serialization
abr-egn 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
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
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ use futures_core::{Future, Stream}; | |
use crate::{ | ||
bson::Document, | ||
error::{Error, ErrorKind, Result}, | ||
operation, | ||
options::ServerAddress, | ||
results::GetMoreResult, | ||
Client, | ||
|
@@ -152,22 +153,20 @@ pub(crate) struct CursorSpecification { | |
|
||
impl CursorSpecification { | ||
pub(crate) fn new( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This refactor was in service of being able to pass an |
||
ns: Namespace, | ||
info: operation::CursorInfo, | ||
address: ServerAddress, | ||
id: i64, | ||
batch_size: impl Into<Option<u32>>, | ||
max_time: impl Into<Option<Duration>>, | ||
initial_buffer: VecDeque<Document>, | ||
) -> Self { | ||
Self { | ||
info: CursorInformation { | ||
ns, | ||
id, | ||
ns: info.ns, | ||
id: info.id, | ||
address, | ||
batch_size: batch_size.into(), | ||
max_time: max_time.into(), | ||
}, | ||
initial_buffer, | ||
initial_buffer: info.first_batch, | ||
} | ||
} | ||
|
||
|
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
Oops, something went wrong.
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.
My initial approach was to add
atClusterTime
as an explicit field in the output of the relevant commands (find, aggregate, distinct), but that required:The approach here avoids both of those issues at the cost of digging a bit into the raw document.
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.
As part of #389, I actually did have to introduce a trait for the output type of an operation (there was definitely a lot of churn, but for that work it was required I think), so we could still go with your original plan once that PR is merged. For the purposes of avoiding merge conflicts, I think it'll probably be easier to merge this PR first though and then rebase #389 off of that and adjust for
atClusterTime
accordingly there.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.
Ah, with that trait existing it definitely makes sense to go back to extracting the snapshot time that way. Your plan for merging SGTM.