-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(NODE-6313): add CSOT support to sessions and transactions #4199
Conversation
85c086d
to
bad814f
Compare
7e12bd6
to
a082436
Compare
test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts
Outdated
Show resolved
Hide resolved
test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts
Outdated
Show resolved
Hide resolved
test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts
Show resolved
Hide resolved
test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts
Outdated
Show resolved
Hide resolved
test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts
Show resolved
Hide resolved
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.
Comments.
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.
Half comments addressed
- need to follow up on the prose tests ms changes, we have to bump them or our inserts fail before the txn operation under test is reached.
- abortTransaction's error suppression will be followed up on, will file a ticket about using disposeStack
test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts
Outdated
Show resolved
Hide resolved
test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts
Outdated
Show resolved
Hide resolved
test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts
Outdated
Show resolved
Hide resolved
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.
Sorry for the delay in this review. Just a few small comments, otherwise looks good
@@ -647,96 +709,119 @@ export class ClientSession | |||
*/ | |||
async withTransaction<T = any>( | |||
fn: WithTransactionCallback<T>, | |||
options?: TransactionOptions | |||
options?: TransactionOptions & { | |||
/** |
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.
I think we're missing a doc requirement:
Drivers MUST also document that overriding timeoutMS for operations executed using the explicit session inside the provided callback will result in a client-side error, as defined in Validation and Overrides.
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.
- Overriding timeoutMS for operations executed using the explicit session inside the provided callback will result in a client-side error.
I have this ^ I figure putting this on the api doc for timeoutMS in this function makes it the most visible to where it is relevant (like vscode hover as they add a timeoutMS option here)
Description
What is changing?
CSOT support for session APIs
Some external fixes to timeout handling:
Testing:
TBD: I have to find out what is going on with 4.4 replica sets. I will open the PR now to start review. The same tests pass on all other variants, and the failure is that abortTransaction is not failing despite having a failpoint set. It could be something I am doing wrong, but I am suspicious that the blockConnection failpoint seems to hit our timeout logic in all other servers. 🤔
Is there new documentation needed for these changes?
Yes
What is the motivation for this change?
Transactions can be conveniently timed out. And sessions respect a single timeout setting from either the client or defaultTimeoutMS to deadline the completion of a Txn
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript