[ https://issues.apache.org/jira/browse/PHOENIX-4531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16331091#comment-16331091 ]
Vincent Poon commented on PHOENIX-4531: --------------------------------------- [~jamestaylor] your patch works in terms of preventing any mutations against the index, but if I issue a "DELETE FROM data_table", it uses uses ClientSelectDeleteMutationPlan, instead of ServerSelectDeleteMutationPlan. Is that what we want? You're right that we have the initialization of runOnServer that checks for hasImmutableIndexes, but again, after the initialization, we run: {code:java} runOnServer &= queryPlans.get(0).getTableRef().getTable().getType() != PTableType.INDEX; {code} So if the query optimizer came back with a plan to use the index table, even for mutable indexes, runOnServer becomes false. > Delete on a table with a global mutable index can issue client-side deletes > against the index > --------------------------------------------------------------------------------------------- > > Key: PHOENIX-4531 > URL: https://issues.apache.org/jira/browse/PHOENIX-4531 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.13.0 > Environment: > Reporter: Vincent Poon > Assignee: Vincent Poon > Priority: Major > Attachments: PHOENIX-4531.v1.master.patch, PHOENIX-4531_v1.patch, > PartialIndexRebuilderIT.java > > > For a table with a global mutable index, I found the following result in > client-side deletes against both the data table and index table. > "DELETE FROM data_table" > "DELETE FROM data_table WHERE indexed_col='v'" > We only need the delete to be issued against the data table, because > 1) It's redundant since a delete against the index will be issued on the > server side when we process the delete of the data table row > 2) Deletes issued from the client-side won't have the index failure policy -- This message was sent by Atlassian JIRA (v7.6.3#76005)