abhishekagarwal87 commented on code in PR #15141:
URL: https://github.com/apache/druid/pull/15141#discussion_r1371160349


##########
server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:
##########
@@ -2054,18 +2054,35 @@ protected DataStoreMetadataUpdateResult 
updateDataSourceMetadataWithHandle(
     }
 
     final boolean startMetadataMatchesExisting;
+    final int startMetadataGreaterThanExisting;
 
     if (oldCommitMetadataFromDb == null) {
       startMetadataMatchesExisting = startMetadata.isValidStart();
+      startMetadataGreaterThanExisting = 1;
     } else {
       // Checking against the last committed metadata.
+      // If the new start sequence number is greater than the end sequence 
number of last commit compareTo() function will return 1,
+      // 0 in all other cases. It might be because  multiple tasks are 
publishing the sequence at around same time.
+      startMetadataGreaterThanExisting = 
startMetadata.asStartMetadata().compareTo(oldCommitMetadataFromDb.asStartMetadata());

Review Comment:
   You could add a condition here to check if metadata is comparable. 



##########
server/src/main/java/org/apache/druid/indexing/overlord/DataSourceMetadata.java:
##########
@@ -36,7 +36,7 @@
 @JsonSubTypes(value = {
     @JsonSubTypes.Type(name = "object", value = ObjectMetadata.class)
 })
-public interface DataSourceMetadata
+public interface DataSourceMetadata extends Comparable<DataSourceMetadata>

Review Comment:
   This interface need not extend Comparable as discussed earlier. 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to