diff options
author | Sarah Zhou <sarah.zhou@10gen.com> | 2018-08-06 09:54:48 -0400 |
---|---|---|
committer | Sarah Zhou <sarah.zhou@10gen.com> | 2018-08-07 11:27:25 -0400 |
commit | d6e7f0c811acabd3405871d0e09f3d2d84fe9c1c (patch) | |
tree | dd630a696012c017eeeb0a2416f7dec4a91f484a /src/mongo/db | |
parent | 2c50fbc340bb7ef787cd213ae95cabb6b8f8e56f (diff) | |
download | mongo-d6e7f0c811acabd3405871d0e09f3d2d84fe9c1c.tar.gz |
SERVER-35244 Dropping config db in 4.0.0-rc0 fails while it passes in 3.7.9 and earlier
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/session_catalog.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/db/session_catalog.cpp b/src/mongo/db/session_catalog.cpp index 62f01f567a1..614e2ed8144 100644 --- a/src/mongo/db/session_catalog.cpp +++ b/src/mongo/db/session_catalog.cpp @@ -158,11 +158,15 @@ ScopedSession SessionCatalog::getOrCreateSession(OperationContext* opCtx, void SessionCatalog::invalidateSessions(OperationContext* opCtx, boost::optional<BSONObj> singleSessionDoc) { - uassert(40528, - str::stream() << "Direct writes against " - << NamespaceString::kSessionTransactionsTableNamespace.ns() - << " cannot be performed using a transaction or on a session.", - !opCtx->getLogicalSessionId()); + auto replCoord = repl::ReplicationCoordinator::get(opCtx); + bool isReplSet = replCoord->getReplicationMode() == repl::ReplicationCoordinator::modeReplSet; + if (isReplSet) { + uassert(40528, + str::stream() << "Direct writes against " + << NamespaceString::kSessionTransactionsTableNamespace.ns() + << " cannot be performed using a transaction or on a session.", + !opCtx->getLogicalSessionId()); + } const auto invalidateSessionFn = [&](WithLock, SessionRuntimeInfoMap::iterator it) { auto& sri = it->second; |