Skip to content

[release-7.3] Fix stale peers for client facing roles (storage server, commit proxy, grv proxy) - #13367

Merged
spraza merged 20 commits into
apple:release-7.3from
spraza:stalepeer-v41m4-on7.3.77
Jun 29, 2026
Merged

spraza merged 20 commits into
apple:release-7.3from
spraza:stalepeer-v41m4-on7.3.77

Conversation

@spraza

@spraza spraza commented Jun 18, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

When a server process a client talks to is killed (storage server, commit/grv proxy, etc.), the client can keep stale references to the dead process (via RequestStream). For example:

  • Storage servers: DatabaseContext::locationCache holds the dead SS's StorageServerInterface until either a read hits that shard and fails (baseline error-driven invalidateCache), or clientInfo/shard reassignment replaces it. A DatabaseContext that doesn't actively read the affected shards (for example a server-hosted/internal client, or an idle one) can hold the dead SS's interface for a long time.

  • Proxies: when the recruited proxy count exceeds MAX_*_PROXY_CONNECTIONS, MonitorLeader::shrinkProxyList caches a sampled subset (lastCommitProxies/lastGrvProxies). If a proxy is killed and the recruited count then drops back under the cap, the cached subset keeps pinning the killed proxy's RequestStreams.

Each pinned RequestStream holds a FlowTransport peer reference, which keeps connectionKeeper alive retrying the dead address. That produces connection-timeout (CTO) churn and wasted reconnect attempts. At scale this can show up as a problem with various symptoms.

Solution

The core fixes make the client drain its connections to dead peers. Each fix is an opt-in knob (default off in production, randomized in simulation, forced on in the new test):

  1. locationCachePeerEvictor (NativeAPI, knob LOCATION_CACHE_PEER_EVICTOR_ENABLED): a per-DatabaseContext actor that periodically (LOCATION_CACHE_PEER_EVICTOR_DELAY) samples FlowTransport's persistent per-address connect-failed counter, and for any address whose count went up beyond LOCATION_CACHE_PEER_EVICTOR_FAILED_THRESHOLD since the previous sweep, calls invalidateCacheByAddress to evict every cached location that references it. Dropping the cache's Reference<LocationInfo> lets the dead SS's streams release.

    • To get that persistent count, I added a persistent per-address connect-failed counter (FlowTransport, knob PERSISTENT_CONNECT_FAILED_COUNT_TTL): connectionKeeper records a per-destination cumulative connect-failure count plus last-failure time that survives Peer destruction. That's the stable signal the evictor reads. It's TTL-pruned to stay bounded.
  2. shrinkProxyList under-cap cache-clear (MonitorLeader, knob SHRINK_PROXY_LIST_CLEAR_CACHE_BELOW_THRESHOLD): clears the cached sampled subset on iterations where the recruited count is below the cap, so a killed proxy's pinned RequestStreams release.

  3. Eager proxy rebuild (knob DBCONTEXT_EAGER_PROXY_UPDATE): rebuilds cx->commitProxies/grvProxies right away on a clientInfo proxy-list change instead of waiting for the next transaction's lazy lookup.

Note: this PR is about the problem and the fix, but quite a lot of time was spent on figuring out where and what were the problems leading to high connection timeouts. These changes assisted with that:

  • InterfaceTracker (knob STALE_PEER_OBSERVABILITY, default off): at various layers of the RPC stack, diagnostic per-(address, role) interface create/delete accounting plus per-ref backtraces. This helps get close to where the leak was coming from. Every method is a no-op when the knob is off.

  • StalePeerTest workload + toml: kills a configurable client-facing role, waits for recovery, then asserts no leaked interface copies (Delta == 0) remain on the client. A big part of this PR is a result of constant iteration on this failing test, and leveraging observability above to figure out why the test was failing. The goal was to make the test pass, and meanwhile, ensure general db functionality is not broken (general 100K signal).

Testing

Simulation: ran StalePeerTest 10K times, all passed:
20260622-234822-praza-stalepeer-v41m4-on7.3.77-c37d2130797b9 compressed=True data_size=34905210 duration=433655 ended=10000 fail_fast=100 max_runs=10000 pass=10000 priority=100 remaining=0 runtime=0:08:02 sanity=False started=10000 stopped=20260622-235624 submitted=20260622-234822 timeout=5400 username=praza-stalepeer-v41m4-on7.3.77-c37d2130797b99acc9da0313be445d751fee5d62

Simulation: ran the general 100K, all passed:
20260622-234826-praza-stalepeer-v41m4-on7.3.77-c37d2130797b9 compressed=True data_size=34872287 duration=3302230 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=0:39:25 sanity=False started=100000 stopped=20260623-002751 submitted=20260622-234826 timeout=5400 username=praza-stalepeer-v41m4-on7.3.77-c37d2130797b99acc9da0313be445d751fee5d62

Perf cluster: saw up to a 100x reduction in CTO/min aggregated across clients (CTO = connection timeout).

@spraza
spraza marked this pull request as draft June 18, 2026 09:59
@spraza spraza changed the title [release-7.3] Fix stale peers for src=client, dst={coord, cc, cp, gp, ss} [DRAFT][release-7.3] Fix stale peers for src=client, dst={coord, cc, cp, gp, ss} Jun 18, 2026
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: 884238e
  • Duration 0:08:14
  • Result: ❌ FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: 884238e
  • Duration 0:08:22
  • Result: ❌ FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS 14.x

  • Commit ID: 884238e
  • Duration 0:08:56
  • Result: ❌ FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /opt/homebrew/bin/bash --login ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS 14.x

  • Commit ID: 884238e
  • Duration 0:11:21
  • Result: ❌ FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-73 on Linux CentOS 7

  • Commit ID: 884238e
  • Duration 0:40:32
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-73 on Linux CentOS 7

  • Commit ID: 884238e
  • Duration 0:50:29
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests-73 on Linux CentOS 7

  • Commit ID: 884238e
  • Duration 0:58:02
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

