Repository navigation
PHOENIX-8086 MetaDataEndpointImpl.createTable reports failure after a successful commit - #2718
Conversation
… successful commit createTable commits the catalog rows and then reads the new table back. If the region moves, this read can fail with NotServingRegionException. The endpoint then reports a failure, and the client retry gets TABLE_ALREADY_EXISTS for a table that the same statement created. Now a failed read after the commit logs a warning and returns success without the table. The client builds the table from its own metadata, without LAST_DDL_TIMESTAMP and the external schema id. Views and indexes get these values on the next refresh. A base table keeps them null in the client cache until its next DDL or cache eviction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The fallback loses the generated external schema ID in client metadata, causing subsequent writes to omit it from WAL annotations even after a forced refresh.
1 open issue
What changed in this PR
Addresses PHOENIX-8086 by preventing a metadata read failure after a successful CREATE TABLE commit from triggering a misleading failure and retry.
Changes:
- Catches post-commit metadata read exceptions and logs a warning.
- Returns success without table metadata, allowing client reconstruction while leaving pre-commit failures unchanged.
| File | Description |
|---|---|
| phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java | Adds a success fallback when the post-commit table read fails. |
Review effort: Balanced
…failed read When the read after the commit fails, the endpoint now builds the new table from the catalog rows that it has just committed, the same way schema export already does. These rows carry the server-generated DDL timestamp and, with change detection, the external schema id, so the client caches the same values as after a normal read. If this build also fails, the endpoint returns success without the table, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
5 open issues
CatchingExceptionhere is overly broad and can accidentally swallow interrupt signals (e.g.,… · New This path can be triggered by transient/expected conditions (e.g., region movement) and may happen… · New This introduces new correctness-critical behavior (returning success and optionally reconstructing… · New Fallback drops schema ID from WAL annotations The new parameter nameclientTimeStampis inconsistent with the existingclientTimestampnaming… · New
Review effort: Lite
A test hook makes the read after a create fail one time. It can also make the build from mutations fail. New tests check that the create succeeds in both cases. The client keeps the server DDL timestamp only when the response carries the table. The fallback now catches only the I/O, SQL and runtime exceptions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…allback A static helper now clears the test flag, so the endpoint instance does not write to a static field. The row filter names its child row test, so it needs no parentheses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ilures The read after the commit now catches the same failures as the build from mutations, so an unchecked failure of the read also falls back to that build. The comments now say that the build reads no region rows only for a base table. For a view or an index it still reads parent and link rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Self-review (Claude Code, pr-review-toolkit) — Copilot could not review this PR because of a review quota limit, so this is an automated self-review in its place. Suggestions
Strengths
Recommendation: merge after nits 🤖 Generated with Claude Code |
|
Follow-up to the self-review (Claude Code). The latest commit, 9d42095, addresses the first two suggestions.
The metadata endpoint and WAL annotation integration tests pass on this commit in local docker. 🤖 Generated with Claude Code |
|
About the failures in the latest precommit run (Claude Code). None of them come from this change. Each one is a known test problem with its own fix under review.
Both failed test classes passed on this same commit in the local CI run described above. 🤖 Generated with Claude Code |
… successful commit (#2718) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Andrew Purtell <apurtell@salesforce.com>


A CREATE TABLE without IF NOT EXISTS failed in CI because the table already existed. The first attempt committed the table. The balancer then closed the catalog region before the endpoint read back the new table. The endpoint reported a failure, the HBase client retried, and the retry found the committed table.
The change catches a failure of that read after the commit. The endpoint then builds the new table from the catalog rows it has just committed, the same way schema export already does, and returns success with that table. Those rows hold the values that only the server generates, the DDL timestamp and the external schema id, so the client caches the same values as after a normal read. If that in-memory build also fails, the endpoint logs a warning and returns success with no table, and the client builds the table from its own metadata as it already can. Failures before the commit do not change.
New tests use a test hook to make the read after a create fail, and in a second case the in-memory build as well. They check that the create succeeds in both cases and that the client keeps the stored DDL timestamp when the response carries the table.
🤖 Generated with Claude Code