Skip to content

fix: stabilize HAKeeper in issue 26114 tests - #28339

Merged
XuPeng-SH merged 2 commits into
matrixorigin:4.2-devfrom
ck89119:issue-26441-4.2-dev
Sep 7, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:4.2-devfrom
ck89119:issue-26441-4.2-dev

Conversation

@ck89119

@ck89119 ck89119 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #26441

What this PR does / why we need it:

  • Isolates the issue 26114 cross-account branch tests on a dedicated embedded cluster with an independent lifecycle, avoiding interference from the shared authenticated test cluster.
  • Aligns test-mode HAKeeper timing as 15s heartbeat < 20s backend transport < 60s store liveness.
  • Propagates the configurable HAKeeper backend read timeout through service configuration while preserving production defaults and explicit values.
  • Keeps the existing quota, ownership, legacy metadata, and concurrent branch assertions.

Validation:

  • pkg/embed coverage: 84.3%
  • pkg/logservice coverage: 79.7%
  • Focused and owning-package normal/race tests passed.
  • go list, CGo-aware build/vet, gofmt, and diff checks passed.

ck89119 and others added 2 commits September 7, 2026 15:06
- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

Fixes matrixorigin#27060

- Moves the issue matrixorigin#26114 cross-account branch tests into the serial
`pkg/tests/issues/isolated` package.
- Starts and closes a fresh one-CN authenticated cluster for each test
instead of reusing the long-lived shared base cluster.
- Preserves the original quota, ownership, concurrency, and
legacy-metadata assertions while removing interference from earlier
heavy embedded-cluster tests.

- Focused tests: passed individually twice and together.
- Focused race tests: passed; measured 21.49s and 19.07s, with adaptive
B=30s and N=1.
- Full `pkg/tests/issues/isolated` and `pkg/tests/issues` packages:
passed in normal and race modes.
- `go vet` for both packages: passed with MatrixOne CGo environment.
- `make build`: passed.

Co-authored-by: XuPeng-SH <[email protected]>
…#27849)

- make the HAKeeper backend read timeout configurable while preserving
the 8s production default;
- give embedded test clusters a 20s transport budget between the
existing 15s heartbeat RPC deadline and 60s store-liveness window;
- propagate the timeout to CN, TN, LogService, and the independent
schedule-command transport;
- preserve explicit test/service overrides and reject negative
configuration;
- pin the timeout hierarchy in the shared authenticated-cluster fixture
used by the reported test.

At current main `a15139da62`, `WithTesting()` extends CN/TN heartbeat
RPCs to 15s, but every HAKeeper MORPC backend still uses the hard-coded
8s read timeout. Under race/full-UT scheduler pressure, the backend
therefore closes the shared transport at 8s, before the heartbeat
recovery window expires. The reported job shows both CN backends timing
out at 12:13:46 and the `volume_files` DDL failing on the same
transport.

The failure occurred after matrixorigin#27744 had already merged, so that
heartbeat-only fix does not close this remaining timeout inversion.

The test-only default is now:

`15s heartbeat < 20s backend read < 60s store liveness`

Caller contexts still bound individual requests, cluster close still
interrupts the connection, and a genuinely dead test transport remains
bounded and gets multiple replacement opportunities before store expiry.
Production behavior and hot paths are unchanged; the production default
remains exactly 8s and the new value is read only when a client
connection is created.

- `pkg/logservice` full package: PASS (111.424s)
- `pkg/embed` full package: PASS (47.479s)
- focused config/default/negative/copy tests: PASS
- TOML parsing for `backend-read-timeout`: PASS
- `TestAuthenticatedTestsReuseBaseCluster` with `-race`: PASS (12.43s)
- `TestIssue24727MultiRowPreparedInsertUUIDStrings` with `-race`: PASS,
including both interpolation modes (14.50s)
- `go vet ./pkg/logservice ./pkg/embed`: PASS

No BVT is added because this changes only embedded-test control-plane
timing; the SQL behavior and production topology contract are unchanged.

Fixes matrixorigin#27846
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astra(GPT-6)按当前 head fbb2fba 完成多角度复核,结论 APPROVE。

  • 将 issue 26114 的两个跨账号 branch 用例移到独立 embedded cluster,保留 quota、ownership、legacy metadata、并发竞争和清理断言;没有把失败改成重试/忽略,也没有删除覆盖目标。
  • 15s heartbeat / 20s HAKeeper backend read / 60s store liveness 仅由 WithTesting 注入,生产默认仍为 8s;显式配置可覆盖,负值被拒绝,配置传递链和测试均覆盖。
  • 独立 cluster 的启动失败、测试失败和 cleanup 路径均有资源关闭;没有发现跨测试状态污染或把测试修复误当生产根因。
  • 代价是两个用例各自启动 cluster,属于为隔离生命周期付出的有界成本;未引入生产 RPC、存储协议或无界后台资源变化。
  • 当前 head 的 UT、SCA、Coverage、BVT/Proxy、Iceberg 等实质 CI 均成功(允许的 skipped 除外)。

@XuPeng-SH
XuPeng-SH merged commit 173b0b3 into matrixorigin:4.2-dev Sep 7, 2026
72 of 74 checks passed

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants