diff options
author | Pierlauro Sciarelli <pierlauro.sciarelli@mongodb.com> | 2021-08-31 14:25:08 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-20 21:32:29 +0000 |
commit | 5387de8c4fbe580bbb7bc246796a7491e9372e70 (patch) | |
tree | 95c3748d60ea74fafbf26ed17d8c74033a3a004f /src/mongo/s/catalog_cache.cpp | |
parent | 69b6346fe1c4e6397112ff4b2a658f3e099bcff3 (diff) | |
download | mongo-5387de8c4fbe580bbb7bc246796a7491e9372e70.tar.gz |
SERVER-40865 Retry QueryPlanKilled errors in the catalog cache
Diffstat (limited to 'src/mongo/s/catalog_cache.cpp')
-rw-r--r-- | src/mongo/s/catalog_cache.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/src/mongo/s/catalog_cache.cpp b/src/mongo/s/catalog_cache.cpp index 3710ac43bdc..fb2f72d9ee7 100644 --- a/src/mongo/s/catalog_cache.cpp +++ b/src/mongo/s/catalog_cache.cpp @@ -208,33 +208,14 @@ StatusWith<ChunkManager> CatalogCache::_getCollectionRoutingInfoAt( dbInfo.databaseVersion(), std::move(collEntry), atClusterTime); - } catch (ExceptionFor<ErrorCodes::ConflictingOperationInProgress>& ex) { - LOGV2_FOR_CATALOG_REFRESH(5310501, - 0, - "Collection refresh failed", - "namespace"_attr = nss, - "exception"_attr = redact(ex)); - _stats.totalRefreshWaitTimeMicros.addAndFetch(t.micros()); - acquireTries++; - if (acquireTries == kMaxInconsistentRoutingInfoRefreshAttempts) { - return ex.toStatus(); - } - } catch (ExceptionFor<ErrorCodes::QueryPlanKilled>& ex) { - // TODO SERVER-53283: Remove once 5.0 has branched out. - // This would happen when the query to config.chunks is killed because the index it - // relied on has been dropped while the query was ongoing. - LOGV2_FOR_CATALOG_REFRESH(5310503, - 0, - "Collection refresh failed", - "namespace"_attr = nss, - "exception"_attr = redact(ex)); - _stats.totalRefreshWaitTimeMicros.addAndFetch(t.micros()); - acquireTries++; - if (acquireTries == kMaxInconsistentRoutingInfoRefreshAttempts) { + } catch (const DBException& ex) { + bool isCatalogCacheRetriableError = ex.isA<ErrorCategory::SnapshotError>() || + ex.code() == ErrorCodes::ConflictingOperationInProgress || + ex.code() == ErrorCodes::QueryPlanKilled; + if (!isCatalogCacheRetriableError) { return ex.toStatus(); } - } catch (ExceptionForCat<ErrorCategory::SnapshotError>& ex) { - LOGV2_FOR_CATALOG_REFRESH(5487402, + LOGV2_FOR_CATALOG_REFRESH(4086500, 0, "Collection refresh failed", "namespace"_attr = nss, |