summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2018-11-01 15:30:59 -0400
committerJack Mulrow <jack.mulrow@mongodb.com>2018-12-12 13:28:21 -0500
commitd2573d47786b035d5bcdeaf30207bbfcd58bf14e (patch)
tree7b7483e49b08550fb374a76d21d853910e403104 /src/mongo
parent4a47c79bcba9fe926b2525a92abd34dbc583e2c7 (diff)
downloadmongo-d2573d47786b035d5bcdeaf30207bbfcd58bf14e.tar.gz
SERVER-37872 Add targeted jstest for sharded transactions with afterClusterTime
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/s/query/cluster_find.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp
index d26dc9b039a..371f4462be2 100644
--- a/src/mongo/s/query/cluster_find.cpp
+++ b/src/mongo/s/query/cluster_find.cpp
@@ -462,8 +462,11 @@ CursorId ClusterFind::runQuery(OperationContext* opCtx,
if (auto txnRouter = TransactionRouter::get(opCtx)) {
// A transaction can always continue on a stale version error during find because
- // the operation must be idempotent.
+ // the operation must be idempotent. Reset the default global read timestamp so the
+ // retry's routing table reflects the chunk placement after the refresh (no-op if
+ // the transaction is not running with snapshot read concern).
txnRouter->onStaleShardOrDbError(kFindCmdName, ex.toStatus());
+ txnRouter->setDefaultAtClusterTime(opCtx);
}
}
}