clintropolis commented on code in PR #20267:
URL: https://github.com/apache/druid/pull/20267#discussion_r3983629227
##########
server/src/main/java/org/apache/druid/server/coordination/SegmentLoadDropHandler.java:
##########
@@ -161,12 +161,24 @@ public void addSegment(
currentDropLatch.cancelOrAwait();
}
+ // A load request for a segment this server already serves is a reload,
not a new load. The failure cleanup
+ // below exists to discard the half-materialized state a failed *new*
load leaves behind, and running it for a
+ // reload would instead unannounce and drop a replica that is still
serving.
+ final boolean isReload = segmentManager.isSegmentLoaded(segment);
final DataSegment loaded;
try {
loaded = segmentManager.loadSegment(segment);
}
catch (Exception e) {
- removeSegment(segment, DataSegmentChangeCallback.NOOP, false);
+ if (isReload) {
Review Comment:
this works nicer now i think, switched to reserve and acquire the new
bundles first before releasing stale holds so that a failure only has to
release the difference, making rollback easy (at the cost of needing to reserve
a slight bit of extra space bounded by total segment size before it can drop
the old stuff)
--
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]