Skip to content

[Bug]: TAE restart replay panics with ExpectedEOB after concurrent range-delete/append #29680

Closed

Description

@XuPeng-SH

Description

Refs #29249. TAE restart/WAL replay can panic with ExpectedEOB after concurrent range-delete plus append activity. The existing regression test pkg/vm/engine/tae/db/test/db_test.go:TestDelete4 is skipped because it crashes occasionally; removing only that skip reproduces the crash on a clean latest main.

Environment

  • Branch: main
  • Commit: f20f5ca147c44b012343d0f48dfcd84b6a5986a1
  • OS: Debian Linux amd64
  • Go: 1.26.4 local toolchain (the local probe temporarily used go 1.26.0 in go.mod)
  • GOMAXPROCS=2, GOFLAGS=-mod=mod, -p 1, no network service or external cluster

Actual Behavior

The process panics during the first restart/replay phase:

panic: ExpectedEOB
...
github.com/matrixorigin/matrixone/pkg/vm/engine/tae/txn/txnimpl.(*replayTxnStore).replayAppend
    pkg/vm/engine/tae/txn/txnimpl/replaystore.go:259

The clean-main probe failed in 0.123s after the test process started. A second probe on the current #29249 cleanup tree reached the same panic and stack path. This is a process crash during recovery, not a test-only assertion failure.

Expected Behavior

Restart and WAL replay must complete without a process panic and must preserve the committed row state. If the replay record cannot be resolved, the path must return a controlled, diagnosable error with correct cleanup rather than panic or silently discard the append.

Steps to Reproduce

  1. Check out main at f20f5ca147c44b012343d0f48dfcd84b6a5986a1.

  2. In pkg/vm/engine/tae/db/test/db_test.go, temporarily remove the first t.Skip(any("This case crashes occasionally, is being fixed, skip it for now")) in TestDelete4.

  3. Run with the repository CGo test environment, GOMAXPROCS=2, and -p 1:

    go test -p 1 -count=1 -run '^TestDelete4$' ./pkg/vm/engine/tae/db/test
  4. The test creates a one-row varchar-PK table, submits concurrent range-delete/append updates, then restarts the engine. Replay panics before the test can finish.

Additional information

The failure chain is concrete in the current code:

  • replayTxnStore.replayAppend calls ensureReplayAObject.
  • ensureReplayAObject returns OkExpectedEOB while resolving the append destination/table.
  • replayAppend treats every error other than ErrDebugReplay as fatal and panics at line 259.
  • The diagnostic catalog printed immediately before the panic contains only system tables, while the WAL command targets BLK<1000-1000-...> for the user table.

The required fix should establish the correct catalog/WAL ordering or ownership for this replay record and keep the existing crash regression executable with a deterministic, minimal oracle. Do not simply remove the skip or swallow ExpectedEOB; verify data preservation and controlled failure semantics across restart.

Activity

  1. added
    kind/bug
    on Oct 8, 2026
  2. XuPeng-SH commented on Oct 8, 2026

    @XuPeng-SH
    ContributorAuthor

    This report is invalid as a production bug and should be closed.

    The ExpectedEOB reproduction came from TestDelete4 using CreateRelAndAppend. That helper creates the user database/relation and appends user rows, but it does not persist the corresponding mo_tables and mo_columns catalog rows. After checkpoint/restart, replay therefore cannot resolve the user table; the resulting ExpectedEOB/Unknown database db is an invalid fixture, not evidence that a valid persisted database can reach this replay path.

    On clean main at f20f5ca147c44b012343d0f48dfcd84b6a5986a1, a minimal probe with the original helper reproduced Unknown database db after restart. Changing only the fixture to the existing system-catalog-aware CreateRelAndAppend2 made TestDelete4 pass 5 consecutive runs (9.736s) without any production-code change.

    TestUpdate has the same test-quality problem: after its skip is removed, it continues after GetByFilter errors and dereferences nil IDs/offsets from worker goroutines, so its panic is caused by the test itself and its unchecked expected write conflicts.

    No production replay fix is warranted from this report. The useful follow-up is to retain or replace the concurrent restart coverage with a valid, deterministic fixture and explicit error handling.

  3. XuPeng-SH commented on Oct 8, 2026

    @XuPeng-SH
    ContributorAuthor

    Closing as invalid production bug: the reported replay failure is caused by an incomplete test fixture, as documented in the preceding comment.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions