currentop_query.js truncation subtest is fragile when the forwarded getMore command exceeds the currentOp 1000-byte truncation limit

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • 9.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Overview

      The runTruncationTests "originatingCommand truncated" subtest in jstests/noPassthrough/query/current_op/currentop_query.js is fragile on sharded configurations and has started failing on rhel10-arm64 (see BF-44581).

      Background

      For the isRemoteShardCurOp case the test narrows the $currentOp output with the predicate:

      "command.getMore": {$gt: 0}
      

      This assumes the getMore command forwarded from mongos to the shard is reported as a structured command.getMore field. However, CurOp::reportState (src/mongo/db/curop.cpp) truncates any op command larger than 1000 bytes to a single command.$truncated string. The forwarded getMore now carries additional generic-argument metadata — ifrFlags (forwarded to shards, one {{

      {name, value}

      }} object per enabled IFR feature flag), ifrSenderVersion, and the full $client metadata — which pushes the command over the 1000-byte limit. When that happens command.getMore no longer exists as a field, so the filter never matches and confirmCurrentOpContents's assert.soon times out.

      This surfaces first on rhel10-arm64 because its $client OS/kernel strings (aarch64, "Red Hat Enterprise Linux release 10.0", longer kernel version) are longer than on the x86 variants, tipping the command over the boundary; as more IFR flags are enabled over time the x86 variants are likely to follow.

      Scope of Work

      * jstests/noPassthrough/query/current_op/currentop_query.js — make the remote-shard branch of the truncation subtest robust to the forwarded getMore command being truncated. Identify the op via stable fields that survive truncation (op: "getmore" plus the existing cursor.originatingCommand.$truncated / cursor.originatingCommand.comment predicates) instead of relying on command.getMore.

      Acceptance Criteria

      * currentop_query.js passes in the no_passthrough suite on rhel10-arm64 (and other variants) with IFR flags enabled.

      Technical Notes

      * Truncation limit is 1000 bytes, set in src/mongo/db/curop.cpp (maxQuerySize).
      * Whether getMore should carry ifrFlags/ifrSenderVersion to shards at all (they are documented as "Currently, used only in Agg command pipeline" in src/mongo/idl/generic_argument.idl) is a separate product question and out of scope for this test fix.

            Assignee:
            Mickey Winters
            Reporter:
            Mickey Winters
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: