Repository navigation
fix: reuse master RPC pool during non-HA reconnects - #80
Merged
lihenga merged 2 commits intoOct 21, 2026
Merged
Conversation
lihenga
force-pushed
the
lihenga/fix-non-ha-reconnect-pool-retention
branch
from
October 20, 2026 05:44
98867be to
b7c8c6d
Compare
9 of 13 tasks
Collaborator
审核与实测意见我们审核了 #80( 结论:实测有效。非 HA 模式下 master 不可用期间,每次重连不再泄漏内存,建议合入。另有一个场景建议补测(第 2 条)。 1. 实测方法:master 正常运行后 SIGKILL,停 300 s,client 约每秒重连一次,共 300 次;之后在同一地址重启 master。每 10 s 采样一次 client 的匿名内存、线程数和 fd 数。
两个版本在 master 恢复后都重连成功,线程数和 fd 数在一次性增加后都不再变化。 2. 建议补测:半开连接
|
5 of 16 tasks
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.
2026-10-21:补充真实网络 DROP 验证
针对 review,新增一个受显式环境开关保护的 native 回归:连接建立并挂载内存段后,仅丢弃发往 Master RPC 端口的 TCP 包。故障持续 12 秒,RPC 请求超时设为 1 秒,解除后检查心跳、内存段及实际 RPC pool 身份。
测试只允许在与 PID 1 不同的网络命名空间内运行;普通 CI 会跳过。DROP 规则及超时环境变量会清理恢复。本次使用
unshare -n创建独立网络命名空间,未更改容器已有网络或业务服务。本轮验证与结论
指定环境:
10.211.10.10/ Dockersglang0518_0920_yb,PR 原 headb7c8c6d7的独立构建,加上本次测试;目录/stortest/zhy_spcae/fixbug/pr80-half-open-20261021。libip6tc.so.2。补齐任务目录内解包依赖后重跑新增用例;未安装系统包,未把该次环境失败算成行为验证。git diff --check通过。结果不支持额外引入强制重建 pool 的回退逻辑,因此本轮只增加测试,生产修复保持原样。
复现:在独立 network namespace 中启用 loopback,设置
MOONCAKE_TEST_IPTABLES为可用的 iptables-legacy 可执行文件路径,然后运行:non_ha_reconnect_test --gtest_filter='*Blackhole'完整驱动与日志保存于上述目录;
blackhole-test.log为最终成功记录。下方保留此前修复及历史验证。Description
Non-HA storage heartbeats previously forced a new master RPC pool on every reconnect attempt. Replaced pools are retained for coroutine lifetime safety, causing unbounded pool retention during master outages. Heartbeat reconnects now reuse the existing pool, which replaces closed connections itself.
The behavior change is confined to the heartbeat reconnect call. First-connect, address-change, explicit force-recreation and pool lifetime behavior remain as before. The regression checks the actual Client pool identity across a six-second master outage and same-address restart/remount.
Module
mooncake-store)Type of Change
How Has This Been Tested?
Environment:
opendas-prometheus, containersglang0518_0920_yb, existing Release CMake build. Joint integration9bdd6d96720ed7e8a7e10b8deb9918ed03494957.non_ha_reconnect_test: 3/3 passed, including stable actual heartbeat pool identity while master is down and after automatic reconnect/remount.dfs_immutable_bucket_client_test: 22 passed, 2 checksum-disabled skips. Includes new Client creation after same-address master restart and backfill failure/recovery.rpc_client_io_context_test: 3/3 passed in the joint build.Full logs/XML:
/stortest/zhy_spcae/fixbug/dfs-recovery-pool-20261020/.Checklist
git diff --checkpasses./scripts/code_format.sh(clang-format unavailable)AI Assistance Disclosure
Commit consolidation (2026-10-20)
This PR now contains one commit:
b7c8c6d7f9075cdb8ce5bedba9987e6af734f484. Its complete Git tree is identical to the previous PR head. Both squashed PRs were cherry-picked onto L4 baseline18c9e4a3intolihenga/integrate-dfs-bugfixes-20261020at60ae912dedb3d627ccd1b7485a1508b01fa6241f; that integration tree is identical to the previously tested9bdd6d96. No unit tests were rerun for this history-only change; the test results and limitations above remain the validation evidence.