phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-4278) Implement pure client side transactional index maintenance
Date Thu, 08 Feb 2018 01:24:00 GMT

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

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

Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/291#discussion_r166809191
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java ---
    @@ -1038,32 +1038,21 @@ public void setValue(PColumn column, byte[] byteValue) {
             @Override
             public void delete() {
                 newMutations();
    -            // we're using the Tephra column family delete marker here to prevent the
translation 
    -            // of deletes to puts by the Tephra's TransactionProcessor
    -            if (PTableImpl.this.isTransactional()) {
    -                Put put = new Put(key);
    -                if (families.isEmpty()) {
    -                    put.add(SchemaUtil.getEmptyColumnFamily(PTableImpl.this), TransactionFactory.getTransactionFactory().getTransactionContext().getFamilyDeleteMarker(),
ts,
    -                            HConstants.EMPTY_BYTE_ARRAY);
    -                } else {
    -                    for (PColumnFamily colFamily : families) {
    -                        put.add(colFamily.getName().getBytes(), TransactionFactory.getTransactionFactory().getTransactionContext().getFamilyDeleteMarker(),
ts,
    -                                HConstants.EMPTY_BYTE_ARRAY);
    -                    }
    -                }
    -                deleteRow = put;                
    --- End diff --
    
    Does the code in IndexMaintainer here need to change too (i.e. check for getFamilyDeleteMarker()),
or is it fine?
    
        private DeleteType getDeleteTypeOrNull(Collection<? extends Cell> pendingUpdates,
int nCFs) {
            int nDeleteCF = 0;
            int nDeleteVersionCF = 0;
            for (Cell kv : pendingUpdates) {
            	if (kv.getTypeByte() == KeyValue.Type.DeleteFamilyVersion.getCode()) {
                    nDeleteVersionCF++;
                }
            	else if (kv.getTypeByte() == KeyValue.Type.DeleteFamily.getCode()
            			// Since we don't include the index rows in the change set for txn tables,
we need to detect row deletes that have transformed by TransactionProcessor
            			|| (CellUtil.matchingQualifier(kv, TransactionFactory.getTransactionFactory().getTransactionContext().getFamilyDeleteMarker())
&& CellUtil.matchingValue(kv, HConstants.EMPTY_BYTE_ARRAY))) {
            	    nDeleteCF++;
            	}
            }



> Implement pure client side transactional index maintenance
> ----------------------------------------------------------
>
>                 Key: PHOENIX-4278
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4278
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: James Taylor
>            Assignee: Ohad Shacham
>            Priority: Major
>
> The index maintenance for transactions follows the same model as non transactional tables
- coprocessor based on data table updates that looks up previous row value to perform maintenance.
This is necessary for non transactional tables to ensure the rows are locked so that a consistent
view may be obtained. However, for transactional tables, the time stamp oracle ensures uniqueness
of time stamps (via transaction IDs) and the filtering handles a scan seeing the "true" last
committed value for a row. Thus, there's no hard dependency to perform this on the server
side.
> Moving the index maintenance to the client side would prevent any RS->RS RPC calls
(which have proved to be troublesome for HBase). It would require returning more data to the
client (i.e. the prior row value), but this seems like a reasonable tradeoff.



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

Mime
View raw message