Skip to content

Add RetryableWriteError to write concern error in bulk writes.#1880

Open
vbabanin wants to merge 4 commits intomongodb:mainfrom
vbabanin:JAVA-6087
Open

Add RetryableWriteError to write concern error in bulk writes.#1880
vbabanin wants to merge 4 commits intomongodb:mainfrom
vbabanin:JAVA-6087

Conversation

@vbabanin
Copy link
Member

@vbabanin vbabanin commented Feb 3, 2026

This PR fixes a label-loss in bulk write error handling. When a bulk write returns ok: 1 with a retryable writeConcernError, the driver may decide to attach the RetryableWriteError label, but the label was being added to the writeConcernError subdocument. MongoBulkWriteException parsing reads labels from the top-level errorLabels array, so labels attached under writeConcernError were not added to the thrown MongoBulkWriteException.

Change

Attach RetryableWriteError into the top-level result["errorLabels"] for the relevant write concern error path (instead of result["writeConcernError"]).

Keep behavior consistent with server-originated labels (raw result is not exposed to users; labels are processed via existing parsing).

Tests

Re-enabled unified test (now passing).

JAVA-6087

@vbabanin vbabanin self-assigned this Feb 3, 2026
@vbabanin vbabanin marked this pull request as ready for review February 4, 2026 02:48
@vbabanin vbabanin requested a review from a team as a code owner February 4, 2026 02:48
@vbabanin vbabanin requested a review from stIncMale February 4, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant