[
https://issues.apache.org/jira/browse/PHOENIX-7269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17825974#comment-17825974
]
Istvan Toth edited comment on PHOENIX-7269 at 3/13/24 9:14 AM:
---------------------------------------------------------------
Digging a bit deeper, the REDACTED HBase table exists, but the there is no
metadata in system.catalog for it.
It is only referred from the base table syscat rows in the last (COLUMN_FAMILY)
field of the PK, which seems to be the old way of linking data and index tables.
So maybe we should add a step where we verify that the table referred in the
old-style link cells can be resolved, and removing those cells if they are not.
For reference, here are the dangling cells in system:catalog which refer to
REDACTED_INDEX_TABLE, which does not exist in system.catalog (but happens to
exist in HBase).
{noformat}
\x00REDACTED_SCHEMA\x00REDACTED_BASE_TABLE\x00\x00REDACTED_INDEX_TABLE
column=0:LINK_TYPE, timestamp=1663995086420, value=\x01
\x00REDACTED_SCHEMA\x00REDACTED_BASE_TABLE\x00\x00REDACTED_INDEX_TABLE
column=0:TABLE_SEQ_NUM, timestamp=1663995086420,
value=\x80\x00\x00\x00\x00\x00\x00\x00
\x00REDACTED_SCHEMA\x00REDACTED_BASE_TABLE\x00\x00REDACTED_INDEX_TABLE
column=0:TABLE_TYPE, timestamp=1663995086420, value=i
\x00REDACTED_SCHEMA\x00REDACTED_BASE_TABLE\x00\x00REDACTED_INDEX_TABLE
column=0:_0, timestamp=1663995086420, value=x
{noformat}
was (Author: stoty):
Digging a bit deeper, the REDACTED HBase table exists, but the there is no
metadata in system.catalog for it.
It is only referred from the base table syscat rows in the last (COLUMN_FAMILY)
field of the PK, which seems to be the old way of linking data and index tables.
So maybe we should add a step where we verify that the table referred in the
old-style link cells can be resolved, and removing those cells if they are not.
For reference, here are the dangling cells in system:catalog which refer to
REDACTED_INDEX_TABLE, which does not exist in system.catalog (but happens to
exist in HBase.
{noformat}
\x00REDACTED_SCHEMA\x00REDACTED_BASE_TABLE\x00\x00REDACTED_INDEX_TABLE
column=0:LINK_TYPE, timestamp=1663995086420, value=\x01
\x00REDACTED_SCHEMA\x00REDACTED_BASE_TABLE\x00\x00REDACTED_INDEX_TABLE
column=0:TABLE_SEQ_NUM, timestamp=1663995086420,
value=\x80\x00\x00\x00\x00\x00\x00\x00
\x00REDACTED_SCHEMA\x00REDACTED_BASE_TABLE\x00\x00REDACTED_INDEX_TABLE
column=0:TABLE_TYPE, timestamp=1663995086420, value=i
\x00REDACTED_SCHEMA\x00REDACTED_BASE_TABLE\x00\x00REDACTED_INDEX_TABLE
column=0:_0, timestamp=1663995086420, value=x
{noformat}
> Upgrade fails when HBase table for index is missing
> ---------------------------------------------------
>
> Key: PHOENIX-7269
> URL: https://issues.apache.org/jira/browse/PHOENIX-7269
> Project: Phoenix
> Issue Type: Bug
> Components: core
> Reporter: Istvan Toth
> Priority: Major
>
> When attempting to upgrade the metadata during upgrade, the process is
> aborted if Phoenix encounters indexes defined in SYSTEM.CATALOG, but missing
> the corresponding HBase backing table.
> Upgrade should log a warning, but continue in this case, as those indexes are
> broken anyway.
> The problem is in
> org.apache.phoenix.util.UpgradeUtil.addViewIndexToParentLinks()
> {noformat}
> Caused by: org.apache.phoenix.schema.TableNotFoundException: ERROR 1012
> (42M03): Table undefined. tableName=REDACTED
> ... 14 more
> at java.util.concurrent.FutureTask.report(FutureTask.java:122)
> at java.util.concurrent.FutureTask.get(FutureTask.java:192)
> at
> org.apache.hadoop.hbase.client.HTable.coprocessorService(HTable.java:991)
> at
> org.apache.hadoop.hbase.client.HTable.coprocessorService(HTable.java:953)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.metaDataCoprocessorExec(ConnectionQueryServicesImpl.java:1785)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.metaDataCoprocessorExec(ConnectionQueryServicesImpl.java:1764)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.getTable(ConnectionQueryServicesImpl.java:2013)
> at
> org.apache.phoenix.schema.MetaDataClient.updateCache(MetaDataClient.java:657)
> at
> org.apache.phoenix.schema.MetaDataClient.updateCache(MetaDataClient.java:545)
> at
> org.apache.phoenix.schema.MetaDataClient.updateCache(MetaDataClient.java:541)
> at
> org.apache.phoenix.schema.MetaDataClient.updateCache(MetaDataClient.java:536)
> at
> org.apache.phoenix.util.PhoenixRuntime.getTable(PhoenixRuntime.java:457)
> at
> org.apache.phoenix.util.UpgradeUtil.addViewIndexToParentLinks(UpgradeUtil.java:1244)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.upgradeSystemCatalogIfRequired(ConnectionQueryServicesImpl.java:3794)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.upgradeSystemTables(ConnectionQueryServicesImpl.java:3951)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:3337)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:3238)
> at
> org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
> at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:3238)
> at
> org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:255)
> at
> org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:144)
> at
> org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:221)
> at sqlline.DatabaseConnection.connect(DatabaseConnection.java:135)
> at
> sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:192)
> at
> sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:192)
> at sqlline.Commands.connect(Commands.java:1364)
> at sqlline.Commands.connect(Commands.java:1244)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
> at sqlline.SqlLine.dispatch(SqlLine.java:730)
> at sqlline.SqlLine.initArgs(SqlLine.java:410)
> at sqlline.SqlLine.begin(SqlLine.java:515)
> at sqlline.SqlLine.start(SqlLine.java:267)
> at sqlline.SqlLine.main(SqlLine.java:206){noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)