Details
-
Task
-
Resolution: Done
-
Minor - P4
-
None
-
Sharding 2021-09-20
-
37
Description
A mongod process won't reject an explicit {readConcern: {}} object even when it is not the first statement within a multi-statement transaction. The {readConcern: {}} object has no practical effect and won't lead the request to do any additional waiting. (Note also that an empty readConcern object overrides the cluster-wide readConcern value.)
A mongos process is therefore safe to propagate the explicit {readConcern: {}} object and so this dassert() in TransactionRouter should be adjusted to avoid false positives in testing.
419
|
// The first command sent to a participant must start a transaction, unless it is a transaction
|
420
|
// command, which don't support the options that start transactions, i.e. startTransaction and
|
421
|
// readConcern. Otherwise the command must not have a read concern.
|
422
|
auto cmdName = cmd.firstElement().fieldNameStringData();
|
423
|
bool mustStartTransaction = isFirstStatementInThisParticipant && !isTransactionCommand(cmdName); |
424
|
|
425
|
if (!mustStartTransaction) { |
426
|
dassert(!cmd.hasField(repl::ReadConcernArgs::kReadConcernFieldName));
|
427
|
}
|