Skip to content

Show pre-deleted table schemas and improve write errors - #18626

Merged
jt2594838 merged 4 commits into
apache:masterfrom
Caideyipi:fix/table-pre-delete-visibility
Sep 21, 2026
Merged

jt2594838 merged 4 commits into
apache:masterfrom
Caideyipi:fix/table-pre-delete-visibility

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Table schema operations can remain in PRE_DELETE or PRE_ALTER while a DROP or ALTER COLUMN procedure is incomplete. Existing metadata and cache paths can hide these objects, report misleading missing/already-existing errors, or leave stale column types after failure and recovery.

  • Include PRE_DELETE tables in SHOW TABLES without DETAILS while continuing to hide PRE_CREATE tables. Keep pre-deleted columns in plain DESC and retain the existing presentation of pending type changes.
  • Report tables or columns being deleted, and reject conflicting schema changes on columns being altered, with guidance to wait or retry. Use SEMANTIC_ERROR so IF NOT EXISTS and automatic schema creation cannot suppress these failures as ordinary duplicates. Provide both English and Chinese messages.
  • Check pre-deleted columns on the missing-column write path once per request, including INSERT and TsFile loading with automatic schema creation disabled. Existing-column writes do not perform an additional RPC.
  • Exclude pre-deleted columns from DataNode cache initialization, refresh, and column-extension schemas so these paths cannot restore their writability. Propagate pending column types to DataNodes while keeping DESC based on the complete metadata.
  • Add a consensus rollback plan for PRE_ALTER column type changes and make the procedure rollback-safe across failures and restarts. Detect already-committed alterations, clear only the matching pending marker, and prevent an older rollback from overwriting a newer alteration.
  • Track the previous DataNode table schema during pre-update so rollback can restore it after a concurrent cache refresh. If the previous schema is unavailable after restart, evict the potentially stale entry and fetch the canonical ConfigNode schema; delayed rollback after commit is ignored.

Validation

  • Added targeted unit coverage for PRE_DELETE visibility and write checks, PRE_ALTER plan serialization and procedure rollback, restart recovery, stale/delayed rollback handling, and DataNode cache restoration.
  • Spotless and Checkstyle passed for the changed modules; English/Chinese message keys and placeholders match.
  • Full-reactor English and Chinese test-compile -DskipTests passed for the affected reactor (Node Commons, DataNode, ConfigNode, and dependencies).
  • Current GitHub Actions checks pass, including Linux/Windows unit tests and zh-locale compilation.

This PR has:

  • been self-reviewed.
  • added unit tests for the changed behavior and cache refresh/recovery paths.

No integration cluster was started locally for this change.

@jt2594838
jt2594838 merged commit 3b47945 into apache:master Sep 21, 2026
55 of 56 checks passed
@jt2594838
jt2594838 deleted the fix/table-pre-delete-visibility branch September 21, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants