Baymine opened a new pull request, #66178:
URL: https://github.com/apache/doris/pull/66178
### What problem does this PR solve?
Issue Number: close #66177
Related PR: N/A
Problem Summary:
When a schema-change job is cancelled while the table is still in the
`WAITING_STABLE` sub-state (the table never became stable, so the job was never
promoted to `SCHEMA_CHANGE`), the table state was not reset back to `NORMAL`:
`SchemaChangeJobV2.changeTableState` only reset from `SCHEMA_CHANGE`. The table
was then permanently stuck in `WAITING_STABLE` with no live job, and every
subsequent ALTER / TRUNCATE / DROP PARTITION / RENAME / CANCEL was rejected —
the only escape was DROP TABLE.
This fixes it in two places:
1. `SchemaChangeJobV2.changeTableState` now also resets the table from
`WAITING_STABLE` (not just `SCHEMA_CHANGE`) when a job is cancelled, so the
normal "cancel a WAITING_STABLE job" path returns the table to `NORMAL`.
2. `SchemaChangeHandler.cancelColumnJob` now self-heals a table left in an
orphaned `WAITING_STABLE` state with no backing job (which older binaries could
produce) by resetting it to `NORMAL` durably via `setTableStatusInternal`,
instead of throwing "could not find related job". An orphaned `SCHEMA_CHANGE`
state (not a known-reachable state) still fails loudly so it is investigated
rather than silently masked.
### Release note
Fix a schema-change table state leak: cancelling a job that is stuck in
WAITING_STABLE now correctly resets the table to NORMAL instead of leaving it
permanently blocked for all subsequent ALTER operations.
### Check List (For Author)
- [x] Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Please explain why:
- [ ] Behavior changed:
- [ ] Does this need documentation?
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]