[ 
https://issues.apache.org/jira/browse/PHOENIX-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16580486#comment-16580486
 ] 

Thomas D'Silva commented on PHOENIX-4764:
-----------------------------------------

Currently when we drop a table that has child views we don't drop the child 
views. While resolving a child view we resolve its parents and if we can't find 
any of them we throw a {{TableNotFoundExpception}}. If we try to recreate a 
table that was previously dropped we then try to drop the child views. 
Instead of hooking into compaction and then dropping orphaned views, should we 
just try to drop the child views while dropping the parent as a best effort? In 
most cases dropping the child views should not fail. 
If we need to hook into the compaction process, we will need to compute the 
orphaned views  before  SYSTEM.CATALOG regions are compacted. We would have to 
store the list of tables that were dropped somewhere (maybe in another SYSTEM 
table, or zookeeper) and then scan SYSTEM.CATALOG to get the orphaned views 
(one scan per table that was dropped). Doing this before compacting 
SYSTEM.CATALOG might slow down compaction.

WDYT [~jamestaylor] [~lhofhansl]



> Cleanup metadata of child views for a base table that has been dropped
> ----------------------------------------------------------------------
>
>                 Key: PHOENIX-4764
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4764
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Thomas D'Silva
>            Priority: Major
>
> When we drop a base table, we no longer drop all the child view metadata. 
> Clean up the child view metadata during compaction. 
> If we try to recreate a base table that was previously dropped but whose 
> child view metadata wasn't cleaned up throw an exception. Add a test for 
> this. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to