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

更新shard key并abortTransaction得到报错并导致mongos hang

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL

      mongo5.0.4   redhat 8

      操作步骤:

      MongoDB Enterprise mongos> var session = db.getMongo().startSession()
      MongoDB Enterprise mongos> session.startTransaction()
      MongoDB Enterprise mongos> var tb1 = session.getDatabase('testdb01').getCollection('table01')
      MongoDB Enterprise mongos> tb1.updateOne({id:1},{$set:{"id":"88888"}},{multi:false})

      { "acknowledged" : true, "matchedCount" : 1, "modifiedCount" : 1 }

      MongoDB Enterprise mongos> session.commitTransaction()
      uncaught exception: Error: command failed: {
      "ok" : 0,
      "errmsg" : "Transaction was aborted :: caused by :: from shard rs_shard03 :: caused by :: 'prepareTransaction' is not supported for replica sets with arbiters",
      "code" : 148,
      "codeName" : "ReadConcernMajorityNotEnabled",
      "$clusterTime" : {
      "clusterTime" : Timestamp(1647248380, 3),
      "signature" :

      { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) }

      },
      "operationTime" : Timestamp(1647248380, 3),
      "recoveryToken" :

      { "recoveryShardId" : "rs_shard03" }

      } with original command request: {
      "commitTransaction" : 1,
      "txnNumber" : NumberLong(0),
      "lsid" :

      { "id" : UUID("4baec96b-8124-4b4d-a3ac-c99a375ba7b0") }

      ,
      "$clusterTime" : {
      "clusterTime" : Timestamp(1647248371, 2),
      "signature" :

      { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) }

      },
      "autocommit" : false,
      "stmtId" : NumberInt(1)
      } on connection: connection to 127.0.0.1:32017 :
      _getErrorWithCode@src/mongo/shell/utils.js:25:13
      doassert@src/mongo/shell/assert.js:18:14
      _assertCommandWorked@src/mongo/shell/assert.js:737:17
      assert.commandWorked@src/mongo/shell/assert.js:829:16
      commitTransaction@src/mongo/shell/session.js:977:17
      @(shell):1:1

      然后mongos上find,currentOp等操作都无响应了。

       

            Assignee:
            yuan.fang@mongodb.com Yuan Fang
            Reporter:
            251237926@qq.com Yi deng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: