-
Notifications
You must be signed in to change notification settings - Fork 245
DRIVERS-2782 Allow variable access to snapshotTimeout #1870
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
DRIVERS-2782 Allow variable access to snapshotTimeout #1870
Conversation
papafe
left a comment
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.
LGTM
|
|
||
| **Approach 2: Immutability (if error-returning getters are not idiomatic)** | ||
|
|
||
| - Attempt to mutate the session's `snapshotTime` field through any publicly accessible API. |
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.
Doesn't this statement conflicts with requirement of immutability?
The
snapshotTimefield MUST be immutable
A readonly property calledsnapshotTimewill be added toClientSessionthat allows applications to retrieve the
snapshot time of the session:
Why would we have any public API to mutate the value? Or we are talking about a languages with no technical ability to make the field readonly?
| - Start a session by calling `startSession` on with `snapshot = false`. | ||
| - Start a session by calling `startSession` with `snapshot = false`. | ||
|
|
||
| Drivers SHOULD implement one of the following approaches: |
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 far as I can say this is not a 2 approaches, this is simply 2 requirements:
- snapshot time should throw if
snapshot = false(or return some special "Invalid" value if throwing is not an option). - snapshot MUST be immutable.
DRIVERS-2782
Please complete the following before merging:
Go Driver POC: mongodb/mongo-go-driver#2271
clusters).
The Go Driver sets snapshotTime an experimental API:
Users could easily update a session and use it in the pathological case
Drivers should ensure that snapshotTime is immutable, if it's already publicly readable. If it's not immutable, the behavior should be considered a bug.