mirror of https://github.com/apache/druid.git
Fix TestServerInventoryView behavioral discrepancy. (#11932)
Unlike a real one, TestServerInventoryView would call segmentRemoved any time _any_ segment was removed. It should only be called when _all_ segments have been removed.
This commit is contained in:
parent
7f0bede878
commit
d76e646700
|
@ -187,8 +187,11 @@ public class TestServerInventoryView implements TimelineServerView
|
||||||
timelineCallbackExecs.forEach(
|
timelineCallbackExecs.forEach(
|
||||||
execAndCallback -> execAndCallback.lhs.execute(() -> {
|
execAndCallback -> execAndCallback.lhs.execute(() -> {
|
||||||
execAndCallback.rhs.serverSegmentRemoved(whichServer, segment);
|
execAndCallback.rhs.serverSegmentRemoved(whichServer, segment);
|
||||||
// assume that all replicas have been removed and fire this one too
|
|
||||||
|
// Fire segmentRemoved if all replicas have been removed.
|
||||||
|
if (!segments.contains(segment) && !brokerSegments.contains(segment) && !realtimeSegments.contains(segment)) {
|
||||||
execAndCallback.rhs.segmentRemoved(segment);
|
execAndCallback.rhs.segmentRemoved(segment);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue