Repository navigation
[release-7.4] Forward-port stale peer fixes (storage server, commit/grv proxy) - #13912
Merged
Merged
Conversation
spraza
marked this pull request as ready for review
August 19, 2026 21:33
…, grv proxy) Client processes can keep stale RequestStream references to dead storage-server/proxy peers (via DatabaseContext::locationCache and MonitorLeader::shrinkProxyList's sampled subset), causing connection-timeout churn. Adds opt-in draining of dead-peer connections: a per-DatabaseContext peer evictor driven by a persistent per-address connect-failed counter, a shrinkProxyList cache clear below the connection cap, eager proxy rebuild on clientInfo change, and an InterfaceTracker observability layer (all gated by knobs, default off in production). invalidateCacheByAddress(es) processes ranges in chunks and yields between chunks to avoid hogging the event loop on large caches. Includes StalePeerTest, a deterministic repro workload. Ported from upstream/release-7.3 PR apple#13367 (51e1c42) and PR apple#13643 (805c271). Conflicts resolved in: tests/CMakeLists.txt, fdbclient/NativeAPI.actor.cpp, fdbclient/include/fdbclient/CommitProxyInterface.h, fdbclient/include/fdbclient/StorageServerInterface.h, fdbrpc/include/fdbrpc/FlowTransport.h, fdbserver/SimulatedCluster.actor.cpp.
spraza
force-pushed
the
port-7.4-stalepeer-combined
branch
from
August 19, 2026 21:33
058497d to
2b7ffd7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-macos-m1 on macOS 14.x
|
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-clang-arm on Linux RHEL 9
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-clang on Linux RHEL 9
|
Contributor
Result of foundationdb-pr on Linux RHEL 9
|
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
alecgrieser
approved these changes
Aug 20, 2026
alecgrieser
left a comment
Contributor
There was a problem hiding this comment.
LGTM. My main comment is on whether we want to make these new knobs opt-in by default in 7.4, but I could also see giving it a bit more time to bake
| init( MAX_CLIENT_STATUS_AGE, 1.0 ); | ||
| init( MAX_COMMIT_PROXY_CONNECTIONS, 5 ); if( randomize && BUGGIFY ) MAX_COMMIT_PROXY_CONNECTIONS = 1; | ||
| init( MAX_GRV_PROXY_CONNECTIONS, 3 ); if( randomize && BUGGIFY ) MAX_GRV_PROXY_CONNECTIONS = 1; | ||
| init( SHRINK_PROXY_LIST_CLEAR_CACHE_BELOW_THRESHOLD, false ); if( randomize && isSimulated ) SHRINK_PROXY_LIST_CLEAR_CACHE_BELOW_THRESHOLD = deterministicRandom()->coinflip(); |
Contributor
There was a problem hiding this comment.
During the original 7.3 PR, we'd discussed that maybe we want to make these on by default in 7.4. I could buy the argument that they haven't yet had enough bake time, and we should hold off on doing that for either 8.0 or a 7.4 patch release.
Collaborator
Author
There was a problem hiding this comment.
Sorry missed this earlier. My plan is to turn the knobs on by default in a 7.4 patch release. Want some bake time as you said. In main branch and 8.0, these will be on by default.
Contributor
Result of foundationdb-pr-macos on macOS 14.x
|
ploxiln
approved these changes
Aug 20, 2026
spraza
added a commit
that referenced
this pull request
Sep 17, 2026
* Fix stale peers for client facing roles (storage server, commit proxy, grv proxy) (#13912) Client processes can keep stale RequestStream references to dead storage-server/proxy peers (via DatabaseContext::locationCache and MonitorLeader::shrinkProxyList's sampled subset), causing connection-timeout churn. Adds opt-in draining of dead-peer connections: a per-DatabaseContext peer evictor driven by a persistent per-address connect-failed counter, a shrinkProxyList cache clear below the connection cap, eager proxy rebuild on clientInfo change, and an InterfaceTracker observability layer (all gated by knobs, default off in production). invalidateCacheByAddress(es) processes ranges in chunks and yields between chunks to avoid hogging the event loop on large caches. Includes StalePeerTest, a deterministic repro workload. Ported from upstream/release-7.3 PR #13367 (51e1c42) and PR #13643 (805c271). Conflicts resolved in: tests/CMakeLists.txt, fdbclient/NativeAPI.actor.cpp, fdbclient/include/fdbclient/CommitProxyInterface.h, fdbclient/include/fdbclient/StorageServerInterface.h, fdbrpc/include/fdbrpc/FlowTransport.h, fdbserver/SimulatedCluster.actor.cpp. (cherry picked from commit 2963ee8) * Enable stale peer fixes by default on main/8.0 Flip the three stale-peer client-facing mitigation knobs from off to on by default now that they have had bake time on 7.3/7.4: - location_cache_peer_evictor_enabled - shrink_proxy_list_clear_cache_below_threshold - dbcontext_eager_proxy_update The forward-port landed these off by default (opt-in). By the 8.0 cut they will have had sufficient production bake time, so main should ship with them on. The simulation randomization (coinflip under randomize && isSimulated) is left unchanged, so simulation still exercises both on and off states; only the production default changes. The stale_peer_observability tracing knob is intentionally left off (it is a debug aid, not a mitigation, and carries overhead). * fix clang-format * fix clang-tidy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Forward-ports the stale-peer connection-timeout fixes from release-7.3 to release-7.4.
Ported from:
Squashed into a single commit here, applied in that order since #13643 depends on the
invalidateCacheByAddresspath #13367 introduced.What it does
Client processes can keep stale RequestStream references to dead storage-server/proxy peers (via
DatabaseContext::locationCacheandMonitorLeader::shrinkProxyList's sampled subset), causing connection-timeout churn. Adds opt-in draining of dead-peer connections: a per-DatabaseContext peer evictor driven by a persistent per-address connect-failed counter, a shrinkProxyList cache clear below the connection cap, eager proxy rebuild on clientInfo change, and an InterfaceTracker observability layer (all gated by knobs, default off in production).invalidateCacheByAddress(es)processes ranges in chunks and yields between chunks to avoid hogging the event loop on large caches. IncludesStalePeerTest, a deterministic repro workload.Conflicts resolved during the port
release-7.4 had already diverged from 7.3 in ways that touch the same files:
tests/CMakeLists.txt,fdbclient/NativeAPI.actor.cpp,fdbclient/include/fdbclient/CommitProxyInterface.h,fdbrpc/include/fdbrpc/FlowTransport.h,fdbserver/SimulatedCluster.actor.cpp-- 7.4 additions kept alongside the ported code (no functionality dropped from either side).fdbclient/include/fdbclient/StorageServerInterface.h-- kept 7.4's simplifiedserialize()(which already dropped old protocol-version branching) and inserted only the InterfaceTracker hook into it.Fixes made beyond a straight port
StalePeerTest.tomltuning for 7.4. release-7.4 weights simulation storage-engine selection heavily toward RocksDB-family engines (PROBABILITY_FACTOR_SHARDED_ROCKSDB_ENGINE_SELECTED_SIM=100, a knob that doesn't exist on 7.3;PROBABILITY_FACTOR_ROCKSDB_ENGINE_SELECTED_SIMwent from 2 on 7.3 to 100 on 7.4). ShardedRocksDB's slower post-kill shard relocation occasionally exceeded the test's original 60swaitAfterKillwindow -- unrelated to the stale-peer eviction logic itself, which was confirmed working correctly via trace analysis (it detects and re-evicts every 5s; DD relocation was just slow to complete). ExcludedSHARDED_ROCKSDB(storageEngineExcludeTypes = [5], same precedent astests/fast/DDPipelineSaturation.toml) and bumpedwaitAfterKill60.0 -> 120.0 to absorb the remaining engine-agnostic timing variance.Testing
20260813-172150-praza-port-7.4-stalepeer-combined-base-0cc6fb276599316425f4eac6b58f53a1b4412fb8-- pass=99999/10000020260813-175001-praza-port-7.4-stalepeer-combined-c54df8b1eedf0d3d348a57cab037ecdf4fb7e64c-- pass=100000/100000StalePeerTest10K (new test, no baseline counterpart):20260814-180055-praza-port-7.4-stalepeer-combined-StalePeerTest-058497d3a-- pass=10000/10000 after the two toml fixes above.