Reset reply builder on CollectionBecameView retry in runAggregate

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • 9.0 Required
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • v9.0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      runAggregate (in src/mongo/db/commands/query_cmd/run_aggregate.cpp) wraps execution in retryOnWithState, which retries on ErrorCodes::CollectionBecameView — the error thrown by CommonMongodProcessInterface's foreign-collection resolution (common_mongod_process_interface.cpp) when a timeseries collection concurrently transitions between viewful and viewless (e.g. during an FCV upgrade/downgrade). The CollectionBecameView error handler was an empty lambda and did not reset the reply builder between attempts.

      For an explain, the first attempt appends a top-level explainVersion field to the reply body via Explain::explainPipeline before the pipeline executes and throws. Because the handler did not reset the reply, the retry appended a second explainVersion, producing a reply with a duplicate field. Serializing that reply trips OP_MSG duplicate-field validation and aborts the node.

            Assignee:
            Mariano Shaar
            Reporter:
            Mariano Shaar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: