Copilot commented on code in PR #20291:
URL: https://github.com/apache/druid/pull/20291#discussion_r3954147016
##########
server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:
##########
@@ -606,6 +606,7 @@ public void removeSegment(final DataSegment segment)
removeSegmentAction(segment.getId());
if (segmentsMap.isEmpty()) {
tables.remove(segment.getDataSource());
+ removeDataSourceAction(segment.getDataSource());
log.info("dataSource [%s] no longer exists, all metadata
removed.", segment.getDataSource());
return null;
Review Comment:
When the last segment is removed, the datasource may still be present in
dataSourcesNeedingRebuild (set by earlier segment removals). If a refresh cycle
later processes that stale rebuild entry, BrokerSegmentMetadataCache.refresh
can emit Metric.DATASOURCE_REMOVED again when it finds no row signature
(sql/.../BrokerSegmentMetadataCache.java:250-273), leading to duplicate removal
metrics and unnecessary rebuild work. Consider clearing the datasource from
dataSourcesNeedingRebuild at the point where the table is removed.
--
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]