Fsync data before writing metadata

This commit is contained in:
Vitaliy Filippov
2019-12-03 00:20:13 +03:00
parent a165909745
commit aa3b252327
3 changed files with 49 additions and 43 deletions
+3 -2
View File
@@ -14,6 +14,7 @@ struct meta_sector_t
struct flusher_sync_t
{
bool fsync_meta;
int ready_count;
int state;
};
@@ -50,7 +51,7 @@ class journal_flusher_co
friend class journal_flusher_t;
bool modify_meta_read(uint64_t meta_loc, flusher_meta_write_t &wr, int wait_base);
void update_clean_db();
bool fsync_batch();
bool fsync_batch(bool fsync_meta, int wait_base);
public:
journal_flusher_co();
bool loop();
@@ -68,7 +69,7 @@ class journal_flusher_t
int journal_trim_counter, journal_trim_interval;
void* journal_superblock;
int active_flushers, active_until_sync;
int active_flushers;
std::list<flusher_sync_t> syncs;
std::map<object_id, uint64_t> sync_to_repeat;