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

feat(disk): add broken disk check while initialize #834

Merged
merged 7 commits into from
Jun 7, 2021

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented May 17, 2021

This pull request adds disk check while initialize. We choose the way that doris used. When the disk path is found, we will try to write and read data to check if the disk is broken. If the disk is broken, it will be excluded and replica instance can start. In previous implmenetation, if a disk is broken, replica server will core and never start until the broken disk removed.

This pull request also adds related unit tests and configuration.

[replication]
+ignore_broken_disk=true

@hycdong hycdong marked this pull request as ready for review May 19, 2021 07:46
src/utils/filesystem.cpp Outdated Show resolved Hide resolved
src/replica/replica_stub.cpp Outdated Show resolved Hide resolved
acelyc111
acelyc111 previously approved these changes May 24, 2021
Copy link
Member

@acelyc111 acelyc111 left a comment

Choose a reason for hiding this comment

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

LGTM

std::string err_msg;
int count = 0;
std::vector<std::string> available_dirs;
std::vector<std::string> available_dir_tags;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe you should assert data_dirs.size() == data_dir_tags.size() here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

data_dirs and data_dirs_tags are _options.data_dirs and _options.data_dir_tags, you can reference how them set in replication_common.cpp function initialize, I don't add a link here because it will be refactored by pull request 831.

@acelyc111 acelyc111 added the type/enhancement Indicates new feature requests label May 26, 2021
acelyc111
acelyc111 previously approved these changes May 28, 2021
@foreverneverer
Copy link
Contributor

If the disk is broken, it will be excluded and replica instance can start.

The case need add perf-counter and let user know it in time

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants