Skip to content
This repository was archived by the owner on Jun 23, 2022. It is now read-only.

feat(disk): reject write if disk space is insufficient #833

Merged
merged 4 commits into from
May 28, 2021

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented May 17, 2021

This pull request is about disk protection when space is almost full. If one disk available space is below disk_min_available_space_ratio, all replica on this disk will reject user write request. The disk status is updated periodically, when disk space is normal, user write request will be recovered.

This pull request also adds related unit tests and dynamical configuration.

[replication]
+enable_disk_available_space_check=true
+disk_min_available_space_ratio=10

@hycdong hycdong marked this pull request as ready for review May 19, 2021 07:46
@@ -75,23 +89,40 @@ unsigned dir_node::remove(const gpid &pid)
return iter->second.erase(pid);
}

void dir_node::update_disk_stat()
void dir_node::update_disk_stat(bool &status_changed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool dir_node::update_disk_stat()

Copy link
Contributor Author

@hycdong hycdong May 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used to define function like your suggestion. If return false, it seems like update disk stat failed, so I pass status_chaned instead.

@acelyc111 acelyc111 added the type/enhancement Indicates new feature requests label May 26, 2021
@levy5307 levy5307 merged commit 5b8e4f6 into XiaoMi:master May 28, 2021
@hycdong hycdong deleted the lack_disk_space_1 branch July 23, 2021 01:50
@hycdong hycdong added the type/config-change PR that made modification on configs, which should be noted in release note. label Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/config-change PR that made modification on configs, which should be noted in release note. type/enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants