You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/07/19 01:52:21 UTC

[GitHub] [hudi] nbalajee commented on a diff in pull request #6003: [HUDI-1575][RFC-56] Early Conflict Detection For Multi-writer

nbalajee commented on code in PR #6003:
URL: https://github.com/apache/hudi/pull/6003#discussion_r923990033


##########
rfc/rfc-56/rfc-56.md:
##########
@@ -0,0 +1,235 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+# RFC-56: Early Conflict Detection For Multi-writer
+
+
+## Proposers
+
+- @zhangyue19921010
+
+## Approvers
+ - @yihua
+
+## Status
+
+JIRA: https://issues.apache.org/jira/browse/HUDI-1575
+
+
+## Abstract
+
+At present, Hudi implements an OCC (Optimistic Concurrency Control) based on timeline to ensure data
+consistency, integrity and correctness between multi-writers. However, the related conflict detection is performed
+before commit metadata and after the data writing is completed. If any conflict is detected, it leads to a waste
+of cluster resources because computing and writing were finished already. To solve this problem, this RFC proposes an
+early conflict detection mechanism based on the existing Hudi marker mechanism. There are some subtle differences in
+early conflict detection work flow between different types of marker maintainers.
+
+
+For direct markers, hoodie lists necessary marker files directly and do conflict checking before the writers creating
+markers and before starting to write corresponding data file. For the timeline-server based markers, hoodie just gets the
+the result of marker conflict checking before the writers creating markers and before starting to write corresponding
+data files. The conflicts are asynchronously and periodically checked so that the writing conflicts can be detected as
+early as possible. Both writers may still write the data files of the same file slice, until the conflict is detected
+in the next round of checking.
+
+What's more? Hoodie can stop writing earlier because of early conflict detection and release the resources to cluster,

Review Comment:
   What are the assumptions about the workload (batch of records being ingested), when the early conflict detection strategy is employed on two are more jobs?   In other words, if two jobs A and B concurrently working on the hudi dataset, are they expected to perform "upsert/update" operations only?
   
   Early conflict detection may not be able to catch conflicts in some scenarios:
   a) Both jobs A and B are performing an "insert" operation (seeing the record for the first time) and same record key is present on both batches.   A might chose fileId F1 and B might choose fileid F2 and no conflict will be flagged.  (If all are inserts, with no dupes, there is no need for conflict resolution).
   b) Job A received an insert for a record R1 and Job B received an update for record R1.  Both A and B might map R1 to different fileIds and conflict won't be detected.
   c) If both jobs A and B are not "ingestion" jobs (say A is ingesting to partition P1, B is clustering on partition P1), then early conflict detection strategy will work.



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