Restoring older segments


I reindexed some data and screwed up some parts. I still have the old segments in the deep storage. Is is possible to remove the new segments and start using the older ones again?




Yes, if you are adventurous enough :slight_smile:

You can try out to reconstruct segments table in db from the stored segment files on deep storage. It will formally be available in druid-0.9.0 .

– Himanshu

Hi Indrek,

you can also do this by -

  1. delete the entries for newer segments from metadata storage

  2. set the used flag for older segments as true in segments table. the coordinator should now ask the historicals to drop faulty segments and replace them with the older ones.

Note that this will leave the faulty segment files in deep storage. you will need to manually delete them if required.

Thank you Himanshu and Nishant.

I tried Nishant solution. Worked very well. It was a bit of a pain to analyse which segments should be enabled and which deleted, but worked out very well in the end.