Comment thread fdbclient/ClientKnobs.cpp Resolved
Comment thread fdbclient/ClientKnobs.cpp Resolved
Comment thread fdbclient/NativeAPI.actor.cpp Resolved
Comment thread fdbclient/NativeAPI.actor.cpp Resolved
Comment thread fdbrpc/FlowTransport.actor.cpp Resolved
Comment thread fdbrpc/FlowTransport.actor.cpp Resolved
Comment thread fdbrpc/FlowTransport.actor.cpp Resolved
Comment thread flow/include/flow/flow.h Resolved
Comment thread flow/include/flow/flow.h Resolved
Comment thread flow/include/flow/flow.h Resolved
Comment thread tests/CMakeLists.txt Resolved
Comment thread fdbrpc/include/fdbrpc/fdbrpc.h Resolved
Comment thread fdbrpc/include/fdbrpc/fdbrpc.h Resolved
Comment thread fdbrpc/include/fdbrpc/fdbrpc.h Resolved
Comment thread fdbrpc/FlowTransport.actor.cpp Resolved
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: 6730470
  • Duration 0:07:27
  • Result: ❌ FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: 6730470
  • Duration 0:07:41
  • Result: ❌ FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS 14.x

  • Commit ID: 6730470
  • Duration 0:08:00
  • Result: ❌ FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /opt/homebrew/bin/bash --login ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS 14.x

  • Commit ID: 6730470
  • Duration 0:24:36
  • Result: ❌ FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-73 on Linux CentOS 7

  • Commit ID: 6730470
  • Duration 0:39:54
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-73 on Linux CentOS 7

  • Commit ID: 6730470
  • Duration 0:44:46
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests-73 on Linux CentOS 7

  • Commit ID: 6730470
  • Duration 0:57:57
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

Comment thread fdbrpc/include/fdbrpc/fdbrpc.h Resolved
Comment thread fdbrpc/include/fdbrpc/fdbrpc.h Resolved
Comment thread fdbrpc/include/fdbrpc/FlowTransport.h Resolved
Comment thread fdbrpc/FlowTransport.actor.cpp Resolved
Comment thread fdbrpc/FlowTransport.actor.cpp Resolved
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: e71bffc
  • Duration 0:07:31
  • Result: ❌ FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: e71bffc
  • Duration 0:07:58
  • Result: ❌ FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS 14.x

  • Commit ID: e71bffc
  • Duration 0:08:25
  • Result: ❌ FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /opt/homebrew/bin/bash --login ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS 14.x

  • Commit ID: e71bffc
  • Duration 0:10:52
  • Result: ❌ FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login ./build_pr_macos.sh. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@ploxiln

ploxiln commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

please merge in latest release-7.3 branch to get fixes for more-modern gcc and clang

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-73 on Linux CentOS 7

  • Commit ID: e71bffc
  • Duration 0:35:45
  • Result: ❌ FAILED
  • Error: Error while executing command: python3 -m joshua.joshua start --tarball $(find build_output/packages -name correctness\*.tar.gz) --username ${CORRECTNESS_USERNAME} --max-runs 10000. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-73 on Linux CentOS 7

  • Commit ID: e71bffc
  • Duration 0:42:52
  • Result: ❌ FAILED
  • Error: Error while executing command: python3 -m joshua.joshua start --tarball $(find build_output/packages -name correctness\*.tar.gz) --username ${CORRECTNESS_USERNAME} --max-runs 10000. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests-73 on Linux CentOS 7

  • Commit ID: 231f326
  • Duration 1:13:47
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS 14.x

  • Commit ID: 231f326
  • Duration 1:52:24
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS 14.x

  • Commit ID: 231f326
  • Duration 3:11:51
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@spraza spraza closed this Jun 29, 2026
@spraza spraza reopened this Jun 29, 2026
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS 14.x

  • Commit ID: 231f326
  • Duration 0:31:47
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-73 on Linux CentOS 7

  • Commit ID: 231f326
  • Duration 0:40:41
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: 231f326
  • Duration 0:41:42
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-73 on Linux CentOS 7

  • Commit ID: 231f326
  • Duration 0:46:03
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: 231f326
  • Duration 0:48:08
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS 14.x

  • Commit ID: 231f326
  • Duration 0:49:10
  • Result: ❌ FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login ./build_pr_macos.sh. Reason: exit status 8
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests-73 on Linux CentOS 7

  • Commit ID: 231f326
  • Duration 0:57:42
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@spraza spraza closed this Jun 29, 2026
@spraza spraza reopened this Jun 29, 2026
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS 14.x

  • Commit ID: 231f326
  • Duration 0:32:04
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: 231f326
  • Duration 0:44:32
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-73 on Linux CentOS 7

  • Commit ID: 231f326
  • Duration 0:45:53
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: 231f326
  • Duration 0:48:02
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS 14.x

  • Commit ID: 231f326
  • Duration 0:48:48
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-73 on Linux CentOS 7

  • Commit ID: 231f326
  • Duration 0:49:08
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests-73 on Linux CentOS 7

  • Commit ID: 231f326
  • Duration 0:58:26
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@spraza
spraza merged commit 51e1c42 into apple:release-7.3 Jun 29, 2026
4 checks passed
spraza added a commit to spraza/foundationdb that referenced this pull request Aug 19, 2026
…, 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 added a commit that referenced this pull request Aug 20, 2026
…, 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.
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
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.

6 participants