-
Notifications
You must be signed in to change notification settings - Fork 34
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(auto-balance): disk in pressure #104
feat(auto-balance): disk in pressure #104
Conversation
ebe4de4
to
02fa133
Compare
} | ||
|
||
fileSize := fileInfo.Size() | ||
if fileSize%Blocks != 0 { |
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.
nit: Blocks
is the block size here and a bit weird. We can rename it to block size in the future.
Did a quick review. What
We don't have any synchronization in the implementation. The concurrent readers and writers on a single source file descriptor and a single target file descriptor can indeed introduce race conditions. |
Wouldn't they be on different interval due to the fileIntervalChannel? |
Each worker seeks the file descriptor to a specific offset and reads or writes data, so multiple workers will race. After discussing with @c3y1huang, we decided to use a single worker for now. We can improve it by using multiple workers in the future. Using a single worker might not be a bad approach because:
cc @innobead |
ef96839
to
d8c812c
Compare
d8c812c
to
268dc63
Compare
fb6853e
to
5ce7457
Compare
longhorn/longhorn-4105 Signed-off-by: Chin-Ya Huang <[email protected]>
longhorn/longhorn-4105 Signed-off-by: Chin-Ya Huang <[email protected]>
longhorn/longhorn-4105 Signed-off-by: Chin-Ya Huang <[email protected]>
5ce7457
to
d4118bb
Compare
Which issue(s) this PR fixes:
Issue longhorn/longhorn#4105
What this PR does / why we need it:
Implement a new function to sync data contents by local files.
Special notes for your reviewer:
None
Additional documentation or context
longhorn/longhorn-engine#1003 (review)