Repository navigation
Description
Branch Name
main
Commit ID
6f42b19508f31ef04ae2857172893f13d48afddf
Other Environment Information
- Isolated Docker deployment: 2 CN + 1 TN + 1 logservice + proxy + MinIO
- Image:
matrixorigin/matrixone:local - Host: Debian 13, Docker 28.5.1
- Analysis window: 2026-08-19 16:24:41–16:29 UTC
- No production source changes were made
Actual Behavior
After disconnecting only the logservice container from the compose network for about 30 seconds while a 16-thread read workload was active, reconnecting the same logservice endpoint did not restore HAKeeper/CN availability.
Observed sequence:
- At 16:24:41 UTC, the logservice network endpoint was disconnected.
- At 16:25:13 UTC, the endpoint was reconnected. DNS resolved again to the logservice container.
- A new SQL connection still returned
20101: internal error: no available CN server. - The error persisted for at least 60 seconds after DNS and the logservice endpoint were healthy.
- Restarting the proxy alone did not recover the cluster. Restarting CN0 alone did not recover it. Restarting CN1 and TN finally restored a successful SQL probe.
- Existing read traffic continued for part of the window, while new connections and routing failed.
The logs showed:
hakeeper.checker.cnservice.no.cn.found
internal error: no available CN server
hakeeper-client-backend ... can-retry=false
dial tcp4: lookup logservice on 127.0.0.11:53: no such host
After the endpoint was restored, getent hosts logservice succeeded, but the long-lived CN/TN/proxy MORPC clients remained unusable until service generations were restarted.
Expected Behavior
A transient logservice network/DNS outage should have a bounded recovery path:
- MORPC should retry/re-resolve a transient DNS/network failure after the endpoint returns.
- CN/TN should resume HAKeeper heartbeats and re-register, or enter a controlled drain/restart state.
- Proxy should refresh cluster details and route new connections once an eligible CN is available.
- New SQL requests should fail fast with a bounded unavailable error during the outage, rather than leaving a healthy-looking cluster unavailable indefinitely.
Steps to Reproduce
- Start an isolated 2CN + TN + logservice + proxy deployment.
- Run continuous read traffic through the proxy.
- Disconnect only the logservice container from the service network for 30 seconds:
docker network disconnect <network> <logservice-container> - Reconnect it with the logservice network aliases.
- Confirm that DNS resolves and the logservice process is running.
- Open a new SQL connection and observe
20101 no available CN server. - Wait at least 60 seconds; the condition persists.
- Restart CN/TN service generations; the SQL probe recovers.
Code Analysis
The HAKeeper client creates a MORPC backend in pkg/logservice/client.go:getRPCClient. In pkg/common/morpc/backend.go:1131-1175, resetConn retries only when the connection error is a timeout. A DNS resolution error such as lookup logservice: no such host is treated as non-retryable (can-retry=false) and returned as ErrBackendCannotConnect.
During the fault, the CN/TN heartbeat backends therefore remain unavailable after the endpoint comes back. HAKeeper expires the CNs, logs no.cn.found, and proxy has no routable CN. The process liveness probes remain positive, so process health does not represent SQL availability.
Related but distinct:
- CN heartbeat failure during HAKeeper isolation: no self-termination leads to zombie CN #25207: CN heartbeat failure does not self-terminate the zombie CN.
- [Bug] MOC 升级期间 CN 不注册到 HAKeeper 导致集群长时间不可用 #24866: CN registration failure during upgrade leaves the cluster unavailable.
This report covers recovery after a transient HAKeeper network/DNS partition and the non-retryable MORPC backend state.
Impact
- New SQL sessions fail with 20101 and cannot be routed.
- DDL/write requests can block or fail while existing cache-hit reads continue, making the outage difficult to detect from superficial liveness checks.
- CN/TN heartbeats and lockservice/HAKeeper control-plane progress stop.
- Recovery requires restarting multiple service generations rather than waiting for the network to recover.
- No data corruption was observed in this reproduction.
Regression Coverage
Add a deterministic integration/chaos test that:
- partitions logservice DNS/network during active CN/TN/proxy traffic;
- restores the endpoint without restarting clients;
- asserts that MORPC re-resolves and reconnects;
- asserts that CN/TN heartbeat and registration resume;
- asserts that new SQL sessions recover within a bounded interval;
- covers DNS NXDOMAIN, connection refused, timeout, endpoint IP change, cancellation, and service restart generations.
Activity
XuPeng-SH commentedon Aug 19, 2026
Follow-up reproduction: single-CN network partition
The same recovery defect was reproduced by partitioning only one CN from the compose network for about 35 seconds during a 16-thread read workload:
logserviceand TN withcan-retry=false/network is unreachable.all local lock table invalid; proxy connections to that CN were repeatedly disconnected while the unaffected CN continued serving new SQL.CreateTaskandJoinGossipClusterschedule commands.This confirms the issue is not limited to DNS NXDOMAIN: a transient network-unreachable MORPC failure can leave a long-lived CN control-plane client unusable after the network is restored. No data corruption was observed.
XuPeng-SH commentedon Aug 19, 2026
Follow-up reproduction: TN network partition
The same MORPC failure mode was observed when only TN was partitioned from the service network during a 16-thread read workload:
2026-08-19 16:54:20–16:55:00 UTC.can-retry=falsewithnetwork is unreachable/ temporary DNS absence.Write Sync error, failed flush/merge tasks,lock table bind changed,invalid timestamp, orphan-transaction errors, and context-deadline errors. These were recovery-window symptoms; no data corruption was observed.This extends the evidence beyond HAKeeper-only traffic: the same non-timeout MORPC failure classification can stall timestamp/lock/flush paths and create long tails while liveness probes remain positive.
LeftHandCold commentedon Aug 21, 2026
Reassessment against current
main(2026-08-21)I traced the complete CN/TN heartbeat recovery path and ran deterministic counterfactual tests against current
base/main(853fb9bf9b1d0ea1aa09b3cc7443ad3828ffab4a). The issue's reproduction commit (6f42b19508f31ef04ae2857172893f13d48afddf) is an ancestor, and the relevant paths are unchanged between the two commits:pkg/common/morpcpkg/logservicepkg/cnservice/server_heartbeat.gopkg/tnservice/store_heartbeat.goConclusion
The availability incident described here may be real, but the proposed root cause is not correct:
That flag only decides whether one physical
remoteBackendgeneration retries the same failedConnectcall in place. A non-timeout DNS/network error terminates that backend generation and returnsErrBackendCannotConnect; the outer MORPC client and managed HAKeeper client both have replacement paths.Therefore, the currently documented causal chain — non-timeout connect error -> permanently poisoned MORPC client -> no recovery until process restart — is disproved by both the implementation and deterministic tests. The underlying post-reconnect unavailability is not yet attributable to a specific MatrixOne defect with the evidence attached to this issue.
Actual recovery path
The relevant object hierarchy is:
remoteBackend.resetConn, DNS NXDOMAIN,network is unreachable, and connection refusal are classified ascan-retry=false. This only stops in-place retry by the current physical backend.Send,getBackendForOperationdetaches inactive capacity and, with auto-create enabled by default, queues a new backend generation. The new generation resolves the address and connects again. The circuit breaker is disabled by default.SendCNHeartbeatandSendTNHeartbeatcallresetClientIfCurrentfor non-context failures. The next heartbeat prepares a newhakeeperClient, creates a new MORPC client, and runsCHECK_HAKEEPERagain.CNState.Update, which inserts a missing UUID and refreshes its tick.The
can-retry=falsebranch itself dates to 2023; it is not a recent regression. PR #25869 was also checked as a candidate. It prevents a caller-scoped cancellation/deadline from closing a shared healthy HAKeeper client; an actual transport failure is still detected independently by MORPC's configured 8-second read timeout and enters the backend/client replacement path.Deterministic counterfactual results
I used temporary diagnostic tests only; no product files were changed.
MORPC-level test
can-retry=false, andErrBackendCannotConnect.Result: 20/20 passed.
Managed HAKeeper-level test
CHECK_HAKEEPERand a CN heartbeat.can-retry=falsebranch.managedHAKeeperClientobject.CHECK_HAKEEPERagain, and delivers another CN heartbeat.Result: 20/20 passed.
These tests do not reproduce Docker's network namespace behavior, but they directly disprove the claimed state-machine failure: taking the exact non-timeout/
ErrBackendCannotConnectbranch does not leave the long-lived client permanently poisoned.How the reported evidence should be interpreted
hakeeper.checker.cnservice.no.cn.foundproves that, at that checker tick, HAKeeper had no working or expired CN entry. It does not identify why no heartbeat was accepted.Likewise,
getent hosts logserviceproves only that Docker DNS resolves the name. It does not prove that, from each CN/TN/proxy namespace:logservice:32001succeeds;CHECK_HAKEEPERreceives a valid response;If repeated
can-retry=false/network is unreachablemessages really occurred after16:25:13 UTC, they point in the opposite direction from the current analysis: upper layers were creating/using connection generations and the network path was still failing from those containers. However, the issue currently contains summarized snippets rather than timestamped raw logs with backend IDs, so pre-restore failures cannot be separated from post-restore failures.The TN follow-up is also a counterexample to permanent client poisoning: after TN was reattached, a fresh write succeeded and the backend error stream stopped without restarting TN. The single-CN follow-up includes additional lock-table invalidation, gossip membership, scheduling, routing, and elapsed-time changes, so recovery after a CN restart does not isolate MORPC as the cause.
Evidence required to pin the remaining root cause
A corrected reproduction should preserve one aligned UTC timeline and capture the following before any service restart:
logservice:32001failsCHECK_HAKEEPERCHECK_HAKEEPERsucceeds, no heartbeat arrivesPlease capture:
getentplus a bounded TCP probe tologservice:32001from each CN, TN, and proxy container;docker network inspectbefore disconnect and after reconnect, including endpoint IPs, aliases, and routes;CHECK_HAKEEPERand heartbeat receipt;Recommendation
Do not change
resetConnto retry every non-timeout error based on this report. That would duplicate outer-generation recovery and could keep bad DNS/configuration, permanently refused endpoints, and obsolete backends alive longer, introducing lifecycle and availability regressions.I recommend keeping the availability symptom open only for a corrected evidence-bearing reproduction, while removing the current “permanently unusable MORPC client” root-cause claim. With the present artifacts there is no safe, evidence-backed MatrixOne patch to submit. The strongest unresolved hypothesis is incomplete Docker network/endpoint restoration from one or more service namespaces, but that remains a hypothesis until the layer-by-layer probes above are captured.
fix(fileservice): scope DNS cache to file service clients (#27548)
fix(fileservice): scope DNS cache to file service clients (matrixorig…
fix(fileservice): scope DNS cache to file service clients (matrixorig…
fix(fileservice): scope DNS cache to file service clients (matrixorig…