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

ASF GitHub Bot commented on PHOENIX-6082:
-----------------------------------------

virajjasani edited a comment on pull request #982:
URL: https://github.com/apache/phoenix/pull/982#issuecomment-734405590


   > Can you please confirm this patch locally by scanning SYSTEM.MUTEX via 
HBase shell?
   
   Sure, confirmed by scanning SYSTEM.MUTEX on local cluster with and without 
this patch.
   
   Initially, updated SYSTEM.MUTEX with KEEP_DELETED_CELLS => 'TRUE' because 
while executing ALTER TABLE query, Mutex cell is going to be deleted soon 
(finally block), hence it appears only momentarily.
   
   <img width="1784" alt="Screenshot 2020-11-26 at 10 26 59 PM" 
src="https://user-images.githubusercontent.com/34790606/100377021-86a10980-3036-11eb-8929-4c0ef2cd3453.png";>
   
   
   With patch, no records were found while scanning SYSTEM.MUTEX:
   
   <img width="616" alt="Screenshot 2020-11-26 at 10 10 42 PM" 
src="https://user-images.githubusercontent.com/34790606/100376799-24480900-3036-11eb-99fe-6c9d5a39b05e.png";>
   
   
   Without patch, executed ALTER TABLE query twice and found two deleted rows 
(first scan result after first execution of ALTER query, and second scan result 
after second execution of ALTER query) :
   
   <img width="1019" alt="Screenshot 2020-11-26 at 10 35 41 PM" 
src="https://user-images.githubusercontent.com/34790606/100377718-c3b9cb80-3037-11eb-88e9-ddc9d1ad6c04.png";>
   
   
   ALTER TABLE query used for testing:
   
   <img width="501" alt="Screenshot 2020-11-26 at 10 38 18 PM" 
src="https://user-images.githubusercontent.com/34790606/100377864-20b58180-3038-11eb-9b1b-fde03da0a379.png";>
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> No need to do checkAndPut when altering properties for a table or view with 
> column-encoding enabled
> ---------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6082
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6082
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.0.0, 4.15.0
>            Reporter: Chinmay Kulkarni
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: performance, phoenix-hardening, quality-improvement
>             Fix For: 5.1.0, 4.16.0
>
>
> ALTER TABLE/VIEW SET <property> follows the same code path as an add column. 
> Thus, when column-encoding is enabled on the physical table, we will do a 
> checkAndPut with the <physical table schema name>, <physical table name> (see 
> [this|https://github.com/apache/phoenix/blob/4ddbe2688b78645bc73857141cec12cb1c08993b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java#L3940-L3947]).
> This makes sense when we are adding a column since this causes an update to 
> the encoded column qualifier counter of the base table and we want to prevent 
> any concurrent changes to this field. However, when setting properties, we 
> don't update the column qualifier counter so this extra checkAndPut is 
> unnecessary. The server-side [write-lock on the table header 
> row|https://github.com/apache/phoenix/blob/4ddbe2688b78645bc73857141cec12cb1c08993b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java#L2619]
>  followed by a [sequence number 
> check|https://github.com/apache/phoenix/blob/4ddbe2688b78645bc73857141cec12cb1c08993b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java#L2684-L2691]
>  should be sufficient and is already done.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to