ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Component/s: Observability
    • None
    • Needed
    • Hide

      Summary of necessary driver changes

      • Update the unified test runner to support schema 1.29. It adds the $$gte operator and applies ignoreExtraSpans at every level of the span tree. A runner capped at 1.28 rejects the new fixtures before matching begins:
        db.mongodb.cursor_id: { $$gte: 1 }
        
      • Give each user-initiated getMore its own operation span, sibling to the cursor-creating operation's span. Driver-internal iteration adds no operation spans, no span is scoped to a cursor's lifetime, and a change stream resume ends the failed span while giving killCursors none.
      • Drivers now MUST set db.mongodb.cursor_id on operation spans that create a cursor or operate on a single existing cursor. It is never a literal 0, and for a getMore it holds the id the driver sent rather than the 0 the reply may return.
      • Add spec tests from https://github.com/mongodb/specifications/commit/d1ac31b730d87c6cc18d126149da30008ef12561 and implement prose tests 3 and 4.

      Commits for syncing spec/prose tests

      Context for other referenced/linked tickets

      • DRIVERS-3627 tracks optional span links between the sibling getMore and cursor-creating operation spans.
      • DRIVERS-3626 fixed MongoDB 4.2 server orchestration. Earlier patch runs for this ticket show two unrelated failures.
      Show
      Summary of necessary driver changes Update the unified test runner to support schema 1.29. It adds the $$gte operator and applies ignoreExtraSpans at every level of the span tree. A runner capped at 1.28 rejects the new fixtures before matching begins: db.mongodb.cursor_ id: { $$ gte: 1 } Give each user-initiated getMore its own operation span, sibling to the cursor-creating operation's span. Driver-internal iteration adds no operation spans, no span is scoped to a cursor's lifetime, and a change stream resume ends the failed span while giving killCursors none. Drivers now MUST set db.mongodb.cursor_id on operation spans that create a cursor or operate on a single existing cursor. It is never a literal 0 , and for a getMore it holds the id the driver sent rather than the 0 the reply may return. Add spec tests from https://github.com/mongodb/specifications/commit/d1ac31b730d87c6cc18d126149da30008ef12561 and implement prose tests 3 and 4. Commits for syncing spec/prose tests https://github.com/mongodb/specifications/commit/d1ac31b730d87c6cc18d126149da30008ef12561 adds the two get_more fixtures, valid-pass/operator-gte as the reference test for the new operator, and prose tests 3 and 4. https://github.com/mongodb/mongo-python-driver/pull/2994 is the Python driver implementation. Context for other referenced/linked tickets DRIVERS-3627 tracks optional span links between the sibling getMore and cursor-creating operation spans. DRIVERS-3626 fixed MongoDB 4.2 server orchestration. Earlier patch runs for this ticket show two unrelated failures.
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-6426 Backlog
      CXX-3555 Backlog
      CSHARP-6188 Backlog
      GODRIVER-4079 Backlog
      JAVA-6282 In Progress
      NODE-7763 Backlog
      PYTHON-5993 In Code Review
      PHPLIB-1928 Backlog
      RUBY-3937 Needs Triage
      RUST-2468 Ready for Work
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } #scriptField td.willNotDo { background-color: #FF0000; /* Red color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-6426 Backlog CXX-3555 Backlog CSHARP-6188 Backlog GODRIVER-4079 Backlog JAVA-6282 In Progress NODE-7763 Backlog PYTHON-5993 In Code Review PHPLIB-1928 Backlog RUBY-3937 Needs Triage RUST-2468 Ready for Work

      Summary

      The spec requires each command span to nest under "the corresponding driver operation span", which is unambiguous only while an operation sends a single command. For a cursor it never says which operation span a getMore belongs to: one span covering the cursor's whole lifetime, or a fresh one per iteration. Both readings pass the current suite, since no fixture exercises getMore, batchSize or a tailable cursor, and db.mongodb.cursor_id is asserted absent in all 25 places it appears.

      Motivation

      Who is the affected end user?

      Driver teams implementing the spec, and application developers reading the traces.

      How does this affect the end user?

      Drivers can pick either nesting and still pass, so trace shapes for a very common operation differ by language with no way to tell which is correct.

      How likely is it that this problem or use case will occur?

      Main path. Any query returning more than one batch sends a getMore.

      If the problem does occur, what are the consequences and how severe are they?

      Moderate. No outage or data risk, but cross-language traces become hard to compare, and a driver that guessed differently needs a breaking change to its span structure later.

      Is this issue urgent?

      No, but it is cheaper to settle before more drivers ship.

      Is this ticket only for tests?

      No. It needs a spec clarification too, since a test alone would make one reading of ambiguous prose normative.

      Acceptance Criteria

      • The spec states which operation span a getMore nests under, and what is expected for cursors that are never exhausted, where a lifetime-scoped span would never end.
      • A test covers a query returning more than one batch and asserts the getMore nesting, with extra spans not ignored so an unintended operation span per batch fails.
      • A test asserts db.mongodb.cursor_id is present, on both a cursor-creating command and one that uses an existing cursor.

            Assignee:
            Steve Silvester
            Reporter:
            Steve Silvester
            Nabil Hachicha Nabil Hachicha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: