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

Support synchronize WAL in parallel #258

Open
tabokie opened this issue Aug 10, 2022 · 0 comments
Open

Support synchronize WAL in parallel #258

tabokie opened this issue Aug 10, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@tabokie
Copy link
Member

tabokie commented Aug 10, 2022

Write to multiple WALs concurrently to leverage hardware parallelism.

Raft Engine provides a WriteToken that maps to a WAL stream underneath. If WriteToken is not provided, it will write to the default WAL stream.

User guarantees there will be no concurrent writing to the same region using different tokens. But writes to a region are allowed to be sent to different WALs at different time.

There're two ways to establish total order between logs among muliple log streams,

(1) Raft Engine have awareness of Raft term of the log entries. Key-values use the term of latest log in the region.

(2) Raft Engine internally manages a sequence number for each region.

@tabokie tabokie added the enhancement New feature or request label Aug 10, 2022
@tabokie tabokie changed the title Support multiple WALs Support synchronize WAL in parallel Sep 2, 2022
tabokie added a commit that referenced this issue Sep 6, 2022
This is a preparing work for #258.

Changes:
- Move `fsync` to file handle instead of writer, so that we can call it concurrently in the future. In doing so, we have to remove the sync offset tracking and deprecate `bytes_per_sync` support
- Move `prepare_write` into pipe_log. Introduce a trait `ReactiveBytes` for this purpose.
- Rotate the file during write instead of doing it every write group, the timing is also delayed to the next write after exceeding limit (instead of the write that exceeds the limit).
- Differentiate two types of I/O errors: unrecoverable error from fsync, and retriable error from pwrite. Only bubble error for the latter case, panic early for unrecoverable ones.
- Also refactor the purge code, fix two cases where force-compact is not triggered

Signed-off-by: tabokie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant