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

Validate level:snapshot

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.7.3
    • None
    • Sharding
    • None
    • Fully Compatible
    • Sharding 2018-03-12

    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.

      Attachments

        Activity

          People

            misha.tyulenev@mongodb.com Misha Tyulenev
            misha.tyulenev@mongodb.com Misha Tyulenev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: