Skip to content

refactor: remove legacy mo_ctl table dump path - #26282

Merged
mergify[bot] merged 6 commits into
matrixorigin:mainfrom
aptend:cleanup/remove-legacy-table-dump
Jul 28, 2026
Merged

mergify[bot] merged 6 commits into
matrixorigin:mainfrom
aptend:cleanup/remove-legacy-table-dump

Conversation

@aptend

@aptend aptend 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 #21819

related issue #25782

What this PR does / why we need it:

The debug path introduced by #21821 is superseded by the native SQL DUMP TABLE and LOAD TABLE support added in #25989 for #25782, so the old debug-only mo_ctl command and data-application path are no longer needed.

This PR removes:

  • the dump-table and apply-table-data inspect commands and implementations
  • the txn.debug-mode configuration and TAE option used only by that path
  • dedicated dump-table ObjectIO names, writer type, and fault injection
  • tests that exercised the removed implementation

For rolling-upgrade safety, it retains only a cleanup-only dumpTable TmpFileService registration and legacy directory decoder. New code cannot create these files; upgraded TNs continue reclaiming table-sized dumps left by an older version.

Operational compatibility

The native SQL replacement operates on immutable/flushed objects and rejects unsupported schemas including partitioned, auto-increment, foreign-key/referenced, temporary, external, source, view, sequence, and transient tables. Existing debug users must flush live data first and cannot migrate unsupported schemas through native DUMP TABLE / LOAD TABLE.

Testing

  • go build ./pkg/vm/engine/tae/rpc
  • go vet ./pkg/vm/engine/tae/rpc
  • full go test for pkg/vm/engine/tae/rpc
  • focused race test for legacy upgrade GC
  • dependent pkg/txn/storage/tae test
  • existing CI coverage for affected objectio, tnservice, TAE options/RPC, and native frontend DUMP/LOAD paths

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

The removal is otherwise internally consistent: no live references remain, WriterDumpTable was the final enum value, affected packages pass race/vet, and the native DUMP/LOAD path still passes its focused race suite. One upgrade blocker remains.

[P1] Keep a transition GC for dump data created before the upgrade

The deleted dump_table.go did more than expose the commands: its package init registered the dumpTable TmpFileService app and GCDumpTableFiles. dump-table writes full table object copies below <data-dir>/tmp/dumpTable/<table-id>_<creation-time>_<snapshot-ts>, and the command itself was not gated by debug-mode (only apply was). Those copies can therefore be table-sized.

After this deletion, an upgraded TN still discovers the directory in TmpFileService.init, but pkg/fileservice/tmp_fs.go:214-233 looks it up in the global appConfigs, logs fs.tmp.init.not.found, and skips it. Periodic GC iterates only registered apps (:139-176). Consequently every pre-upgrade dump, including one created by an old TN immediately before a rolling restart, becomes permanently orphaned and can fill the TN local volume.

Please retain a cleanup-only legacy AppConfig/directory decoder for at least the old maximum retention or one compatibility window, while removing the inspect commands, apply implementation, writer type, and debug flag. Add an upgrade-shaped test that pre-populates a legacy dumpTable directory, initializes TmpFileService with the new code, advances/injects expiry, and verifies the old files and directory are reclaimed.

Non-blocking documentation note: this is an operational API removal rather than only a code refactor. Native DUMP/LOAD requires immutable/flushed objects and rejects partitions, auto-increment tables, and foreign keys, while the removed TAE diagnostic path handled live appendable data directly. The PR/release note should state that scope difference so existing debug users know to flush and whether their schema is unsupported.

Validation: full race passed for objectio, tnservice, TAE options/RPC, and focused native frontend DUMP/LOAD tests; the TAE db/test package compiles; vet passed for all affected/alternate-path packages. The head merges cleanly with latest main and RPC/TN race still passes in the prospective merge.

@aptend

aptend commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the upgrade blocker in commit 465862b97:

  • retained a cleanup-only registration for the legacy tmp/dumpTable application
  • retained only the legacy directory decoder and 24-hour GC behavior; no command, writer, apply path, debug flag, or fault injection was restored
  • added an upgrade-shaped test that pre-populates an expired legacy dump directory before TmpFileService initialization and verifies the periodic GC removes both its object and directory
  • updated the PR description with the native DUMP/LOAD operational limitations

Validation completed:

  • focused legacy GC test and focused -race test
  • full pkg/vm/engine/tae/rpc test suite
  • go build and go vet for the RPC package
  • dependent pkg/txn/storage/tae test

@aptend
aptend requested a review from XuPeng-SH July 28, 2026 10:42

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

The previous upgrade blocker is resolved: the cleanup-only dumpTable app registration remains reachable in production, the decoder matches the legacy writer's directory format and actual 24-hour GC behavior, and the upgrade-shaped test creates legacy data before TmpFileService initialization. Error and timeout paths retry instead of reporting a partial cleanup as complete.

I found no remaining production correctness, compatibility, or performance blocker. On installations without a legacy dumpTable directory, this adds only an init-time registry entry; no app is instantiated and no periodic legacy scan is added.

Validated on this exact head:

  • focused legacy upgrade GC under -race, 20 repetitions
  • full pkg/vm/engine/tae/rpc tests
  • dependent pkg/txn/storage/tae tests
  • compile-only checks for pkg/objectio, pkg/tnservice, and TAE options
  • go vet across all affected production packages
  • git diff --check

CI is still running and the branch is currently behind main; neither revealed a code-review blocker in the reviewed diff.

@mergify

mergify Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-07-28 16:26 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-07-28 19:38 UTC · at 0f7213dd15ec177d8b18eec2b5a68a98b8e6037c · squash

This pull request spent 3 hours 12 minutes 10 seconds in the queue, including 32 minutes 39 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86

@mergify
mergify Bot merged commit 7480f33 into matrixorigin:main Jul 28, 2026
24 of 25 checks passed
@mergify mergify Bot removed the queued label Jul 28, 2026
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
The debug path introduced by matrixorigin#21821 is superseded by the native SQL `DUMP TABLE` and `LOAD TABLE` support added in matrixorigin#25989 for matrixorigin#25782, so the old debug-only `mo_ctl` command and data-application path are no longer needed.

This PR removes:

- the `dump-table` and `apply-table-data` inspect commands and implementations
- the `txn.debug-mode` configuration and TAE option used only by that path
- dedicated dump-table ObjectIO names, writer type, and fault injection
- tests that exercised the removed implementation

For rolling-upgrade safety, it retains only a cleanup-only `dumpTable` TmpFileService registration and legacy directory decoder. New code cannot create these files; upgraded TNs continue reclaiming table-sized dumps left by an older version.

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
The debug path introduced by matrixorigin#21821 is superseded by the native SQL `DUMP TABLE` and `LOAD TABLE` support added in matrixorigin#25989 for matrixorigin#25782, so the old debug-only `mo_ctl` command and data-application path are no longer needed.

This PR removes:

- the `dump-table` and `apply-table-data` inspect commands and implementations
- the `txn.debug-mode` configuration and TAE option used only by that path
- dedicated dump-table ObjectIO names, writer type, and fault injection
- tests that exercised the removed implementation

For rolling-upgrade safety, it retains only a cleanup-only `dumpTable` TmpFileService registration and legacy directory decoder. New code cannot create these files; upgraded TNs continue reclaiming table-sized dumps left by an older version.

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
The debug path introduced by matrixorigin#21821 is superseded by the native SQL `DUMP TABLE` and `LOAD TABLE` support added in matrixorigin#25989 for matrixorigin#25782, so the old debug-only `mo_ctl` command and data-application path are no longer needed.

This PR removes:

- the `dump-table` and `apply-table-data` inspect commands and implementations
- the `txn.debug-mode` configuration and TAE option used only by that path
- dedicated dump-table ObjectIO names, writer type, and fault injection
- tests that exercised the removed implementation

For rolling-upgrade safety, it retains only a cleanup-only `dumpTable` TmpFileService registration and legacy directory decoder. New code cannot create these files; upgraded TNs continue reclaiming table-sized dumps left by an older version.

Approved by: @XuPeng-SH

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/refactor Code refactor size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants