Repository navigation
Conversation
| } | ||
| ``` | ||
|
|
||
| If the refresh job starts but the catalog cannot record it, CREATE cancels the job and drops the table it created. |
There was a problem hiding this comment.
Is this for the case of full mode? I am asking because the next sentence starts withIn continuous mode...
There was a problem hiding this comment.
It was for continuous mode, I rephrased the sentence to make it clear.
| private static final String LEFT_IN_INITIALIZING_STATUS = | ||
| " The table was left in INITIALIZING status. No materialized table statement can drop a" | ||
| + " table in this status or move it out of it. Remove it from the catalog directly."; |
There was a problem hiding this comment.
Do users know what INITIALIZING status is?
There was a problem hiding this comment.
I thought it is described in the docs, but you are right that they don't know about it. I adjusted the error message accordingly.
AHeise
left a comment
There was a problem hiding this comment.
The submit → record → cancel-on-failure split is a clear improvement, and leaving the table SUSPENDED when the new ALTER job can't be cancelled is consistent and recoverable. The addSuppressed fix and the drop-failure test cover what would have been my blocker.
On commit structure: the second commit mixes that bug fix with re-quoting ~30 identifier messages, most of them outside the paths this PR touches (refresh, drop, suspend workflow, ...). I'd fold the addSuppressed fix and the new test into the first commit and keep the '%s'/asSummaryString change as a separate [hotfix] commit, so the actual change stays reviewable and bisectable.
The rest is minor, and some of it predates this PR — fine as follow-ups if you prefer.
…tor messages - Print the table as `'cat.db.t'` (`asSummaryString()`) instead of `` `cat`.`db`.`t` `` in the exception and log messages of `DefaultMaterializedTableExecutor`, as `CatalogManager` does - Update the message assertions in `MaterializedTableStatementITCase`, `MaterializedTableTableApiITCase` and `DefaultMaterializedTableExecutorTest`
AHeise
left a comment
There was a problem hiding this comment.
Thanks, verified all addressed threads; the deferrals to FLINK-41350 and FLINK-41437 are fine with me.
Remaining ask: the two new rollback-failure paths in alterActivatedContinuousMaterializedTable (uncancelled job + rollback fails, restart fails + rollback/restart fails) and the RESUME uncancelled hint have no tests. FailingCatalog only fails the next write matching one predicate, so the rollback cases need a second failure, e.g. a queue of matchers. With those and green CI, LGTM from my side.
|
@flinkbot run azure |
|
@Timm0 could you squash 49640ba into the FLINK-41390 commit? It only reworks code that commit introduces, so the history reads better as hotfix + feature. |
…t record - Cancel a continuous refresh job when recording it in the catalog fails, on CREATE, RESUME, convert-to-MT and the ALTER restart - Name a job that could not be cancelled in the CREATE, RESUME and convert errors, so a retry does not start a second job - ALTER: if the new job cannot be cancelled, roll back to SUSPENDED and skip restarting the old job - Keep the original error as suppressed when the compensating drop, ALTER rollback, old-job restart or suspend fails - Name the savepoint in the cancelled-job error, for a catalog write that committed but still threw - SUSPEND: name the savepoint and the `execution.state-recovery.path` hint when the catalog write after the stop fails - Add `FailingCatalog`-based tests to `DefaultMaterializedTableExecutorTest` - Document the cancel behaviour for CREATE and RESUME in `statements.md`
What is the purpose of the change
When a materialized table statement starts a continuous refresh job but the catalog then fails to record it, the job keeps running unrecorded. On
CREATEthe table is dropped and the job is orphaned. OnRESUME, convert-to-MT and theALTERrestart the table survives, so a retry, or theALTERrollback, starts a second job writing to the same sink. This change cancels the unrecorded job on all four paths, keeps the original error when compensation fails, and names the savepoint whenSUSPENDcannot record it. This is shared new behavior for the SQL Gateway and Table API.Brief change log
executeContinuousRefreshJobcancels the job when recording it fails. CREATE, RESUME, convert, the ALTER restart and the ALTER rollback's restart all go through it. A failed submit still only throws.execution.state-recovery.pathhint.FailingCatalog-based tests inDefaultMaterializedTableExecutorTestcover each path, including the cases where the cancel fails.statements.md(en, zh) documents the cancel behaviour.Verifying this change
This change added tests and can be verified as follows:
DefaultMaterializedTableExecutorTestcases that use aFailingCatalogto fail a selectedalterTablecall:execution.state-recovery.pathhint when the catalog write after the stop failsMaterializedTableTableApiITCaseandMaterializedTableStatementITCasestill pass.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code Opus 5.5