From 7645ff98bb0f289f8eb1605cb743b414e5ded0fc Mon Sep 17 00:00:00 2001 From: Kaloian Manassiev Date: Sun, 29 Mar 2020 10:52:41 -0400 Subject: SERVER-46703 Make `checkShardVersionOrThrow` throw SSV if the metadata is not known Introduces a checkShardVersionOKOrThrow_DEPRECATED variant so that we can incrementally fix the places, which are not prepared to catch StaleConfig exceptions. --- src/mongo/db/db_raii.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/db_raii.cpp') diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp index 26f83b77d05..9578f5b7be5 100644 --- a/src/mongo/db/db_raii.cpp +++ b/src/mongo/db/db_raii.cpp @@ -350,7 +350,7 @@ AutoGetCollectionForReadCommand::AutoGetCollectionForReadCommand( // use an empty plan. invariant(!_autoCollForRead.getView() || !_autoCollForRead.getCollection()); auto css = CollectionShardingState::get(opCtx, _autoCollForRead.getNss()); - css->checkShardVersionOrThrow(opCtx); + css->checkShardVersionOrThrow_DEPRECATED(opCtx); } OldClientContext::OldClientContext(OperationContext* opCtx, const std::string& ns, bool doVersion) @@ -371,7 +371,7 @@ OldClientContext::OldClientContext(OperationContext* opCtx, const std::string& n break; default: CollectionShardingState::get(_opCtx, NamespaceString(ns)) - ->checkShardVersionOrThrow(_opCtx); + ->checkShardVersionOrThrow_DEPRECATED(_opCtx); break; } } -- cgit v1.2.1