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

Upsert statements which result in an insert may fail with tassert 9146500 when client connects directly to shard

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 8.1.0-rc0, 8.0.1
    • Affects Version/s: 8.0.0
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • ALL
    • v8.0
    • QE 2024-09-30

      Issue Status as of Sept 26, 2024

      ISSUE DESCRIPTION AND IMPACT

      This bug affects a very specific upsert-only workload when transitioning between a replica set and a single-shard cluster topology, and affects operations performed by clients connecting directly to the shard. Note that direct-to-shard write operations are not recommended at any other time.

      Specifically, write operations on single-shard clusters can fail when all of the following are true:

      • Performed via direct-to-shard connections
      • The namespace receiving those operations is only receiving upsert operations which resolve to insert operations
      • No operations to the namespace are being issued to mongos routers

      There is a known workaround (that is part of the documented and expected normal procedure of upgrading to a sharded cluster) of switching your connection string to mongos. Until then, operations may fail with the following message logged on mongod:

      {"t":{"$date":"2024-09-24T10:00:00.000+00:00"},"s":"E",  "c":"ASSERT",   "id":4457000, "svc":"S", "ctx":"conn1","msg":"Tripwire assertion","attr":{"error":{"code":9146500,"codeName":"Location9146500","errmsg":"An update plan should never yield after having performed an upsert"},"location":"{fileName:\"src/mongo/db/query/plan_executor_impl.cpp\", line:683, functionName:\"executeUpdate\"}"}}
      

      This issue will be corrected by SERVER-95244 in 8.0.1. If you must transition to a sharded cluster while on 8.0.0 and have an upsert-only workload, you should expect these operation failures and plan accordingly by transitioning clients to mongos routers swiftly.

      DIAGNOSIS AND AFFECTED VERSIONS

      • Affected Versions: 8.0.0
      • Fixed Versions: 8.0.1 (upcoming)

      REMEDIATION AND WORKAROUNDS

      User action is required in order to remediate this issue. Impacted users should follow the below steps:

      1. Upgrade to a fixed version once released, or
      2. Update your application to only connect to the cluster through a mongos

      Inserts performed as part of upsert operations issued directly to a single-shard cluster may fail with tassert 9146500 if the namespace is not receiving any other operation type or is not receiving operations issued by mongos routers.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: