-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: backpressure-1.0
-
Component/s: Backpressure
-
None
The Client Backpressure specification expands the driver's overload retry policy to all commands, including those that are not eligible for retry under the read/write retry policies.
Today, a set of write-command operations dispatch their server command with no retry wrapper at all, so a server SystemOverloadedError on these commands is surfaced immediately instead of being retried with backoff.
The authoritative list of affected commands comes from:
- retryable-writes spec — Unsupported Write Operations: write commands other than insert / update / delete / findAndModify, e.g. aggregate with $out / $merge.
- retryable-reads spec — Unsupported Read Operations.
Peer drivers have already implemented this:
- PyMongo retries all of these gated on retry_writes (including the search-index ops).
- Node retries all except the search-index ops.
Scope
Add overload-only retry, composed via
SpecRetryPolicy.IndividualPolicies(retryWrites)
.includeOverload(maxAdaptiveRetries, AS_WRITE_POLICY)
to the following operations, gated on the client retryWrites setting:
- createIndexes
- dropIndexes
- createCollection
- createView
- dropCollection
- dropDatabase
- renameCollection
- aggregate with $out / $merge
- createSearchIndexes, updateSearchIndex, dropSearchIndex
Overload-only (not includeWrite()) because these commands are ineligible for write retry - no txnNumber / retryable-writes semantics should be added.
Non-goals
- mapReduce (inline and to-collection) — deprecated in the driver, removed from MongoDB 5.0 and PyMongo; excluded.
- Unacknowledged w:0 writes - no response carries an overload error.
- runCommand (
JAVA-6294), getMore (JAVA-6296), multi-doc update / delete - already overload-retried. - killCursors overload retry - tracked separately.
Acceptance criteria
- All affected operations overload-retry up to maxAdaptiveRetries times when the server returns SystemOverloadedError + RetryableError, gated on retryWrites.
- No retry when retryWrites=false or on non-overload errors.
- The 8 previously
JAVA-5956-skipped unified client-backpressure scenarios (createIndex / dropIndex / dropIndexes / aggregate-write) pass for both sync and reactive drivers. - Prose tests cover the operations that lack unified coverage (admin / index / search-index commands).