diff options
author | Kevin Pulo <kevin.pulo@mongodb.com> | 2020-02-06 08:20:02 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-02-06 08:20:02 +0000 |
commit | 58081d16653b6aa0befbf9eeef68efcce890f6cc (patch) | |
tree | f8d7d9f85aff030c725071e54ed362f5545cda44 | |
parent | 86a1a3a10511f24f374478fbe41b19a669f15e70 (diff) | |
download | mongo-58081d16653b6aa0befbf9eeef68efcce890f6cc.tar.gz |
SERVER-45597 deprecation startup warning when applying replset config with custom getLastErrorDefaults
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index 191c038b968..5a9b0d3b8ca 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -3467,6 +3467,19 @@ ReplicationCoordinatorImpl::_setCurrentRSConfig(WithLock lk, log() << startupWarningsLog; } + // Since the ReplSetConfig always has a WriteConcernOptions, the only way to know if it has been + // customized is if it's different to the implicit defaults of { w: 1, wtimeout: 0 }. + if (const auto& wc = newConfig.getDefaultWriteConcern(); + !(wc.wNumNodes == 1 && wc.wTimeout == 0)) { + log() << startupWarningsLog; + log() << "** WARNING: Replica set config contains customized getLastErrorDefaults," + << startupWarningsLog; + log() << "** which are deprecated. Use setDefaultRWConcern instead to set a" + << startupWarningsLog; + log() << "** cluster-wide default writeConcern." << startupWarningsLog; + log() << startupWarningsLog; + } + log() << "New replica set config in use: " << _rsConfig.toBSON() << rsLog; _selfIndex = myIndex; |