The changes from 21f26eb as part of SERVER-57566 added a usage of RSLocalClient::queryOnce(kMajorityReadConcern) when RSLocalClient::queryOnce(kLocalReadConcern) was intended. ShardingCatalogClient::getCollection() defaults to use kMajorityReadConcern when the repl::ReadConcernLevel is omitted.
This issue was discovered during SERVER-59831 because it caused a later write using the same OperationContext to still be using kMajorityCommitted as its ReadSource and for the later write not to see the effects of an earlier write from secondary batch application.
try { const auto& coll = Grid::get(opCtx)->catalogClient()->getCollection(opCtx, nss); const auto& timeseriesField = coll.getTimeseriesFields(); if (timeseriesField) { uassertStatusOK( checkForTimeseriesTimeFieldKeyRange(actualRange, timeseriesField->getTimeField())); } } catch (const ExceptionFor<ErrorCodes::NamespaceNotFound>&) { // collection doesn't exist or not sharded, skip range check for time-series collection. }
- is caused by
-
SERVER-57566 Implement sharding admin commands behaviour for time series collection
- Closed
- is depended on by
-
SERVER-59831 WTUniqueIndex::_insert expects secondaries to pass in dupsAllowed=true
- Closed
- related to
-
SERVER-61458 Calling RSLocalClient::queryOnce(kMajorityReadConcern) causes subsequent local writes in same OperationContext to also read stale data
- Closed