vinishjail97 commented on code in PR #18119:
URL: https://github.com/apache/hudi/pull/18119#discussion_r2776210269
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/SimpleConcurrentFileWritesConflictResolutionStrategy.java:
##########
@@ -164,8 +164,75 @@ public Option<HoodieCommitMetadata>
resolveConflict(HoodieTable table,
return thisOperation.getCommitMetadataOption();
}
// just abort the current write if conflicts are found
- throw new HoodieWriteConflictException(new
ConcurrentModificationException("Cannot resolve conflicts for overlapping
writes between first operation = " + thisOperation
- + ", second operation = " + otherOperation));
+ throw new HoodieWriteConflictException(new
ConcurrentModificationException(buildConflictErrorMessage(thisOperation,
otherOperation)));
+ }
+
+ /**
+ * Builds a detailed error message for write conflicts based on the
operation types involved.
+ */
+ private String buildConflictErrorMessage(ConcurrentOperation thisOperation,
ConcurrentOperation otherOperation) {
+ boolean otherIsTableService =
isTableService(otherOperation.getOperationType());
+
+ String thisOpDesc = formatOperationDescription(thisOperation);
+ String otherOpDesc = formatOperationDescription(otherOperation);
+
+ // If other operation is a table service, provide specific retry guidance
+ if (otherIsTableService) {
Review Comment:
Refactored the code to be more clear.
--
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]