omnipaxos
omnipaxos copied to clipboard
Implement better trim functionality
The current trim() of PersistentStorage is implemented as a temporary solution. The only function that can remove elements from commitlog, truncate(offset)
does not remove the first element as it only deletes entries after offset
. This is still an open issue at Commitlog
Trim() works by getting the entries that should remain after trimming and then removing the commitlog through std::fs
, It then recreates the commitlog and appends the entries. This operation is costly in performance and there could be better ways to trim the commitlog.
Mentioned by @haraldng in https://github.com/haraldng/omnipaxos/pull/48#discussion_r929044356_