|
Yes, it is a safe assumption (and it should be a check perhaps on the driver side) that the recovery token should always be a BSON object.
|
|
renctan can drivers rely on the fact that the recoverToken will always be a bson document and not some other bson type? This assumption would simplify some driver implementations.
|
Drivers are going to be testing the recoveryToken against single shard clusters. Would you be able to expand a little more on what the "certain edges cases" are?
shane.harvey My original comment was slightly off, and I revised it to:
single shard transactions don't send coordinateCommit. And the current behavior is that attempting to recover a single shard transaction commit will make it wait for the coordinator to timeout and then check for the commit state of the transaction locally.
|
Because of this, this currently doesn't work for single shard transactions on certain edge cases.
Drivers are going to be testing the recoveryToken against single shard clusters. Would you be able to expand a little more on what the "certain edges cases" are?
|
|
Recovery token on response to multistatement transactions from mongos:
{
|
ok: 1,
|
recoveryToken: {
|
shardId: "shard1",
|
}
|
}
|
To use recovery token on commit:
{
|
commitTransaction: 1,
|
...
|
recoveryToken: {
|
shardId: "shard1",
|
}
|
}
|
Notes:
- the recovery token object should be treated as an opaque object and pass it back to the server as is.
- the recovery token would only exist if the multistatement transaction statement ran successfully without errors.
- commit recovery is best effort. If coordinateCommit was never sent to the coordinator, the recovery commit will timeout waiting for it.
- single shard transactions don't send coordinateCommit. And the current behavior is that attempting to recover a single shard transaction commit will make it wait for the coordinator to timeout and then check for the commit state of the transaction locally.
|
|
Author:
{'username': 'renctan', 'email': 'randolph@10gen.com', 'name': 'Randolph Tan'}
Message: SERVER-37344 Implement recovery token for retrying a commit command on a different mongos
Branch: master
https://github.com/mongodb/mongo/commit/c82cee47c3208a75f928ad3c87cc3db9a23b0f38
|
Generated at Thu Feb 08 04:45:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.