-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add support for "nowait" mode in file synchronization #1337
base: master
Are you sure you want to change the base?
Conversation
_ = idle_interval.tick() => { | ||
if last_used.elapsed() > idle_timeout { | ||
if let Err(e) = idle_notifier.send_async(path.to_string()).await { | ||
error!("Error receiving command: {:?}", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error sending idle notification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, but how exactly are you handling closing of the segment? eg. when it's full. IMHO your new tokio task should be shutted down
Also, could you please run benches? do it for both master and your PR |
@hubcio |
why did you go with such approach? why not just add another command eg. |
Because in that case, we would need to create a persister for each segment so that the task would be deleted when the segment is closed. Alternatively, if we create it manually in some operation, we would also have to manually call shutdown, which didn’t seem very convenient |
ok, acknowledged. let's see if all tests pass and how's performance :) it should be around 2x-3x faster than current master (AFAIR) |
caa55e7
to
afd2fdc
Compare
afd2fdc
to
a0dff0b
Compare
Pull Request Test Coverage Report for Build 11800982726Details
💛 - Coveralls |
Added nowait mode for file operations, which allows not waiting for the operation to complete before returning control to the client. This enables immediate continuation of work without blocking execution.
The append, overwrite, and delete methods in FilePersister have been updated to include a new confirmation parameter that controls the operation behavior:
WaitWithFlush — operation is performed with waiting and disk synchronization.
Wait — operation is performed with waiting but without synchronization.
Nowait — operation is performed immediately without waiting.
By default, WaitWithFlush is used to avoid changing the current system behavior.
A task queue has been added for handling operations in nowait mode asynchronously. This allows file operations to be executed in the background without blocking the client.
Inactivity state management has been implemented for tasks. If a task has not been used for a specified period, it will be marked as inactive, and the system will notify about it