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

Gourab Taparia commented on PHOENIX-6655:
-----------------------------------------

[Please ignore the above comment - i have deleted it] 

I was working on the changes to make sure WRITE_DATA_ON_CACHE is set both at 
new table creation level and also during upgrades(in case the table already 
exists). However during Integration test, I see that the property is not 
getting picked up via CFD’s isCacheDataOnWrite method. When running the related 
phoenix queries to set the WRITE_DATA_ON_CACHE, the property is not getting set 
at ColumnFamilyDescriptor level rather it is getting set at the Table MetaData 
level. Is this expected ? If yes, how can we leverage the CFD public methods to 
respect it ? 

*More details :*
Looks like when we set the property, it is getting set at the Table MetaData 
level rather than the ColumnFamilyDescriptor level. The change made leverages 
the ColumnFamilyDescriptor itself, and the WRITE_DATA_ON_CACHE property and its 
[public 
methods|https://github.com/apache/hbase/blob/branch-2.4/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java#L997].
 The CFD maintains a key value pair, has the defaults and reserved-key 
[maintained|https://github.com/apache/hbase/blob/branch-2.4/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java#L290].
 From the underlying 
[getValues|https://github.com/apache/hbase/blob/branch-2.4/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java#L1092]
 - it should also respect any other key added apart form the defaults/reserved 
- and should be part of the CFD values map itself. I tried outputting the 
underlying values map of CFD in the above test - however it doesn’t contain the 
WRITE_DATA_ON_CACHE flag as a [meta data in 
CFD|https://github.com/apache/hbase/blob/branch-2.4/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java#L1119].

I tried reproducing this using standalone binaries too and it is showing the 
same - For default/reserved keys they are shown as part of the “COLUMN FAMILIES 
DESCRIPTION” - which in-turn are correctly exposed through CFD public methods. 
However, for WRITE_DATA_ON_CACHE it is shown as part of Table metadata. 

[Image below]
!Screenshot 2022-11-25 at 4.38.38 PM.png!

> SYSTEM.SEQUENCE should have CACHE_DATA_ON_WRITE set to true
> -----------------------------------------------------------
>
>                 Key: PHOENIX-6655
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6655
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Geoffrey Jacoby
>            Assignee: Gourab Taparia
>            Priority: Major
>         Attachments: Screenshot 2022-11-25 at 4.38.38 PM.png
>
>
> High volume use cases of Phoenix sequences need to write to the same row of 
> SYSTEM.SEQUENCE very frequently, but each time we write, the block cache that 
> row is in is invalidated and has to be loaded again. 
> [~rushabh.shah] was looking at a case in our environment where a sequence was 
> being used heavily and found lots of time spent reading the HFiles for the 
> same Get of the sequence row within the SequenceRegionObserver increment 
> coproc. 
> [~apurtell] pointed out offline that HColumnDescriptor has a property, 
> CACHE_DATA_ON_WRITE that keeps caches updated when a value is flushed. This 
> should help improve contention on sequence increments. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to