fix: isolate suspect server state per client - #441
Conversation
Synchronize suspect cleanup with roster refresh and make stale cleanup idempotent.
AI Code Review 报告审查提交: 审查结论核心故障链路修复正确,未发现阻止解决 Issue #436 的功能性缺陷。实例级 suspect 状态、幂等清理、空值保护以及 inactive server 拦截能够避免原有每秒持续 WARN。 建议合入前确认 1 项 API 兼容性问题;其余为已知边界和低风险改进项。 Review Findings[P1] 确认公开方法的二进制兼容性原有公开静态方法: public static void addIntoSuspectIPs(SuspectObServer server)已被替换为: public void addIntoSuspectIPs(ObServerAddr addr)如果外部应用直接使用过旧方法,升级后会出现编译失败;未经重新编译的应用可能出现 虽然该方法看起来属于客户端内部实现,但 Java 可见性是 [P2] API_MOVE 新地址存在 active roster 状态窗口[ 如果 MOVE 返回的地址尚未进入当前 这不会重新引发 Issue #436 的持续 WARN,但可能削弱动态迁移窗口内的失败节点清理能力。可以作为已知边界记录,并补充对应测试。 非阻塞风险
正向评价
最终建议:确认 P1 API 兼容性后可以合入;P2 和其他边界可以记录为后续增强项,不阻塞本次 Issue #436 核心修复。 |
|
LGTM |
Synchronize suspect cleanup with roster refresh and make stale cleanup idempotent.
Summary
Fix the repeated
RouteTableRefresher::doCheckAliveTask failwarnings that may occur after an Observer is taken offline.This change isolates suspect-server state per
ObTableClient, makes concurrent cleanup idempotent, and reconciles suspect state when the authoritative tenant roster is refreshed.Fixes issue #436.
Background
After an Observer is replaced or taken offline, existing RPC connections or stale requests may report the old server as unavailable.
The client then adds the address to the suspect-server set and runs a JDBC keep-alive check every second. Normally, the server should be evicted after three consecutive failures.
With multiple
ObTableClientinstances in the same JVM, however, the suspect state was shared globally. Concurrent background refreshers could remove or process the same entry at the same time, causing cleanup exceptions and repeated warnings such as:Solution Description
This fix improves suspect-server lifecycle management with minimal behavioral changes:
ObTableClientinstance instead of sharing it globally across clients.NullPointerExceptionor repeateddoCheckAliveTask failwarnings.TableRoute, ensuring each client updates only its own suspect state.The existing failure threshold, health-check interval, request-routing behavior, RS-list refresh policy, and tenant-roster refresh policy remain unchanged. No additional metadata queries or background tasks are introduced.