The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-9636-a038371b620f67e9aeb2c067f393f46169ac3331
 has succeeded.
Run started by GitHub user mengw15 (triggered by mengw15).

Head commit for run:
c15f72498e10d0c0bade0fda859eb14437e5b732 / Meng Wang <[email protected]>
fix(storage): report a table as missing only when it does not exist (#9636)

### What changes were proposed in this PR?

`IcebergUtil.loadTableMetadata` and the Python worker's
`load_table_metadata` returned `None` for any failure, so a catalog that
could not be read looked like a deleted table: result-service answered
404, or 200 with an empty page, and counts and reads came back empty.
They now return `None` only when the table or its namespace does not
exist, and raise anything else.

`openDocument` throws `DocumentNotFoundException`, a subtype of the
`IllegalArgumentException` it always threw, so callers match the type
instead of the message. The three places that clear results (deleting a
workflow, deleting executions, and clearing a workflow's previous
execution) now share `clearDocument`, which passes over a missing
document and logs any other failure. Two of them swallowed every
failure, so a table that could not be cleared was left behind unnoticed.
Expiring the runtime statistics' snapshots now handles failures the same
way.

One lookup stays best effort. Once an `IcebergDocument` iterator has
returned every row of the table it resolved, it looks for rows committed
since. Failing that should not fail a read that is complete, so it logs
a warning and ends, as it did before.

**Behavior change in the engine.** When the catalog fails as a reader
first resolves its materialized input, the reader now fails instead of
giving the operator no input. As when opening the document fails today,
the JVM reader thread rethrows and the Python reader logs, and neither
ends its channel, so the operator waits rather than producing a wrong
result.

### Any related issues, documentation, discussions?

Closes #9635.

### How was this PR tested?

- Written first, and red on main: `ResultResourceSpec` answered 404 and
200 where it expects 500, `IcebergDocumentSpec` counted 0 and read
empty, `IcebergUtilSpec` got `None`, and three Python cases did not
raise.
- `IcebergUtilSpec` pinned the old behavior ("return None when loading
table metadata fails"). It now covers a missing table or namespace, and
every other failure.
- Removing the best-effort lookup turns its `IcebergDocumentSpec` case
red.
- `WorkflowExecutionsResourceSpec` covers `clearDocument`: dropping
either branch, or the log, turns a case red.
- The WorkflowCore suite (889 tests, on the rest and postgres catalogs),
`ResultResourceSpec`, and, against a local Postgres, the amber unit
suite (2443 tests) and the Python storage suite (144 tests) pass.
scalafmt, scalafix and ruff are clean.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-opus-5-5)

Report URL: https://github.com/apache/texera/actions/runs/45256661027

With regards,
GitHub Actions via GitBox

Reply via email to