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

moveChunk command fails with "Transaction numbers are only allowed on a replica set member or mongos" on Mongo 4.4 mongos without replica sets

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.4.16
    • Component/s: None
    • None
    • ALL
    • Hide
      mongos> db.adminCommand({ setFeatureCompatibilityVersion: '4.4' })
      {
          "ok" : 1,
          "operationTime" : Timestamp(1662643030, 1),
          "$clusterTime" : {
              "clusterTime" : Timestamp(1662643030, 1),
              "signature" : {
                  "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                  "keyId" : NumberLong(0)
              }
          }
      }
      mongos> db.adminCommand({"moveChunk": "localtest.manual_User", "find": {"_id": "$minKey"}, "to": "shard0001"})
      {
          "ok" : 0,
          "errmsg" : "Transaction numbers are only allowed on a replica set member or mongos",
          "code" : 20,
          "codeName" : "IllegalOperation",
          "operationTime" : Timestamp(1662643375, 6),
          "$clusterTime" : {
              "clusterTime" : Timestamp(1662643375, 6),
              "signature" : {
                  "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                  "keyId" : NumberLong(0)
              }
          }
      }
      mongos> db.adminCommand({ setFeatureCompatibilityVersion: '4.2' })
      {
          "ok" : 1,
          "operationTime" : Timestamp(1662643386, 1049),
          "$clusterTime" : {
              "clusterTime" : Timestamp(1662643386, 1049),
              "signature" : {
                  "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                  "keyId" : NumberLong(0)
              }
          }
      }
      mongos> db.adminCommand({"moveChunk": "localtest.manual_User", "find": {"_id": "$minKey"}, "to": "shard0001"})
      {
          "millis" : 143,
          "ok" : 1,
          "operationTime" : Timestamp(1662643390, 6),
          "$clusterTime" : {
              "clusterTime" : Timestamp(1662643390, 6),
              "signature" : {
                  "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                  "keyId" : NumberLong(0)
              }
          }
      } 
      Show
      mongos> db.adminCommand({ setFeatureCompatibilityVersion: '4.4' }) {     "ok" : 1,     "operationTime" : Timestamp(1662643030, 1),     "$clusterTime" : {         "clusterTime" : Timestamp(1662643030, 1),         "signature" : {             "hash" : BinData(0, "AAAAAAAAAAAAAAAAAAAAAAAAAAA=" ),             "keyId" : NumberLong(0)         }     } } mongos> db.adminCommand({ "moveChunk" : "localtest.manual_User" , "find" : { "_id" : "$minKey" }, "to" : "shard0001" }) {     "ok" : 0,     "errmsg" : "Transaction numbers are only allowed on a replica set member or mongos" ,     "code" : 20,     "codeName" : "IllegalOperation" ,     "operationTime" : Timestamp(1662643375, 6),     "$clusterTime" : {         "clusterTime" : Timestamp(1662643375, 6),         "signature" : {             "hash" : BinData(0, "AAAAAAAAAAAAAAAAAAAAAAAAAAA=" ),             "keyId" : NumberLong(0)         }     } } mongos> db.adminCommand({ setFeatureCompatibilityVersion: '4.2' }) {     "ok" : 1,     "operationTime" : Timestamp(1662643386, 1049),     "$clusterTime" : {         "clusterTime" : Timestamp(1662643386, 1049),         "signature" : {             "hash" : BinData(0, "AAAAAAAAAAAAAAAAAAAAAAAAAAA=" ),             "keyId" : NumberLong(0)         }     } } mongos> db.adminCommand({ "moveChunk" : "localtest.manual_User" , "find" : { "_id" : "$minKey" }, "to" : "shard0001" }) {     "millis" : 143,     "ok" : 1,     "operationTime" : Timestamp(1662643390, 6),     "$clusterTime" : {         "clusterTime" : Timestamp(1662643390, 6),         "signature" : {             "hash" : BinData(0, "AAAAAAAAAAAAAAAAAAAAAAAAAAA=" ),             "keyId" : NumberLong(0)         }     } }

      We are in the process of upgrading our sharded Mongo cluster from 4.2 to 4.4. In production, we use replica sets, but in dev/test we do not. In dev/test, after upgrading featureCompatibilityVersion to 4.4, a moveChunk command executed from mongos fails with "Transaction numbers are only allowed on a replica set member or mongos". After downgrading to fcv 4.2, the moveChunk command succeeds. I encounter the same error both from the Java driver and mongo shell - in both cases retryable reads and retryable writes are disabled (we have had retryable reads and writes disabled since we upgraded to 4.0, since with them enabled we encountered similar errors about transactions not being supported without replica sets). The error message implies transaction numbers are allowed on mongos, which is where I am executing the command from. It also is unclear why there is a transaction number in the command in the first place. When I set breakpoints in the Java driver and inspect the moveChunk command at various points prior to it being sent to the server, there is no transaction number.
       
      Thanks!

            Assignee:
            chris.kelly@mongodb.com Chris Kelly
            Reporter:
            ian.springer@gmail.com Ian Springer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: