Class MarkEternityTombstonesAsUnused
- java.lang.Object
-
- org.apache.druid.server.coordinator.duty.MarkEternityTombstonesAsUnused
-
- All Implemented Interfaces:
CoordinatorDuty
public class MarkEternityTombstonesAsUnused extends Object implements CoordinatorDuty
Mark eternity tombstones not overshadowed by currently served segments as unused. A candidate segment must fit all the criteria:- It is a tombstone that starts at
DateTimes.MINor ends atDateTimes.MAX- It does not overlap with any overshadowed segment in the datasource
- It has has 0 core partitions i.e.,
TombstoneShardSpec.getNumCorePartitions()== 0Only infinite-interval tombstones are considered as candidate segments in this duty because they don't honor the preferred segment granularity specified at ingest time to cover an underlying segment with
Granularities.ALLas it can generate too many segments per time chunk and cause an OOM. The infinite-interval tombstones make it hard to append data on the end of a data set that started out with anGranularities.ALLeternity and then moved to actual time grains, so the compromise is that the coordinator will remove these segments as long as it doesn't overlap any other segment.The overlapping condition is necessary as a candidate segment can overlap with an overshadowed segment, and the latter needs to be marked as unused first by
MarkOvershadowedSegmentsAsUnusedduty before the tombstone candidate can be marked as unused byMarkEternityTombstonesAsUnusedduty.Only tombstones with 0 core partitions is considered as candidate segments. Earlier generation tombstones with 1 core partition (i.e.,
TombstoneShardSpec.getNumCorePartitions()== 1) are ignored by this duty because it can potentially cause data loss in a concurrent append and replace scenario and needs to be manually cleaned up. See this for details.
-
-
Constructor Summary
Constructors Constructor Description MarkEternityTombstonesAsUnused(SegmentDeleteHandler deleteHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DruidCoordinatorRuntimeParamsrun(DruidCoordinatorRuntimeParams params)Implementations of this method run various activities performed by the coordinator.
-
-
-
Constructor Detail
-
MarkEternityTombstonesAsUnused
public MarkEternityTombstonesAsUnused(SegmentDeleteHandler deleteHandler)
-
-
Method Detail
-
run
public DruidCoordinatorRuntimeParams run(DruidCoordinatorRuntimeParams params)
Description copied from interface:CoordinatorDutyImplementations of this method run various activities performed by the coordinator. Input params can be used and modified. The returned DruidCoordinatorRuntimeParams is passed to the next duty.- Specified by:
runin interfaceCoordinatorDuty- Returns:
- same as input or a modified value to be used by next duty. Null return
values will prevent subsequent CoordinatorDuty objects (see the order in the lists passed into the constructor of
DruidCoordinator.DutiesRunnable) from running until the next cycle.
-
-