Skip to content

Agent/fix checkpoint wait boundary - #26283

Merged
XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
jiangxinmeng1:agent/fix-checkpoint-wait-boundary
Jul 29, 2026
Merged

XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
jiangxinmeng1:agent/fix-checkpoint-wait-boundary

Conversation

@jiangxinmeng1

@jiangxinmeng1 jiangxinmeng1 commented Jul 28, 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:

issue #25931

What this PR does / why we need it:

The original test waited for the global pending WAL count to reach zero after a
forced checkpoint. This was incorrect because transactions committed after the
requested timestamp may legitimately create newer pending WAL LSNs.

The test now validates the exact forced-checkpoint boundary instead:

  • The checkpoint entry is finished.
  • Its end timestamp covers the requested timestamp.
  • The WAL checkpoint eventually covers the checkpoint entry’s fixed LSN.
  • Newer WAL LSNs produced by later commits are allowed to remain pending.

This preserves meaningful checkpoint validation without waiting for unrelated
future transactions.

@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.

Deep-reviewed exact head 3b5b7cc against current main 7396d7d.

The boundary diagnosis is correct. In the linked recurrence run 29990725328/job/89152709952, the forced ICKP completed with entry LSN 8 and WAL checkpointed LSN 8, then the old generic waiter captured a newer global watermark of 9 and timed out with target LSN: 9, checkpointed LSN: 8, pending LSN count: 1. That newer LSN is outside the forced checkpoint's fixed boundary. Checking finished entry + end >= requestedTS + WAL checkpointed >= entry.LSN therefore preserves the meaningful contract instead of merely deleting coverage.

I am requesting changes for two closure gaps in this test-only fix:

  1. Add a deterministic regression for the exact boundary being fixed. The current workload does not intentionally create and hold a post-request WAL LSN, so all new runs may pass without ever exercising entry.LSN < current WAL watermark. After a forced entry is fixed, deliberately create a later committed LSN while preventing a new checkpoint from covering it (for example, temporarily disable checkpoint execution), then assert all of: the forced entry LSN is non-zero, WAL checkpointed covers that entry LSN, current watermark is greater, and a newer pending LSN remains. This proves the targeted condition succeeds in the state where the old global-quiescence condition fails. At minimum, require a non-zero target LSN in the existing helper so GetCheckpointed() >= 0 cannot make the WAL assertion vacuous for this data-bearing test.

  2. Correct the issue association. #25889 is the unrelated logservice snapshotManager.Init idempotency/export-quota bug and remains completely unfixed here. This PR addresses the recurrence tracked in #25931 (TestGlobalCheckpoint2 pending LSN after checkpoint completion); link that issue and keep #25889 open for its actual production fix.

Verification completed successfully: TestGlobalCheckpoint2 passed 20/20 under -race, the complete db/test package passed under -race (109.6s), latest-main prospective merge passed the target 10/10, and vet/diff checks passed. No production-code defect was found; the blockers are deterministic coverage and accurate issue traceability.

@mergify mergify Bot removed the dequeued label Jul 29, 2026
@XuPeng-SH
XuPeng-SH merged commit 0ebba1c into matrixorigin:main Jul 29, 2026
23 checks passed
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25931

## What this PR does / why we need it:

The original test waited for the global pending WAL count to reach zero
after a
forced checkpoint. This was incorrect because transactions committed
after the
  requested timestamp may legitimately create newer pending WAL LSNs.

  The test now validates the exact forced-checkpoint boundary instead:

  - The checkpoint entry is finished.
  - Its end timestamp covers the requested timestamp.
- The WAL checkpoint eventually covers the checkpoint entry’s fixed LSN.
- Newer WAL LSNs produced by later commits are allowed to remain
pending.

This preserves meaningful checkpoint validation without waiting for
unrelated
  future transactions.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25931

## What this PR does / why we need it:

The original test waited for the global pending WAL count to reach zero
after a
forced checkpoint. This was incorrect because transactions committed
after the
  requested timestamp may legitimately create newer pending WAL LSNs.

  The test now validates the exact forced-checkpoint boundary instead:

  - The checkpoint entry is finished.
  - Its end timestamp covers the requested timestamp.
- The WAL checkpoint eventually covers the checkpoint entry’s fixed LSN.
- Newer WAL LSNs produced by later commits are allowed to remain
pending.

This preserves meaningful checkpoint validation without waiting for
unrelated
  future transactions.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25931

## What this PR does / why we need it:

The original test waited for the global pending WAL count to reach zero
after a
forced checkpoint. This was incorrect because transactions committed
after the
  requested timestamp may legitimately create newer pending WAL LSNs.

  The test now validates the exact forced-checkpoint boundary instead:

  - The checkpoint entry is finished.
  - Its end timestamp covers the requested timestamp.
- The WAL checkpoint eventually covers the checkpoint entry’s fixed LSN.
- Newer WAL LSNs produced by later commits are allowed to remain
pending.

This preserves meaningful checkpoint validation without waiting for
unrelated
  future transactions.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[email protected]>

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 size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants