Phoenix JDBC driver and SYSTEM.CATALOG compatibility after interrupted upgrade migration
0 reputation · 04 Sept 2024, 18:15 UTC
0 reputation · 04 Sept 2024, 18:15 UTC
When upgrading Apache Phoenix, the migration of the SYSTEM.CATALOG tables in HBase typically runs on the first connection from a newer JDBC client, modifying internal metadata structures. If that upgrade is interrupted or fails, the catalog may be left in an intermediate state that the previous version cannot interpret.
The core uncertainty sits at the integration boundary between the client-side JDBC driver and the HBase-stored metadata. Because Phoenix does not generally guarantee that upgraded catalog metadata remains readable by older clients, simply reverting the driver JAR may not restore service once the SYSTEM.* tables have been touched. Recovery planning therefore needs to account for catalog version, client driver, and region server coprocessor JARs as one aligned unit, with HBase snapshots of the SYSTEM.* tables taken beforehand as the likely rollback mechanism. Exact guarantees vary by version, and cross-major jumps such as 4.x to 5.x also change the required HBase version, so the specific release notes for the versions in use should be consulted.
31775 reputation · 05 Sept 2024, 06:12 UTC
No — an older Phoenix JDBC client should not be expected to query a catalog that a newer version has partially migrated. Phoenix performs the SYSTEM.CATALOG upgrade in place on the first connection from a newer client, and there is no forward-compatibility guarantee that older clients can read metadata written by a newer catalog version. In practice the old client fails at connection time with metadata or version incompatibility errors rather than silently degrading. There is also no documented in-place \"un-migrate\" or catalog repair utility; the supported recovery path is restoring the pre-upgrade state of all SYSTEM.* tables from HBase snapshots taken before the first new-client connection.
Well-established behavior: the catalog upgrade mutates SYSTEM.CATALOG and related tables (SYSTEM.SEQUENCE, SYSTEM.STATS, SYSTEM.FUNCTION, etc.) in place, and the client validates catalog structure at connection time. Less certain: exactly how far an interrupted migration progressed and which tables were touched — a partial migration is not a well-defined state, and detection is empirical (connection failures, exceptions from the metadata coprocessor, or catalog version messages in logs). Exact behavior, log messages, and error types vary by release, so treat the specifics below as a checklist to verify against your versions' release notes, not as universal guarantees.
SYSTEM.CATALOG rows via the HBase shell — that is unsupported and risks worse corruption. If no pre-upgrade snapshot exists, the realistic options are completing the upgrade instead of rolling back, or rebuilding the cluster metadata from scratch. Snapshots taken after the upgrade started do not help.SYSTEM.* tables — not just SYSTEM.CATALOG — from the pre-upgrade snapshot. Restoring a subset leaves the cluster inconsistent.DatabaseMetaData and run a representative query against a real user table before reopening to traffic.One diagnostic detail matters here: whether a pre-upgrade snapshot of the SYSTEM.* tables actually exists. If it does not, rolling back is likely the wrong goal, and pushing the interrupted upgrade through to completion (with matching new coprocessors everywhere) is usually the safer path.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.