[ 
https://issues.apache.org/jira/browse/PHOENIX-7369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Viraj Jasani resolved PHOENIX-7369.
-----------------------------------
    Resolution: Fixed

> Avoid redundant recursive getTable() RPC calls
> ----------------------------------------------
>
>                 Key: PHOENIX-7369
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7369
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.2.0
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Blocker
>             Fix For: 5.2.1, 5.3.0
>
>
> When PTable object is built for any given table as part of getTable() API, 
> many recursive getTable() calls are made in order to build the full PTable 
> object with all details of parent table/view hierarchy as well as index 
> tables.
> Moreover, PHOENIX-6247 introduced a way to separate Phoenix logical table 
> name from HBase physical table name. As part of this, the num of recursive 
> getTable() calls have increased but more importantly in case of view index, 
> the num of getTable() RPC calls using server-side CQSI connection has also 
> increased, which are redundant as the view index table does not have 
> corresponding PTable representation in Phoenix.
> {code:java}
>             } else if (Bytes.compareTo(LINK_TYPE_BYTES, 0, 
> LINK_TYPE_BYTES.length, colKv.getQualifierArray(), 
> colKv.getQualifierOffset(), colKv.getQualifierLength()) == 0) {
>                 LinkType linkType = 
> LinkType.fromSerializedValue(colKv.getValueArray()[colKv.getValueOffset()]);
>                 if (linkType == LinkType.INDEX_TABLE) {
>                     addIndexToTable(tenantId, schemaName, famName, tableName, 
> clientTimeStamp, indexes, clientVersion);
>                 } else if (linkType == PHYSICAL_TABLE) {
>                     // famName contains the logical name of the parent table. 
> We need to get the actual physical name of the table
>                     PTable parentTable = null;
>                     if (indexType != IndexType.LOCAL) {
>                         parentTable = getTable(null, 
> SchemaUtil.getSchemaNameFromFullName(famName.getBytes()).getBytes(StandardCharsets.UTF_8),
>                                 
> SchemaUtil.getTableNameFromFullName(famName.getBytes()).getBytes(StandardCharsets.UTF_8),
>  clientTimeStamp, clientVersion);
>                         if (parentTable == null || 
> isTableDeleted(parentTable)) {
>                             // parentTable is not in the cache. Since famName 
> is only logical name, we need to find the physical table.
>                             try (PhoenixConnection connection = 
> QueryUtil.getConnectionOnServer(env.getConfiguration()).unwrap(PhoenixConnection.class))
>  {
>                                 parentTable = 
> connection.getTableNoCache(famName.getString());
>                             } catch (TableNotFoundException e) {
>                                 // It is ok to swallow this exception since 
> this could be a view index and _IDX_ table is not there.
>                             }
>                         }
>                     } {code}
>  
> Under heavy load, the situation can get worse and occupy all metadata handler 
> threads, freezing the regionserver hosting SYSTEM.CATALOG.
> The proposal for this Jira:
>  * For View Index table, do not perform any getTable() call. This will also 
> avoid large num of RPC calls.
>  * Only for splittable SYSTEM.CATALOG, we should allow getTable() RPC calls 
> if the scanning of local region provides null PTable.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to