Avoid multiple inflight overwrites to meta blocks

https://github.com/vitalif/vitastor/pull/83

By https://github.com/Flynn049

By submitting this pull request, I accept Vitastor CLA
This commit is contained in:
flynn.yang
2025-08-23 17:45:03 +03:00
committed by Vitaliy Filippov
parent 3a261ac3fc
commit 5c5c8825dc
3 changed files with 80 additions and 36 deletions
+2
View File
@@ -76,6 +76,7 @@ class journal_flusher_co
uint8_t *new_clean_bitmap;
uint64_t new_trim_pos;
std::unordered_set<uint64_t>::iterator inflight_meta_sector;
friend class journal_flusher_t;
void scan_dirty();
@@ -120,6 +121,7 @@ class journal_flusher_t
std::map<uint64_t, meta_sector_t> meta_sectors;
std::deque<object_id> flush_queue;
std::map<object_id, uint64_t> flush_versions; // FIXME: consider unordered_map?
std::unordered_set<uint64_t> inflight_meta_sectors;
bool try_find_older(std::map<obj_ver_id, dirty_entry>::iterator & dirty_end, obj_ver_id & cur);
bool try_find_other(std::map<obj_ver_id, dirty_entry>::iterator & dirty_end, obj_ver_id & cur);