sherman/blobkeeper

Compaction: restore files

Opened this issue · 2 comments

  1. Support of restore file operation requires changes in the compaction. When a partition is in deleted state a restore file operation must be prohibited.
  2. Another race is possible between a call of CompactionWorker.moveLiveFiles() method and CompactionWorker.setDeletedState(). If a file were restored after the query of live files, it will not be moved and will be deleted permanently. This race can be removed by running copy of live files state before a deleted partition will be removed permanently, in DeletedPartitionFinalizer worker.

2 is impossible, because we have gc grace time. This time used for checking of expiration. When a deleted file is expired, it will never be restored. So, a state will not change.

So, a file can be restored only if it's not expired.