summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorTommaso Tocci <tommaso.tocci@mongodb.com>2020-08-05 15:36:11 +0200
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-06 18:51:33 +0000
commit8714e192a893e9768fd4ab7d734de6a6ead941c1 (patch)
tree81292c51b48a3d2de36b0654913f13c022c34189 /src/mongo/db/pipeline
parentb5120d585bcc3f00b3378466b1db5277efe48320 (diff)
downloadmongo-8714e192a893e9768fd4ab7d734de6a6ead941c1.tar.gz
SERVER-48991 Make DatabaseCache causally consistent through the usage of ComparableDatabaseVersion
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/sharded_agg_helpers.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/sharded_agg_helpers.h b/src/mongo/db/pipeline/sharded_agg_helpers.h
index 3457bff9619..b537406cb6e 100644
--- a/src/mongo/db/pipeline/sharded_agg_helpers.h
+++ b/src/mongo/db/pipeline/sharded_agg_helpers.h
@@ -230,8 +230,11 @@ auto shardVersionRetry(OperationContext* opCtx,
invariant(ex->getDb() == nss.db(),
str::stream() << "StaleDbVersion error on unexpected database. Expected "
<< nss.db() << ", received " << ex->getDb());
+
// If the database version is stale, refresh its entry in the catalog cache.
- catalogCache->onStaleDatabaseVersion(ex->getDb(), ex->getVersionReceived());
+ Grid::get(opCtx)->catalogCache()->onStaleDatabaseVersion(ex->getDb(),
+ ex->getVersionWanted());
+
if (!logAndTestMaxRetries(ex)) {
throw;
}