kfaraz commented on code in PR #14616:
URL: https://github.com/apache/druid/pull/14616#discussion_r1268429411
##########
server/src/main/java/org/apache/druid/server/coordination/SegmentLoadDropHandler.java:
##########
@@ -789,15 +789,20 @@ private CustomSettableFuture(
public void resolve()
{
- synchronized (statusRefs) {
+ synchronized (requestStatusesLock) {
if (isDone()) {
return;
}
- List<DataSegmentChangeRequestAndStatus> result = new
ArrayList<>(statusRefs.size());
- statusRefs.forEach(
- (request, statusRef) -> result.add(new
DataSegmentChangeRequestAndStatus(request, statusRef.get()))
- );
+ final List<DataSegmentChangeRequestAndStatus> result = new
ArrayList<>(statusRefs.size());
+ statusRefs.forEach((request, statusRef) -> {
+ // Remove complete statuses from the cache
Review Comment:
This code could probably do with some cleanup and doing what had been
originally suggested [in this
comment](https://github.com/apache/druid/pull/11717#discussion_r723833447) i.e.
maintaining the cache (or really just a concurrent map) at the `DataSegment`
level itself rather than `DataSegmentChangeRequest`.
But I wanted to keep the footprint of this PR low so that we could include
it in Druid 27 release. We can take up a more holistic overhaul later. Let me
know what you think.
--
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]