[SERVER-33061] Validate level:snapshot Created: 01/Feb/18  Updated: 29/Oct/23  Resolved: 08/Mar/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.7.3

Type: Task Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Misha Tyulenev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-32266 Test readConcern level:snapshot on mo... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2018-03-12
Participants:

 Description   

Validate that level:snaphsot is only specified in a context of transaction and session.

Implementaion

The check can be done in the mongos common command execution path:
https://github.com/mongodb/mongo/blob/r3.7.2/src/mongo/s/commands/strategy.cpp#L206

    // TODO: find out if there is a transaction info passed in the command.
    bool isInTransaction = true;
    if (readConcernArgs.getLevel() == repl::ReadConcernLevel::kSnapshotReadConcern &&
        !isInTransaction) {
        CommandHelpers::appendCommandStatus(
            result,
            Status(ErrorCodes::InvalidOptions,
                   "read concern snapshot is supported only in a transaction"));
        return;
    }

Test

Integration test that validates the error when no transaction Id is provided.



 Comments   
Comment by Githook User [ 08/Mar/18 ]

Author:

{'email': 'misha@mongodb.com', 'name': 'Misha Tyulenev', 'username': 'mikety'}

Message: SERVER-33061 validate readConcern level snapshot on mongos
Branch: master
https://github.com/mongodb/mongo/commit/bf7dae7eec760ee413f87535a30bc3a4b9b5b644

Comment by Misha Tyulenev [ 05/Mar/18 ]

Good point. Thanks!

Generated at Thu Feb 08 04:32:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.