RetryableWriteError label not preserved for retryable writeConcernError

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Java Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      In MixedBulkWriteOperation, when we decide to attach RetryableWriteError for a retryable write concern failure (e.g., last-attempt path), the label is currently written to the writeConcernError subdocument. However, when building MongoBulkWriteException, BulkWriteBatch.getBulkWriteException() reads labels from the top-level result.errorLabels. Labels added under writeConcernError are not parsed, so they are lost.

      Impact
      Applications checking e.hasErrorLabel("RetryableWriteError") on MongoBulkWriteException can get false even though the operation encountered a retryable write concern failure and the label should be present.

      Expected
      If the driver determines RetryableWriteError should be attached for a retryable writeConcernError, then MongoBulkWriteException.hasErrorLabel("RetryableWriteError") should be true.

      Acceptance criteria

      • labels for retryable writeConcernError are added/merged into top-level result.errorLabels and preserved on MongoBulkWriteException.
      • Re-enable the skipped test with the reason "JAVA-5341".

            Assignee:
            Slav Babanin
            Reporter:
            Slav Babanin
            Valentin Kavalenka
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: