capistrant commented on code in PR #18844:
URL: https://github.com/apache/druid/pull/18844#discussion_r2698965785
##########
server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:
##########
@@ -2685,6 +2713,43 @@ public Map<String, Set<String>>
retrieveUpgradedToSegmentIds(
return upgradedToSegmentIds;
}
+ /**
+ * Marks indexing state fingerprints as active (non-pending) for
successfully published segments.
+ * <p>
+ * Extracts unique indexing state fingerprints from the given segments and
marks them as active
+ * in the inexing state storage. This is called after successful segment
publishing to indicate
+ * that the indexing state is no longer pending and can be retained with the
regular grace period.
+ *
+ * @param segments The segments that were successfully published
+ */
+ private void markIndexingStateFingerprintsAsActive(Set<DataSegment> segments)
+ {
+ if (segments == null || segments.isEmpty()) {
+ return;
+ }
+
+ // Collect unique non-null indexing state fingerprints
+ final Set<String> fingerprints = segments.stream()
+
.map(DataSegment::getIndexingStateFingerprint)
+ .filter(fp -> fp != null &&
!fp.isEmpty())
+ .collect(Collectors.toSet());
+
+ // Mark each fingerprint as active
+ for (String fingerprint : fingerprints) {
+ try {
+ int rowsUpdated =
indexingStateStorage.markIndexingStatesAsActive(fingerprint);
Review Comment:
ah yes, good idea
--
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]