Hi everyone. We have a cluster with PostgreSQL as ...
# troubleshooting
d
Hi everyone. We have a cluster with PostgreSQL as meta store and Ceph/S3 as deep storage. The Ceph bucket is used exclusively for Druid. Few days ago we noticed our Ceph quota is almost reached (2.8TB out of 3TB). But the problem was that druid web panel and prometheus exporter showed only 20% of the quota was filled (600GB out of 3TB). We checked the ceph bucket and looks like there are about 2TB of index.zip files that are out of our
dropBeforeByPeriod
(PT25D) +
druid.coordinator.kill.bufferPeriod
(PT1H). And there are no traces of them in the PostgreSQL meta store. For example there are index files for 2024-12-16:
2024-12-17 16:01   133M  s3://druid-storage/druid/segments/events/2024-12-16T00:00:00.000Z_2024-12-17T00:00:00.000Z/2024-12-17T15:43:26.113Z/5/index.zip
but the earliest segment in the meta store's druid_segments table is 2025-07-21. Note that the datasource drop retention is 25 days. We had automatic kill task from the get go and I also run manual kill tasks. Here are the kill configs:
Copy code
druid.coordinator.kill.on=true
druid.coordinator.kill.period=PT20M
druid.coordinator.kill.durationToRetain=PT1H
druid.coordinator.kill.maxSegments=1000
druid.coordinator.kill.ignoreDurationToRetain=true
druid.coordinator.kill.bufferPeriod=PT1H

druid.kill.taskStatusCheckPeriod=PT1M
druid.kill.maxRetries=3
druid.kill.taskTimeout=PT2H
druid.coordinator.kill.maxRunningTasks=20
druid.coordinator.kill.segmentsPerSecond=75
druid.coordinator.kill.taskPriority=10
I have two questions: 1. Is it safe to delete these orphaned segments as a temporary approach? We are kind of in a disaster. 2. How can I troubleshoot this issue? (edited)
I forgot: This doesn't happen for all segments. We have around 100 fully compacted segments per day and only 5-10 of them remain like this.
b
Hello Daniel - if you can locate these files in deep storage, and they're not in metadata, then it should be safe to delete them. Not sure how to troubleshoot - any idea what is the most recent example of this (over 25 days old, obviously)?
d
Thanks for your response Ben, That's a relief. The most recent example of it is this:
Copy code
2025-08-29 01:03   137M  s3://druid-storage/druid/segments/events/2025-08-18T00:00:00.000Z_2025-08-19T00:00:00.000Z/2025-08-28T23:59:25.583Z/39/index.zip
b
Do you have overlord logs from Aug 18? If so, you might grep them for that file name to look for any messages.
d
Unfortunately we do not store our logs for too long. But for current time, I see tons of logs like this:
Copy code
2025-09-17T22:36:37,256 INFO [TaskQueue-Manager] org.apache.druid.indexing.overlord.TaskLockbox - Cannot create a new taskLockPosse for request[TimeChunkLockRequest{lockType=EXCLUSIVE, groupId='coordinator-issued_kill_events_knlokfbj_2025-09-12T00:00:00.000Z_2025-09-17T00:00:00.000Z_2025-09-17T05:03:4>2025-09-17T22:36:37,256 INFO [TaskQueue-Manager] org.apache.druid.indexing.overlord.TaskLockbox - Cannot create a new taskLockPosse for request[TimeChunkLockRequest{lockType=EXCLUSIVE, groupId='coordinator-issued_kill_events_knlokfbj_2025-09-12T00:00:00.000Z_2025-09-17T00:00:00.000Z_2025-09-17T05:03:4>
Just to be sure that I didn't miss anything and you have all information, here are the coordinator dynamic configs:
Copy code
{
  "millisToWaitBeforeDeleting": 900000,
  "maxSegmentsToMove": 100,
  "replicantLifetime": 15,
  "replicationThrottleLimit": 500,
  "balancerComputeThreads": 16,
  "killDataSourceWhitelist": [],
  "killTaskSlotRatio": 0.9,
  "maxKillTaskSlots": 20000,
  "killPendingSegmentsSkipList": [],
  "maxSegmentsInNodeLoadingQueue": 500,
  "decommissioningNodes": [],
  "pauseCoordination": false,
  "replicateAfterLoadTimeout": false,
  "useRoundRobinSegmentAssignment": true,
  "smartSegmentLoading": true,
  "debugDimensions": null
}
And full coordinator configs:
Copy code
druid.coordinator.startDelay=PT30S
druid.coordinator.period=PT30S
druid.manager.segments.pollDuration=PT30S
druid.coordinator.period.indexingPeriod=PT15M

druid.coordinator.dutyGroups=["compaction"]
druid.coordinator.compaction.duties=["compactSegments"]
druid.coordinator.compaction.period=PT600S

druid.coordinator.kill.on=true
druid.coordinator.kill.period=PT20M
druid.coordinator.kill.durationToRetain=PT1H
druid.coordinator.kill.maxSegments=1000
druid.coordinator.kill.ignoreDurationToRetain=true
druid.coordinator.kill.bufferPeriod=PT1H


druid.kill.taskStatusCheckPeriod=PT1M
druid.kill.maxRetries=3
druid.kill.taskTimeout=PT2H
druid.coordinator.kill.maxRunningTasks=20
druid.coordinator.kill.segmentsPerSecond=75

druid.coordinator.kill.taskPriority=10
j
I have seen in the past where there is an obstacle on the S3 side preventing the delete of the segment files. The kill task does not operate atomically, e.g. it first deletes the metadata records from the meta DB, then deletes the S3 files. So if S3 won't allow the file delete for some reason then the kill job continues and completes, leaving the orphaned files. +1 on Ben's suggestion ... find individual segments and/or entire time intervals that are not present in the meta DB, and you can manually delete them from S3.
d
Yeah it looks like it. It seems we have to put a cronjob and do this every other week. Thanks John.