FrankChen021 commented on code in PR #20150:
URL: https://github.com/apache/druid/pull/20150#discussion_r3862686242
##########
server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java:
##########
@@ -445,6 +501,12 @@ public void adjustReservation(CacheEntryIdentifier id,
long newSize)
final long holdDelta = delta * activeHolds;
currHoldBytes.updateAndGet(v -> Math.max(0L, v - holdDelta));
}
+ // Same correction for internal holds
+ final long activeInternalHolds = weak.internalHolds.get();
Review Comment:
[P2] Internal hold bytes race with reservation resize
adjustReservation changes the entry size before reading internalHolds, while
ReservationHold.close() updates internalHolds and subtracts entry.getSize()
without the location lock. If a hold closes after resizeReservation but before
this read, release subtracts the new size from the old contribution and this
correction is skipped, leaving internalHoldBytes nonzero even though
internalHoldCount is zero. Synchronize resize and hold accounting or use a
consistent per-hold size snapshot, and add a concurrent resize/release test.
--
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]