Collapse create+delete journal entry pairs if they're already flushed

Old journal replay mechanism could lead to a double allocation of the same
block and a "Fatal error: tried to overwrite non-zero metadata entry"
This commit is contained in:
Vitaliy Filippov
2021-04-03 00:53:28 +03:00
parent 843b7052d2
commit f4769ba7c7
2 changed files with 43 additions and 29 deletions
+1
View File
@@ -48,6 +48,7 @@ class blockstore_init_journal
std::function<void(ring_data_t*)> simple_callback;
int handle_journal_part(void *buf, uint64_t done_pos, uint64_t len);
void handle_event(ring_data_t *data);
void erase_dirty_object(blockstore_dirty_db_t::iterator dirty_it);
public:
blockstore_init_journal(blockstore_impl_t* bs);
int loop();