8 Star 0 Fork 5

src-anolis-os/glusterfs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0400-cli-throw-a-warning-if-replica-count-greater-than-3.patch 3.81 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2021-06-16 16:09 . update to glusterfs-6.0-49.1.el8.src.rpm
From 12ed9226fa24d073ab2b89692194b454a194c379 Mon Sep 17 00:00:00 2001
From: Sanju Rakonde <[email protected]>
Date: Thu, 4 Jun 2020 15:14:29 +0530
Subject: [PATCH 400/449] cli: throw a warning if replica count greater than 3
As volumes with replica count greater than 3 are not
supported, a warning message is be thrown to user
while creating the volume with replica count greater
than 3 or while converting a volume to replica > 3
volume by add-brick/remove-brick operations.
Label: DOWNSTREAM ONLY
BUG: 1763129
Change-Id: I5a32a5a2d99b5175fb692dfcab27396089f24b72
Signed-off-by: Sanju Rakonde <[email protected]>
Reviewed-on: https://code.engineering.redhat.com/gerrit/202338
Tested-by: RHGS Build Bot <[email protected]>
Reviewed-by: Mohit Agrawal <[email protected]>
Reviewed-by: Ravishankar Narayanankutty <[email protected]>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <[email protected]>
---
cli/src/cli-cmd-parser.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index ac0a263..5e7ce53 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -619,6 +619,23 @@ cli_cmd_volume_create_parse(struct cli_state *state, const char **words,
}
}
}
+
+ if (replica_count > 3) {
+ if (strcmp(words[wordcount - 1], "force")) {
+ question =
+ "Volumes with replica count greater than 3 are"
+ "not supported. \nDo you still want to continue?\n";
+ answer = cli_cmd_get_confirmation(state, question);
+ if (GF_ANSWER_NO == answer) {
+ gf_log("cli", GF_LOG_ERROR,
+ "Volume create "
+ "cancelled, exiting");
+ ret = -1;
+ goto out;
+ }
+ }
+ }
+
ret = dict_set_int32(dict, "replica-count", replica_count);
if (ret)
goto out;
@@ -1815,6 +1832,20 @@ cli_cmd_volume_add_brick_parse(struct cli_state *state, const char **words,
goto out;
}
}
+ } else if (count > 3) {
+ if (strcmp(words[wordcount - 1], "force")) {
+ question =
+ "Volumes with replica count greater than 3 are"
+ "not supported. \nDo you still want to continue?\n";
+ answer = cli_cmd_get_confirmation(state, question);
+ if (GF_ANSWER_NO == answer) {
+ gf_log("cli", GF_LOG_ERROR,
+ "add-brick "
+ "cancelled, exiting");
+ ret = -1;
+ goto out;
+ }
+ }
}
} else if ((strcmp(w, "stripe")) == 0) {
cli_err("stripe option not supported");
@@ -2082,6 +2113,20 @@ cli_cmd_volume_remove_brick_parse(struct cli_state *state, const char **words,
goto out;
}
}
+ } else if (count > 3) {
+ if (strcmp(words[wordcount - 1], "force")) {
+ ques =
+ "Volumes with replica count greater than 3 are"
+ "not supported. \nDo you still want to continue?\n";
+ answer = cli_cmd_get_confirmation(state, ques);
+ if (GF_ANSWER_NO == answer) {
+ gf_log("cli", GF_LOG_ERROR,
+ "Remove-brick "
+ "cancelled, exiting");
+ ret = -1;
+ goto out;
+ }
+ }
}
ret = dict_set_int32(dict, "replica-count", count);
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/glusterfs.git
[email protected]:src-anolis-os/glusterfs.git
src-anolis-os
glusterfs
glusterfs
a8

搜索帮助