You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/08/20 02:18:00 UTC

[jira] [Commented] (HUDI-2338) Hoodie data update reject clustering using SparkRejectClusteringStrategy

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

ASF GitHub Bot commented on HUDI-2338:
--------------------------------------

zhangyue19921010 opened a new pull request #3509:
URL: https://github.com/apache/hudi/pull/3509


   https://issues.apache.org/jira/browse/HUDI-2338
   ## What is the purpose of the pull request
   Hudi now support async clustering in HoodieDeltaStreamer and StructStreaming and support offline clustering through HoodieClusteringJob.
   
   Data update conflicts with clustering is one of the more common scenarios. And now hudi can only reject data using SparkRejectUpdateStrategy and failed the ingestion.
   
   Sometimes, we think that clustering is an optimization service that runs in the background, and data ingestion has a higher priority than it.
   
   So this tickets add a new UpdateStrategy named `SparkRejectClusteringStrategy`.
   
   This SparkRejectClusteringStrategy will reject and failing clustering job and let data update success. 
   
   ## Brief change log
   When update happened after clustering plan created and before clustering executed.When update happened after clustering plan created and before clustering executed.
   
        1. There will be a request replace commit.  
   
        2. SparkRejectClusteringStrategy will create a clustering reject file under .tmp dir named xxx.replacement.request.reject.
   
        3. Before perform clustering job, hudi can check this reject file using SparkRejectClusteringStrategy.validateClustering() function.
   
             3.1 if reject file is exists then abort this clustering plan and remove reject file.
   
   When update happened after clustering executed but not finished.
   
        1. There will be a inflight replace commit.
   
        2. SparkRejectClusteringStrategy will create a clustering reject file under .tmp dir named xxx.replacement.inflight.reject.
   
        3. Before clustering job finished and committed, hudi can check this reject file using SparkRejectClusteringStrategy.validateClustering() function.
   
             3.1 if reject file is exists then failed this clustering execution and remove reject file.
   
   
   This PR is already tested on our env and added UTs which are necessary.
   As you can see, the update action in 20210820093028.commit can success and create a clustering reject file under .hoodie/.tmp dir
   Also the clustering job in 20210820092927.replacecommit.requested if failed because of SparkRejectClusteringStrategy
   <img width="452" alt="屏幕快照 2021-08-20 上午10 05 14" src="https://user-images.githubusercontent.com/69956021/130168152-824d4eb9-0704-40ca-9d85-6d0dca7913ca.png">
   <img width="1419" alt="屏幕快照 2021-08-20 上午10 08 49" src="https://user-images.githubusercontent.com/69956021/130168162-407417c5-48cb-42ed-8dba-8bab6d89cabe.png">
   
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This pull request is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   (or)
   
   This change added tests and can be verified as follows:
   
   *(example:)*
   
     - *Added integration tests for end-to-end.*
     - *Added HoodieClientWriteTest to verify the change.*
     - *Manually verified the change by running a job locally.*
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Hoodie data update reject clustering using SparkRejectClusteringStrategy
> ------------------------------------------------------------------------
>
>                 Key: HUDI-2338
>                 URL: https://issues.apache.org/jira/browse/HUDI-2338
>             Project: Apache Hudi
>          Issue Type: Task
>            Reporter: Yue Zhang
>            Priority: Major
>
> Hudi now support async clustering in HoodieDeltaStreamer and StructStreaming and support offline clustering through HoodieClusteringJob.
> Data update conflicts with clustering is one of the more common scenarios. And now hudi can only reject data using SparkRejectUpdateStrategy and failed the ingestion.
> Sometimes, we think that clustering is an optimization service that runs in the background, and data ingestion has a higher priority than it.
> So this tickets add a new UpdateStrategy named SparkRejectClusteringStrategy.
> This SparkRejectClusteringStrategy will reject and failing clustering job and let data update success. 
> When update happened after clustering plan created and before clustering executed.When update happened after clustering plan created and before clustering executed.
>      1. There will be a request replace commit.  
>      2. SparkRejectClusteringStrategy will create a clustering reject file under .tmp dir named xxx.replacement.request.reject.
>      3. Before perform clustering job, hudi can check this reject file using SparkRejectClusteringStrategy.validateClustering() function.
>           3.1 if reject file is exists then abort this clustering plan and remove reject file.
> When update happened after clustering executed but not finished.
>      1. There will be a inflight replace commit.
>      2. SparkRejectClusteringStrategy will create a clustering reject file under .tmp dir named xxx.replacement.inflight.reject.
>      3. Before clustering job finished and committed, hudi can check this reject file using SparkRejectClusteringStrategy.validateClustering() function.
>           3.1 if reject file is exists then failed this clustering execution and remove reject file.



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