Skip to content

GODRIVER-3844 Add maxAdaptiveRetries and enableOverloadRetargeting options for backpressure.#2363

Draft
qingyang-hu wants to merge 5 commits intomongodb:masterfrom
qingyang-hu:godriver3844
Draft

GODRIVER-3844 Add maxAdaptiveRetries and enableOverloadRetargeting options for backpressure.#2363
qingyang-hu wants to merge 5 commits intomongodb:masterfrom
qingyang-hu:godriver3844

Conversation

@qingyang-hu
Copy link
Copy Markdown
Contributor

GODRIVER-3844, GODRIVER-3859

Summary

Background & Motivation

@mongodb-drivers-pr-bot
Copy link
Copy Markdown
Contributor

API Change Report

./v2/mongo/options

compatible changes

(*ClientOptions).SetEnableOverloadRetargeting: added
(*ClientOptions).SetMaxAdaptiveRetries: added
ClientOptions.EnableOverloadRetargeting: added
ClientOptions.MaxAdaptiveRetries: added

./v2/x/mongo/driver

compatible changes

Operation.EnableOverloadRetargeting: added
Operation.MaxAdaptiveRetries: added

./v2/x/mongo/driver/auth

compatible changes

HandshakeOptions.EnableOverloadRetargeting: added
HandshakeOptions.MaxAdaptiveRetries: added

./v2/x/mongo/driver/connstring

compatible changes

ConnString.EnableOverloadRetargeting: added
ConnString.EnableOverloadRetargetingSet: added
ConnString.MaxAdaptiveRetries: added
ConnString.MaxAdaptiveRetriesSet: added

./v2/x/mongo/driver/mnet

incompatible changes

Connection: no longer implements ReadWriteCloser
io.Closer.Close, method set of Connection: removed

compatible changes

(*Connection).Closed: added

./v2/x/mongo/driver/operation

compatible changes

(*Aggregate).EnableOverloadRetargeting: added
(*Aggregate).MaxAdaptiveRetries: added
(*Command).EnableOverloadRetargeting: added
(*Command).MaxAdaptiveRetries: added
(*Count).EnableOverloadRetargeting: added
(*Count).MaxAdaptiveRetries: added
(*CreateIndexes).EnableOverloadRetargeting: added
(*CreateIndexes).MaxAdaptiveRetries: added
(*Delete).EnableOverloadRetargeting: added
(*Delete).MaxAdaptiveRetries: added
(*Distinct).EnableOverloadRetargeting: added
(*Distinct).MaxAdaptiveRetries: added
(*DropIndexes).EnableOverloadRetargeting: added
(*DropIndexes).MaxAdaptiveRetries: added
(*Find).EnableOverloadRetargeting: added
(*Find).MaxAdaptiveRetries: added
(*FindAndModify).EnableOverloadRetargeting: added
(*FindAndModify).MaxAdaptiveRetries: added
(*Hello).EnableOverloadRetargeting: added
(*Hello).MaxAdaptiveRetries: added
(*ListCollections).EnableOverloadRetargeting: added
(*ListCollections).MaxAdaptiveRetries: added
(*ListDatabases).EnableOverloadRetargeting: added
(*ListDatabases).MaxAdaptiveRetries: added
(*ListIndexes).EnableOverloadRetargeting: added
(*ListIndexes).MaxAdaptiveRetries: added
(*Update).EnableOverloadRetargeting: added
(*Update).MaxAdaptiveRetries: added

./v2/x/mongo/driver/session

compatible changes

Client.EnableOverloadRetargeting: added
Client.MaxAdaptiveRetries: added

./v2/x/mongo/driver/topology

compatible changes

WithEnableOverloadRetargeting: added
WithMaxAdaptiveRetries: added

@mongodb-drivers-pr-bot
Copy link
Copy Markdown
Contributor

mongodb-drivers-pr-bot bot commented Apr 19, 2026

🧪 Performance Results

Commit SHA: 8bcdd80

The following benchmark tests for version 69e476d7036fd50007208d7e had statistically significant changes (i.e., |z-score| > 1.96):

Benchmark Measurement % Change Patch Value Stable Region H-Score Z-Score
BenchmarkMultiInsertSmallDocument total_time_seconds -10.4819 1.0590 Avg: 1.1830
Med: 1.1921
Stdev: 0.0237
0.9197 -5.2212
BenchmarkSmallDocInsertOne allocated_bytes_per_op 0.4193 5711.0000 Avg: 5687.1546
Med: 5688.0000
Stdev: 4.9167
0.9110 4.8499
BenchmarkLargeDocInsertOne allocated_bytes_per_op 0.4124 5710.0000 Avg: 5686.5464
Med: 5688.0000
Stdev: 5.0683
0.9061 4.6275
BenchmarkSingleRunCommand allocated_bytes_per_op 0.1760 12217.0000 Avg: 12195.5369
Med: 12196.0000
Stdev: 5.4816
0.8677 3.9155

For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch.

@qingyang-hu qingyang-hu force-pushed the godriver3844 branch 2 times, most recently from f2ccd4e to 86be26d Compare April 19, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant