From 8671d26a5c07adfd72a03e965e3ec0361b517d0e Mon Sep 17 00:00:00 2001 From: yuxiqian <34335406+yuxiqian@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:55:22 +0800 Subject: [PATCH 1/2] [JAVA-5224] Make ReadConcernMajorityNotAvailableYet a retryable error --- .../internal/operation/ChangeStreamBatchCursorHelper.java | 2 +- .../com/mongodb/client/unified/UnifiedTestModifications.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/driver-core/src/main/com/mongodb/internal/operation/ChangeStreamBatchCursorHelper.java b/driver-core/src/main/com/mongodb/internal/operation/ChangeStreamBatchCursorHelper.java index 7cfdd474dda..1bed2ed2b0f 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/ChangeStreamBatchCursorHelper.java +++ b/driver-core/src/main/com/mongodb/internal/operation/ChangeStreamBatchCursorHelper.java @@ -35,7 +35,7 @@ final class ChangeStreamBatchCursorHelper { @VisibleForTesting(otherwise = PRIVATE) static final List RETRYABLE_SERVER_ERROR_CODES = - asList(6, 7, 63, 89, 91, 133, 150, 189, 234, 262, 9001, 10107, 11600, 11602, 13388, 13435, 13436); + asList(6, 7, 63, 89, 91, 133, 134, 150, 189, 234, 262, 9001, 10107, 11600, 11602, 13388, 13435, 13436); @VisibleForTesting(otherwise = PRIVATE) static final String RESUMABLE_CHANGE_STREAM_ERROR_LABEL = "ResumableChangeStreamError"; diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java index 5184fd699be..46f1ada694b 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java @@ -167,8 +167,6 @@ public static void doSkips(final TestDef def) { .file("retryable-reads", "listDatabaseObjects-serverErrors") .file("retryable-reads", "listCollectionObjects") .file("retryable-reads", "listCollectionObjects-serverErrors"); - def.skipJira("https://jira.mongodb.org/browse/JAVA-5224") - .test("retryable-reads", "ReadConcernMajorityNotAvailableYet is a retryable read", "Find succeeds on second attempt after ReadConcernMajorityNotAvailableYet"); // retryable-writes From 5b9ebc4ec9fd1c83867d1a48772de52385df7836 Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Fri, 28 Mar 2025 20:20:31 -0400 Subject: [PATCH 2/2] add 134 to CommandOperationHelper --- .../com/mongodb/internal/operation/CommandOperationHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-core/src/main/com/mongodb/internal/operation/CommandOperationHelper.java b/driver-core/src/main/com/mongodb/internal/operation/CommandOperationHelper.java index 2861bcf9ad5..db6870f52e8 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/CommandOperationHelper.java +++ b/driver-core/src/main/com/mongodb/internal/operation/CommandOperationHelper.java @@ -127,7 +127,7 @@ static RetryState initialRetryState(final boolean retry, final TimeoutContext ti return RetryState.withNonRetryableState(); } - private static final List RETRYABLE_ERROR_CODES = asList(6, 7, 89, 91, 189, 262, 9001, 13436, 13435, 11602, 11600, 10107); + private static final List RETRYABLE_ERROR_CODES = asList(6, 7, 89, 91, 134, 189, 262, 9001, 13436, 13435, 11602, 11600, 10107); static boolean isRetryableException(final Throwable t) { if (!(t instanceof MongoException)) { return false;