This message was deleted.
# general
s
This message was deleted.
s
Yes. Compaction will create a new set of segment files that replace existing segments. While it builds the new set, the old set are available for query.
v
But just to be clear: compaction happens in the background and is totally "invisible" from the query side (other than it usually improves performance). Very notably it does not change the results of any query (if it does it would be a big issue). You need to make sure that your data model makes sense without thinking about compaction
specifically rollup is not "deduplication" of data in general, it is just a group by applied on your data with duplicates and all. It would only "deduplicate" your data if you had (1) everything as a dimension, (2) no metrics and (3) you considered data to be duplicate if a single row is equal in all values to another row.
is that the case for you (1, 2, and 3?)
c
Copy code
you considered data to be duplicate if a single row is equal in all values to another row.
it is precisely this
v
ok, what about 1 and 2?
c
those are true as well
to expand on use case a bit, we have different requirements for the first 3 months data, then the next 3, then the next 3
first 3 months will be "raw" (query granularity none), then the next 3 we will aggregate (query granularity day). so for the first three months it is ok to deduplicate as if there are no aggregations
h
One question: When the auto-compaction is enabled for a datasource, will the original segments (without compaction) be kept intact forever? From the above discussion I assume, no. If so, when will the old segments be discarded?
r
if you mean for the original segment, in the object storage, yes, it's kept until the 'kill task' is issued
and by default, druid do not issue this kill task for the perid that contains used segments I still need to test if issuing a manual kill will remove or not the used files, it should not remove, but the storage is so cheap that I didn't had time to setup another cluster to test this yet
h
it's kept until the 'kill task' is issued
Yes, that seems to be true. But the dilemma that I've with Kill Task is - how to differentiate between 1. the segments marked as unused after compaction 2. those segments that are marked as unused(dropped) by a Data Retention Rule ? I do not want to delete the segments marked as unused because of Data Retention Rule.
but the storage is so cheap
Yes 🙂 But.. the data generated these days is also humongous!
r
yeah, you kinda need to run the kill before the retention rule go in
but I was a little disappointed as well when I discovered that I had all segments on the s3
âś… 1
s
Renato, could you expand on this? Did the kill job fail to remove the unused segments from S3?
r
Hello, @Sergio Ferragut, I thought that the kill task was only necessary to remove older data after the retention period, as I don't want to remove any data, I never ran any kill task, but I was sure that the compaction jobs would remove the older versions automatically (as well failed tasks that leave unfinished segments in the s3, eg: when a mm fails with OOM) I think Clinton had the same impression that this cleanup maintenance would be included by default, and not affect unused segments not loaded because of the retention period
i have not ran the kill task yet to test, even inside the retention period because if this delete the used segments the headache will be greater than the cost of having the data duplicated, but I need to address this at some point
s
I see. So perhaps an improvement would be to separate kill for cleanup vs kill for “dropped” segments data on retention.
h
@Sergio Ferragut: The assumption that I had when I ran compaction task was that, the older smaller segments will be removed. But Druid keeps both segments. with Kill Task - how to differentiate between 1. the segments marked as unused after compaction 2. those segments that are marked as unused(dropped) by a Data Retention Rule ? Do not want to delete the segments marked as unused because of Data Retention Rule.
Described here with a lot of details - https://github.com/apache/druid/issues/9755
r
for who was not aware of what "30W" means, according to chatGPT, 30W means:
The term "30W" is a notation used in China to represent 300,000 units. The W stands for "wan", which is used in the Chinese language to denote ten thousand. Therefore, "30W" stands for 30 * 10,000, which equals 300,000. So, in your context, there are more than 300,000 segment records in metadata storage.
s
Thanks @Hareesh Joshi for the issue and @Renato Santos for the 30W explanation (🙂 I was thinking it was an upside M). There is ongoing work in the Apache Druid project to figure out cold query capability, this is the idea of having used segments that are not cached in historicals and live in deep storage only. I think this will dovetail nicely to distinguish between cleanup and retention based segments, so that cleanup can occur regularly without removing data that you don't want to lose but also don't want to cache.
âś… 1