abhishekagarwal87 commented on code in PR #15141:
URL: https://github.com/apache/druid/pull/15141#discussion_r1373516274
##########
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:
More like
```suggestion
if (startMetadata instanceof Comparable)
startMetadataGreaterThanExisting =
startMetadata.asStartMetadata().compareTo(oldCommitMetadataFromDb.asStartMetadata());
```
--
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]