Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-6403

Add CSOT to new client bulkWrite API

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.11.0
    • Affects Version/s: None
    • Component/s: None
    • 5
    • Not Needed
    • Hide

      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.

      Show
      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      As a... user of the Node.js driver
      I want... the new bulk write API to respect the CSOT timeoutMS
      So that... I can consistently rely on the CSOT feature for all operations

      User Experience

      • New bulk write respects timeoutMS

      Dependencies

      • None

      Risks/Unknowns

      • What could go wrong while implementing this change? (e.g., performance, inadvertent behavioral changes in adjacent functionality, existing tech debt, etc)
        • What does it mean for client.bulkWrite to be available and CSOT to be available, but a feature release makes bulkWrite start respecting a timeoutMS without code changes?
          • We are not going to take this approach; timeoutMS will need to be explicitly opt-in later if we don't implement CSOT for it right away (i.e., remove the option from new bulk write).
        • Does the spec have language about how client.bulkWrite works with CSOT? How are batches meant to be timed out, how is the cursor supposed to be configured?
          • timeoutMS will bound the total execution time for all the batches and the lifetime of all cursors
        • Are there spec tests for CSOT and client.bulkWrite specifically?
          • Yes, one prose test
      • Is there an opportunity for better cross-driver alignment or testing in this area?
        • Yes, we should capture relevant clarifications in a DRIVERS ticket, and add more spec testing
      • Is there an opportunity to improve existing documentation on this subject?
        • N/A

      Acceptance Criteria

      Implementation Requirements

      • Implement support for timeoutMS in the new bulk write

      Testing Requirements

      • Unskip CSOT prose test 11

      Test Scenarios

      when CSOT is enabled, acknowledged writes:

      • If the bulkWrite command takes longer than timeoutMS, the operation fails with a timeout error.
      • If the bulkWrite command + iterating the result cursor takes longer than timeoutMS, the operation fails with a timeout error.
      • If the cursor errors, the cursor refreshes the timeout with a full timeoutMS for the killCursors command.
      • If the cursor errors and the timeout must be refreshed, the global timeout must not be impacted and subsequent batches must still be governed by the initial timeoutMS value. (i.e., `cursor.cleanup()` does not mutate the provided timeout context when refreshing the timeout)

      when CSOT is enabled, unacknowledged writes:

      • If the bulkWrite command takes longer than timeoutMS, the operation fails with a timeout error.
      • For multi-batch writes, if executing all batches takes longer than timeoutMS, the operation fails with a timeout error.

      Documentation Requirements

      • API docs

      Follow Up Requirements

      • N/A

        There are no Sub-Tasks for this issue.

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: