db::commitlog: Do segment delete async + force replay delete go via CL

Refs #2858

Push segement files to be deleted to a pending list, and process at
intervals or flush-requests (or shutdown). Note that we do _not_
indescrimenately do deletes in non-anchored tasks, because we need
to guarantee that finshed segments are fully deleted and gone on CL
shutdown, not to be mistaken for replayables.

Also make sure we delete segments replayed via commitlog call,
so IFF we add metadata processing for CL, we can clear it out.
This commit is contained in:
Calle Wilund
2018-03-13 12:22:36 +00:00
parent eb10d32ff9
commit 2bc98aebaf
4 changed files with 62 additions and 18 deletions

View File

@@ -268,7 +268,13 @@ public:
*
* The list will be empty when called for the second time.
*/
std::vector<sstring> get_segments_to_replay();
std::vector<sstring> get_segments_to_replay() const;
/**
* Delete aforementioned segments, and possible metadata
* associated with them
*/
future<> delete_segments(std::vector<sstring>) const;
uint64_t get_total_size() const;
uint64_t get_completed_tasks() const;