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

Read concern snapshot should prohibit queries with tailable option

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.0
    • Affects Version/s: 3.7.9
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide
      var r = new ReplSetTest({nodes:2});
      r.startSet();
      r.initiate();
      
      var dbName = 'test';
      var collName = 'tailable-cursor-repro';
      
      const sessionOptions = {causalConsistency: false};
      const session = r.getPrimary().startSession(sessionOptions);
      const sessionDb = session.getDatabase(dbName);
      const sessionColl = sessionDb.getCollection(collName);
      
      assert.commandWorked(sessionDb.runCommand({create: collName, writeConcern: {w: "majority"}, capped: true, size:2048}));
      
      session.startTransaction();
      sessionColl.insert({x:1});
      var cmdRes = sessionDb.runCommand({find: collName, batchSize: 2, awaitData: true, tailable: true});
      cmdRes = sessionDb.runCommand({getMore: cmdRes.cursor.id, collection: collName});
      
      // session.commitTransaction();
      
      Show
      var r = new ReplSetTest({nodes:2}); r.startSet(); r.initiate(); var dbName = 'test' ; var collName = 'tailable-cursor-repro' ; const sessionOptions = {causalConsistency: false }; const session = r.getPrimary().startSession(sessionOptions); const sessionDb = session.getDatabase(dbName); const sessionColl = sessionDb.getCollection(collName); assert.commandWorked(sessionDb.runCommand({create: collName, writeConcern: {w: "majority" }, capped: true , size:2048})); session.startTransaction(); sessionColl.insert({x:1}); var cmdRes = sessionDb.runCommand({find: collName, batchSize: 2, awaitData: true , tailable: true }); cmdRes = sessionDb.runCommand({getMore: cmdRes.cursor.id, collection: collName}); // session.commitTransaction();
    • Query 2018-05-07, Query 2018-05-21

      Stacktrace:

       2018-05-01T13:06:22.333-0400 F -        [conn1] Invariant failure _yieldPolicy->canReleaseLocksDuringExecution() src/mongo/db/query/plan_executor.cpp 429
       2018-05-01T13:06:22.333-0400 F -        [conn1] 
       
       ***aborting after invariant() failure
      
       mongo::invariantFailed(char const*, char const*, unsigned int)
       mongo::PlanExecutor::shouldWaitForInserts()
       mongo::PlanExecutor::getNextImpl(mongo::Snapshotted<mongo::BSONObj>*, mongo::RecordId*)
       mongo::PlanExecutor::getNext(mongo::BSONObj*, mongo::RecordId*)
       mongo::(anonymous namespace)::GetMoreCmd::runParsed(mongo::OperationContext*, mongo::NamespaceString const&, mongo::GetMoreRequest const&, mongo::BSONObj const&, mongo::BSONObjBuilder&)
       mongo::(anonymous namespace)::GetMoreCmd::run(mongo::OperationContext*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, mongo::BSONObj const&, mongo::BSONObjBuilder&)
       mongo::BasicCommand::Invocation::run(mongo::OperationContext*, mongo::CommandReplyBuilder*)
       mongo::(anonymous namespace)::invokeInTransaction(mongo::OperationContext*, mongo::CommandInvocation*, mongo::CommandReplyBuilder*)
       mongo::(anonymous namespace)::execCommandDatabase(mongo::OperationContext*, mongo::Command*, mongo::OpMsgRequest const&, mongo::rpc::ReplyBuilderInterface*, mongo::ServiceEntryPointCommon::Hooks const&)
       mongo::ServiceEntryPointCommon::handleRequest(mongo::OperationContext*, mongo::Message const&, mongo::ServiceEntryPointCommon::Hooks const&)
       mongo::ServiceEntryPointMongod::handleRequest(mongo::OperationContext*, mongo::Message const&)
       mongo::ServiceStateMachine::_processMessage(mongo::ServiceStateMachine::ThreadGuard)
       mongo::ServiceStateMachine::_runNextInGuard(mongo::ServiceStateMachine::ThreadGuard)
       std::__1::__function::__func<mongo::ServiceStateMachine::_scheduleNextWithGuard(mongo::ServiceStateMachine::ThreadGuard, mongo::transport::ServiceExecutor::ScheduleFlags, mongo::transport::ServiceExecutorTaskName, mongo::ServiceStateMachine::Ownership)::$_0, std::__1::allocator<mongo::ServiceStateMachine::_scheduleNextWithGuard(mongo::ServiceStateMachine::ThreadGuard, mongo::transport::ServiceExecutor::ScheduleFlags, mongo::transport::ServiceExecutorTaskName, mongo::ServiceStateMachine::Ownership)::$_0>, void ()>::operator()()
       mongo::transport::ServiceExecutorSynchronous::schedule(std::__1::function<void ()>, mongo::transport::ServiceExecutor::ScheduleFlags, mongo::transport::ServiceExecutorTaskName)
       mongo::ServiceStateMachine::_scheduleNextWithGuard(mongo::ServiceStateMachine::ThreadGuard, mongo::transport::ServiceExecutor::ScheduleFlags, mongo::transport::ServiceExecutorTaskName, mongo::ServiceStateMachine::Ownership)
       mongo::ServiceStateMachine::_sourceCallback(mongo::Status)
       mongo::ServiceStateMachine::_sourceMessage(mongo::ServiceStateMachine::ThreadGuard)
       mongo::ServiceStateMachine::_runNextInGuard(mongo::ServiceStateMachine::ThreadGuard)
       std::__1::__function::__func<mongo::ServiceStateMachine::_scheduleNextWithGuard(mongo::ServiceStateMachine::ThreadGuard, mongo::transport::ServiceExecutor::ScheduleFlags, mongo::transport::ServiceExecutorTaskName, mongo::ServiceStateMachine::Ownership)::$_0, std::__1::allocator<mongo::ServiceStateMachine::_scheduleNextWithGuard(mongo::ServiceStateMachine::ThreadGuard, mongo::transport::ServiceExecutor::ScheduleFlags, mongo::transport::ServiceExecutorTaskName, mongo::ServiceStateMachine::Ownership)::$_0>, void ()>::operator()()
       std::__1::__function::__func<mongo::transport::ServiceExecutorSynchronous::schedule(std::__1::function<void ()>, mongo::transport::ServiceExecutor::ScheduleFlags, mongo::transport::ServiceExecutorTaskName)::$_0, std::__1::allocator<mongo::transport::ServiceExecutorSynchronous::schedule(std::__1::function<void ()>, mongo::transport::ServiceExecutor::ScheduleFlags, mongo::transport::ServiceExecutorTaskName)::$_0>, void ()>::operator()()
       mongo::(anonymous namespace)::runFunc(void*)
      

            Assignee:
            ian.boros@mongodb.com Ian Boros
            Reporter:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: