Skip to content

[Bug]: TestCkpLeak waits for global checkpoint quiescence after WAL burst #26242

Closed

Description

@LeftHandCold

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main / PR #26096 branch fix/issue-25996-prepared-set

Commit ID

f154b46

Other Environment Information

- Hardware parameters: 8-core / 16 GiB GitHub runner
- OS type: Ubuntu / x86
- Others: Matrixone CI unit-test job

Actual Behavior

TestCkpLeak failed after its 10-second checkpoint wait in run 30251258817/job 89929582475:

target LSN: 201, checkpointed LSN: 1, current LSN: 203, pending LSN count: 202

The first incremental checkpoint completed at LSN 1. A second incremental intent was created with flushChecked=false, but no later ICKP executed before timeout. Normal table-tail flush tasks completed while that intent remained below the two-minute stalled-checkpoint recovery threshold.

This is independent of PR #26096: its diff changes only frontend, planner, and prepared-statement tests, with no TAE/checkpoint/WAL/catalog/logtail changes.

Expected Behavior

TestCkpLeak should wait for a checkpoint covering the concurrent append workload it created, without requiring global background WAL/checkpoint quiescence.

Steps to Reproduce

.agents/skills/mo-dev/scripts/mo-cgo-test -count=20 -run TestCkpLeak -timeout=180s ./pkg/vm/engine/tae/db/test

The same checkpoint code passed 20/20 locally, confirming a timing-dependent failure. The linked CI log captures the failing interleaving.

Additional information

Root cause: #25953 replaced the old best-effort wait/early return in TestCkpLeak with WaitAllCheckpointsFinished. After a concurrent WAL burst this helper waits for global background quiescence, although the test only needs a checkpoint covering its own writes. A pending background ICKP can still be waiting for asynchronous table-tail flush work, while the production stalled-intent recovery path intentionally activates only after two minutes; the test asserts after ten seconds.

This is the same synchronization-pattern class fixed for other TAE tests by #26033 and #26099. Older TestCkpLeak issues #21171 and #21722 covered different assertions.

Proposed test-only fix: after append workers finish, call ForceCheckpoint through db.TxnMgr.Now() under a ten-second context. This waits on the checkpoint intent covering the test fence and does not change production behavior.

Acceptance criteria:

  • TestCkpLeak uses a workload-scoped checkpoint fence.
  • Repeated normal and race-enabled runs pass.
  • Representative TAE checkpoint/GC tests and package build/vet remain green.

Activity

  1. LeftHandCold commented on Jul 27, 2026

    @LeftHandCold
    CollaboratorAuthor

    Fix opened in #26244.

    The CI failure is a test synchronization bug, not a checkpoint leak or a regression from #26096: WaitAllCheckpointsFinished chases global checkpoint quiescence, while the second incremental checkpoint intent can remain pending beyond the test 10-second deadline after the workload has already completed. The PR fences the completed workload at TxnMgr.Now() and waits through bounded ForceCheckpoint for that fixed timestamp.

    Validated with 20 focused runs, 3 race runs, 3 related-test runs, go vet, and TAE DB build.

  2. added
    severity/s0
    and removed on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions