Support Questions
Find answers, ask questions, and share your expertise

What will happen if we drop view and recrete in Phoenix

Expert Contributor

My concern is why its working after re-create of view in Phoenix , data fecching from Hbase.

Query was not working :- Error as below

jdbcphoenixhostport/hbase-unsecure> select colun from view_name where rowid like '%ahsfkjshkfjhah==%';

java.lang.RuntimeException: org.apache.phoenix.schema.StaleRegionBoundaryCacheException: ERROR 1108 (XCL08): Cache of region boundaries are out of date.


Once dropped the view and recreated it working fine:-

jdbcphoenixhostport/hbase-unsecure> drop view view_name;

jdbcphoenixhostport/hbase-unsecure> create view view_name;

jdbcphoenixhostport/hbase-unsecure> select colun from view_name where rowid like '%ahsfkjshkfjhah==%';

+------------------------------------------+ | Colun | +------------------------------------------+ | output of record | | output of record | | output of record | 14 rows selected (6.632 seconds) 0 jdbcphoenixhostport/hbase-unsecure>

Why this working after drop and recreate the view , please advise ?


The table details and corresponding stats are stale at the Region Server so that you might be getting StaleRegionBoundaryCacheException or else you might be hitting PHOENIX-2447.

Once we drop the view the stats will be invalidated and then while querying after recreation of view the new stats from the system stats table will be repopulated so you are not seeing the same issue.

There are many issues related to stats are fixed in Phoenix 4.7.0.

So better you can upgrade to HDP 2.4 or above if you are using older versions or Phoenix to 4.7.0 in case of own clusters.

Expert Contributor

Thank you for your reply.

Is there any other approach to fix the issue.

Please advise

At present you can remove the the stats of the view from SYSTEM.STATS with delete query. Something like this and see still getting the same issue. still if you are getting the same issue then restart the region server holding the SYSTEM.CATALOG table and close and reopen the connection.

delete from SYSTEM.STATS where PHYSICAL_NAME=viewname

Expert Contributor

Following things i did it,, issue got resolved

1) I have restarted the region server.

2) drop and re-creating the View.

This is for immediate fix, however Deleting the status from table names also same as drop/recreate.

why this error will occur is there any other issue ?

Expert Contributor

Is there any other maintenance need to be done at Hbase level.

1) Hbase region server data locality

2) need to allocate dedicated Region server and adding more region server

Please advise

; ;