Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-33061

Validate level:snapshot

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.3
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding 2018-03-12

      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.

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: