Hello guys, having had our Druid cluster up and ru...
# troubleshooting
r
Hello guys, having had our Druid cluster up and running without downtime for years. It's long overdue an upgrade and reconfiguration in terms of data storage/query efficiency however. As it stands there are just over 2.3B rows of event data, and I must say it's been handling the interactive analytics demands exceptionally well. But I would like to improve the storage/querying efficiency, by segmenting using secondary partitioning on our tenant ID/account_number column. We have data flowing in via a Kinesis Data Stream, and I remember in older versions of Druid (0.16), the approach would be to run an index_parallel task regularly with secondary partitioning. With Druid 34.0.0 however, I believe this can be done using auto-compaction? I tried setting up hashed partitioning on the account_number column, however it seems to be skipping every segment for some reason Just for debugging I set the skipOffsetFromLatest to 10M, and even with new segments being written out every 1000 rows, it still seems to be skipping them. The logs don't seem to indicate why exactly the segments aren't compactible: ./coordinator-overlord.log65272025-09-30T130114,507 WARN [Coordinator-Exec-IndexingServiceDuties-0] org.apache.druid.server.compaction.DataSourceCompactibleSegmentIterator - Skipping compaction for datasource[r3-event-stream] as it has no compactible segments. curl -s http://localhost:8081/druid/coordinator/v1/compaction/status?dataSource=r3-event-stream | jq . { "latestStatus": [ { "dataSource": "r3-event-stream", "scheduleStatus": "RUNNING", "message": null, "bytesAwaitingCompaction": 0, "bytesCompacted": 0, "bytesSkipped": 5587645, "segmentCountAwaitingCompaction": 0, "segmentCountCompacted": 0, "segmentCountSkipped": 46, "intervalCountAwaitingCompaction": 0, "intervalCountCompacted": 0, "intervalCountSkipped": 1 } ] } Hoping it's something simple I'm missing, thanks!
k
Hi Richard - for clarity, does:
I set the skipOffsetFromLatest to 10M
mean you set it to
PT10M
?
r
Oops my bad, that's right yes Only for testing the compaction though
k
Can you share the autocompaction spec? Your favourite AI can remove any
null
settings
r
Sure no problem, here you go { "type": "inline", "dataSource": "r3-event-stream", "taskPriority": 25, "inputSegmentSizeBytes": 100000000000000, "skipOffsetFromLatest": "P10M", "tuningConfig": { "partitionsSpec": { "type": "hashed", "numShards": 20, "partitionDimensions": [ "account_number" ], "partitionFunction": "murmur3_32_abs" }, "type": "index_parallel", "forceGuaranteedRollup": true }, "granularitySpec": { "segmentGranularity": "DAY", "queryGranularity": { "type": "none" }, "rollup": true }, "ioConfig": { "dropExisting": false } } I was wondering if the forceGuaranteedRollup could be causing this, but the UI overwrites that back to true upon saving Maybe I'll give the API a go
k
P10M
is 10 months
r
slams head on desk
k
lol - it's got me before.... bit of a funny one
r
Hahaha maybe another coffee is needed, thanks Kyle!
👍 1
So far so good, the no of skips doesn't seem to be incrementing curl -s http://localhost:8081/druid/coordinator/v1/compaction/status?dataSource=r3-event-stream | jq . { "latestStatus": [ { "dataSource": "r3-event-stream", "scheduleStatus": "RUNNING", "message": null, "bytesAwaitingCompaction": 0, "bytesCompacted": 0, "bytesSkipped": 10633302, "segmentCountAwaitingCompaction": 0, "segmentCountCompacted": 0, "segmentCountSkipped": 87, "intervalCountAwaitingCompaction": 0, "intervalCountCompacted": 0, "intervalCountSkipped": 1 } ] } Is there a way to see in the query plan which partitions are being used?
Thinking this through I don't think auto-compaction will be the right fit - it doesn't support single_dim partitioning, and ideally we'd like to have account_number partitioning in combination with daily rollups Maybe a daily reindex task via the API is still the way to go
k
it does support single dim - choose
range
and only specify 1 dimension
r
Hey Kyle I was able to get the compaction configuration working, but I noticed all segments are packed into partition 0. Looking at the config there's a targetRowsPerSegment of 5 million, and only a few of the account_numbers exceed even 1 million events/rows on a given day. So that has me questioning if partitioning is even necessary with this small volume of data? I could set the targetRowsPerSegment to 1 million, but surely that would just introduce more query complexity if we're barely hitting that threshold
Maybe I leave it at 5m, and should any of our data volumes increase for a particular client, the compaction will configured ready
👍 1