Describe the solution you'd like
Lucene segments are immutable files. Once segments are created, they can be deleted due to various flows, one of the flows could be segment merge. These merged away segments are deleted from local filesystem. To keep remote segment store in-sync with the local filesystem, we need to delete these segments from remote segment store as well.
The delete flow need not be in sync and can be done in periodic manner. But to keep the data integrity, we need to mark the files as deleted.
Describe the solution you'd like
Lucene segments are immutable files. Once segments are created, they can be deleted due to various flows, one of the flows could be segment merge. These merged away segments are deleted from local filesystem. To keep remote segment store in-sync with the local filesystem, we need to delete these segments from remote segment store as well.
The delete flow need not be in sync and can be done in periodic manner. But to keep the data integrity, we need to mark the files as deleted.