AR
05/10/2024, 3:35 PMdruid.coordinator.kill.on config as we don't want to remove historical unused segments. We only want to remove unused segments which have been overwritten with a newer version. Is there a way to do this programmatically or through a config setting?
Does having a large number of unused segments details in the metadata DB lead to any performance issues?
To resolve the current situation, we are planning on manually executing a "kill task" on the table with the largest number of unused segments. But we wanted to see if there was a better option to purge the previous segments whenever we overwrite the data for a time interval.
Thanks,
AR.Gian Merlino
05/10/2024, 3:37 PMREPLACE INTO <table> OVERWRITE WHERE … to replace data for a specific time chunkAR
05/10/2024, 4:02 PMREPLACE INTO .. OVERWRITE.. removes existing versions?
Is there any recommendation/guideline on the number of segments in the metadata DB to avoid performance issues?
Like I said, we don't want to lose historical unused segments but we are wary of them impacting performance of the metadata queries.
Is there a way to remove segment metadata from metadata store but retain the files in the deep storage and then load them back when needed?
Thanks,
AR.Gian Merlino
05/10/2024, 4:07 PMIs there any recommendation/guideline on the number of segments in the metadata DB to avoid performance issues?in my experience after millions of segments is when you start to see slower metadata queries; things will still work but it may lengthen somewhat balancing and data loading times
Gian Merlino
05/10/2024, 4:08 PMdoes MSQ ingestion with REPLACE INTO .. OVERWRITE.. removes existing versions?it marks the existing versions unused; the metadata records are not actually removed, but they would become eligible for removal if you have autokill or use a kill task
Gian Merlino
05/10/2024, 4:08 PMGian Merlino
05/10/2024, 4:09 PMIs there a way to remove segment metadata from metadata store but retain the files in the deep storage and then load them back when needed?i don't think there's an official API for this; generally we want anything in deep storage to have an associated metadata record
AR
05/10/2024, 4:17 PMit marks the existing versions unused; the metadata records are not actually removed, but they would become eligible for removal if you have autokill or use a kill taskThat's what I understood too. We don't want to issue a kill task immediately as it would affect other ingestion tasks if the time interval is large. Keeping track of everything that was overwritten is also not trivial. Is there no way other than to issue a kill task after overwriting the segments for an interval? Thanks, AR.
Abhishek Balaji Radhakrishnan
05/10/2024, 6:45 PMIs there no way other than to issue a kill task after overwriting the segments for an interval?Currently I don’t think so other than fiddling with the segment metadata records manually which I wouldn’t recommend. IMO, it’d be better to manually submit kill tasks or enable auto-kill which has sufficient guard rails. Also, once Druid 30 is out, if you have many such versions of replaced data lying around, you may consider running kill task to purge just the older X versions (which should automatically happen implicitly based on the buffer period if auto-kill is enabled)
John Kowtko
05/11/2024, 12:45 PMJohn Kowtko
05/11/2024, 12:53 PMdruid.coordinator.kill.on config as we don't want to remove historical unused segments. We only want to remove unused segments which have been overwritten with a newer version. Is there a way to do this programmatically or through a config setting?
I understand your issue here, as Druid doesn't distinguish between segments that were dropped due to retention vs reindex/compaction ... they are both simply marked as "unused".
One thing you can do in the newer releases is to put the older segments that you don't want to lose into cold tier ... they are still marked as used so the kill jobs won't touch them, but they are not loaded on historicals so you don't have the disk space usage. Native queries don't see cold tier data, but MSQ does so you can still access that data when needed without changing your retention rules.
https://druid.apache.org/docs/latest/querying/query-deep-storage#keep-segments-in-deep-storage-onlyAR
05/14/2024, 4:30 AMJohn Kowtko
05/14/2024, 4:56 AMI am assuming that such deep storage only segments will not be removed by the auto kill tasks. Is this correct?Correct. Kill tasks will only remove segments where druid_segments.used=0 ... these deep storage segments will have used=1, just will not be assigned to any Historicals.