Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition with WAL tracking and FlushWAL(true /* sync */) #10185

Closed
wants to merge 14 commits into from
Prev Previous commit
add comment
  • Loading branch information
ajkr committed Jun 17, 2022
commit 4c6cd313aca1ef986aba136c09b4bd976139c3ff
4 changes: 4 additions & 0 deletions file/writable_file_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ class WritableFileWriter {
return filesize_.load(std::memory_order_acquire);
}

// Returns the size of data flushed to the underlying `FSWritableFile`.
// Expected to match `writable_file()->GetFileSize()`.
// The return value can serve as a lower-bound for the amount of data synced
// by a future call to `SyncWithoutFlush()`.
uint64_t GetFlushedSize() const {
return flushed_size_.load(std::memory_order_acquire);
}
Expand Down