[
https://issues.apache.org/jira/browse/PHOENIX-6154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chinmay Kulkarni reassigned PHOENIX-6154:
-----------------------------------------
Assignee: (was: Chinmay Kulkarni)
> Move the check for existence of child views and task addition to drop those
> child views to the client side when dropping a table/view
> -------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-6154
> URL: https://issues.apache.org/jira/browse/PHOENIX-6154
> Project: Phoenix
> Issue Type: Sub-task
> Affects Versions: 5.0.0, 4.15.0
> Reporter: Chinmay Kulkarni
> Priority: Major
> Fix For: 5.1.0, 4.16.0
>
>
> When we issue a {{DROP TABLE/VIEW}}, if the table/view being dropped has
> child views (and {{CASCADE}} is provided), we add a
> {{[DropChildViewsTask|https://github.com/apache/phoenix/blob/1d844950bb4ec8221873ecd2b094c20f427cd984/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/tasks/DropChildViewsTask.java]}}
> in the {{SYSTEM.TASK}} table (see
> [this|https://github.com/apache/phoenix/blob/1d844950bb4ec8221873ecd2b094c20f427cd984/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java#L2479]).
> This means that *while holding the row lock* for the table/view’s header row
> ([here|https://github.com/apache/phoenix/blob/1d844950bb4ec8221873ecd2b094c20f427cd984/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java#L2253])
> we do the following:
> # Make an
> [RPC|https://github.com/apache/phoenix/blob/1d844950bb4ec8221873ecd2b094c20f427cd984/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java#L2459-L2461]
> to the region hosting {{SYSTEM.CHILD_LINK}} to scan it in order to find
> child views.
> # If any child views are found in the step above, we make additional RPCs to
> the region hosting {{SYSTEM.TASK}} to
> {{[UPSERT|https://github.com/apache/phoenix/blob/1d844950bb4ec8221873ecd2b094c20f427cd984/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java#L2479-L2484]}}
> a {{DropChildViewsTask}} for immediate child views.
> # We [send remote
> mutations|https://github.com/apache/phoenix/blob/1d844950bb4ec8221873ecd2b094c20f427cd984/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java#L2298-L2302]
> to drop parent→child links from the {{SYSTEM.CHILD_LINK}} table.
> Of the above extra RPCs, note that even if the table/view has no child views
> or if {{CASCADE}} is not provided, we will still do the first RPC from the
> server while holding a row lock.
> We should move this check to the client (issue a scan against
> SYSTEM.CHILD_LINK to see if a single linking row exists) and also add the
> task from the client.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)