File size is updated correctly according to 

> fdatasync() is similar to fsync(), but does not flush modified metadata unless that metadata is needed in order to allow a subsequent data retrieval to be correctly handled.  For example, changes to  st_atime  or  st_mtime  (respec‐
       tively,  time  of  last  access  and  time  of last modification; see inode(7)) do not require flushing because they are not necessary for a subsequent data read to be handled correctly.  On the other hand, a change to the file size
       (st_size, as made by say ftruncate(2)), would require a metadata flush.

And we don't care about modification times.
Should work alright.
}
                }
                const char * partition_data = current_memory_buffer_partition.getData();
                bool flush_to_file_result = file_buffer.writeBuffer(partition_data, configuration.write_buffer_blocks_size);
                if (flush_to_file_result)
                {
                    
                    PaddedPODArray<KeyType> keys_to_update;
                    current_memory_buffer_partition.readKeys(keys_to_update);
                    absl::flat_hash_set<KeyType, DefaultHash<KeyType>> updated_keys;
                    Int64 keys_to_update_size = static_cast<Int64>(keys_to_update.size());
                    
                    
                    for (Int64 i = keys_to_update_size - 1; i >= 0; --i)
                    {
                        auto key_to_update = keys_to_update[i];
                        auto * it = index.find(key_to_update);
                        
                        if (!it || it->getMapped().state != Cell::in_memory)
                            continue;
                        
                        if (updated_keys.contains(it->getKey()))
                            continue;
                        updated_keys.insert(key_to_update);
                        Cell & cell_to_update = it->getMapped();
                        cell_to_update.state = Cell::on_disk;
                        cell_to_update.index.block_index += block_index_in_file_before_write;
                    }
                    
                    current_memory_buffer_partition.reset();