-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: Add support for asynchronous flushing in DiskManager::WriteLog() && improve overall structure of DiskManager #580
base: master
Are you sure you want to change the base?
Conversation
…etter concurrency support
…nt potential memory problems
Also, I think the asynchronous version of the four functions |
I think it's good to throw a warning before an exit. |
I revisited the original code design and found it confusing for logging operations, so I redesigned some of the
If the above changes look good, I'll write test cases in |
This part may also be associated with |
And according to Discussion #516, I agree with the use of |
Thanks for the PR but we are not writing any WALs currently in the system. The overall design looks good, but I'm actually in favor of dropping WALs for now until we have a concrete plan for the recovery project 🤣 We can keep this PR and see how it goes in the future. |
Sure, let's see if the recovery project will be brought back in the future🤣 |
This PR does four things in general:
log_io_latch_
to ensure logging operations' security under concurrency access.(Though the log-related functions are not used except intest
at present🤪)disk_manager.cpp
todisk_manager.h
to improve readability.has_shut_down_
flag and change the destructor implementation (and this also includes support for asynchronous flushing), to ensure everything goes well if theShutDown()
is not manually called by the programmer :)DiskManager::WriteLog()
, also make the semantic offlush_log_
be consistent across all stage.Current problem (To be reviewed):
Just as I mentioned in the TODO section, the program will crash if the log flushing thread is not done after 10s, which can be a rare case, but this can also be handle more softly, like log a warning...etc