beyond1920 commented on code in PR #9896:
URL: https://github.com/apache/hudi/pull/9896#discussion_r1366565797
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java:
##########
@@ -2616,10 +2617,17 @@ public Integer getWritesFileIdEncoding() {
return props.getInteger(WRITES_FILEID_ENCODING,
HoodieMetadataPayload.RECORD_INDEX_FIELD_FILEID_ENCODING_UUID);
}
- public boolean isNonBlockingConcurrencyControl() {
- return getTableType().equals(HoodieTableType.MERGE_ON_READ)
- && getWriteConcurrencyMode().supportsOptimisticConcurrencyControl()
- && isSimpleBucketIndex();
+ public boolean needResolveWriteConflict(WriteOperationType operationType) {
+ // Skip to resolve conflict for non bulk_insert operation if using
non-blocking concurrency control
+ if (getWriteConcurrencyMode().supportsOptimisticConcurrencyControl()) {
+ if (getTableType().equals(HoodieTableType.MERGE_ON_READ) &&
isSimpleBucketIndex()) {
+ return operationType == WriteOperationType.UNKNOWN || operationType ==
WriteOperationType.BULK_INSERT;
+ } else {
+ return true;
Review Comment:
> So for `UPSERT` we also needs to resolve conflicts?
No, `UPSERT` does not need resolve conflict.
> Can we detect the conflict in such scenario?
The first case: t1.commit would fail to commit caused by confliction
The first case: both t1 and t2 could commit successful.
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java:
##########
@@ -2616,10 +2617,17 @@ public Integer getWritesFileIdEncoding() {
return props.getInteger(WRITES_FILEID_ENCODING,
HoodieMetadataPayload.RECORD_INDEX_FIELD_FILEID_ENCODING_UUID);
}
- public boolean isNonBlockingConcurrencyControl() {
- return getTableType().equals(HoodieTableType.MERGE_ON_READ)
- && getWriteConcurrencyMode().supportsOptimisticConcurrencyControl()
- && isSimpleBucketIndex();
+ public boolean needResolveWriteConflict(WriteOperationType operationType) {
+ // Skip to resolve conflict for non bulk_insert operation if using
non-blocking concurrency control
+ if (getWriteConcurrencyMode().supportsOptimisticConcurrencyControl()) {
+ if (getTableType().equals(HoodieTableType.MERGE_ON_READ) &&
isSimpleBucketIndex()) {
+ return operationType == WriteOperationType.UNKNOWN || operationType ==
WriteOperationType.BULK_INSERT;
+ } else {
+ return true;
Review Comment:
> So for `UPSERT` we also needs to resolve conflicts?
No, `UPSERT` does not need resolve conflict.
> Can we detect the conflict in such scenario?
The first case: t1.commit would fail to commit caused by confliction
The first case: both t1 and t2 could commit successful.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]