Fix server start failed when mode is 'read_only' (#2294)

* fix deploy bug

Signed-off-by: yhz <413554850@qq.com>

* fix unittest fail

Signed-off-by: yhz <413554850@qq.com>

* remove unused yml

Signed-off-by: yhz <413554850@qq.com>

* change to readonly

Signed-off-by: yhz <413554850@qq.com>
pull/2316/head
BossZou 2020-05-12 09:28:10 +08:00 committed by GitHub
parent fb49e580c5
commit 1b7aeaffdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -44,6 +44,16 @@ StorageChecker::CheckStoragePermission() {
return Status(SERVER_UNEXPECTED_ERROR, err_msg);
}
std::string deploy_mode;
status = config.GetServerConfigDeployMode(deploy_mode);
if (!status.ok()) {
return status;
}
if (deploy_mode == "cluster_readonly") {
return Status::OK();
}
/* Check db directory write permission */
std::string primary_path;
status = config.GetStorageConfigPrimaryPath(primary_path);

View File

@ -139,7 +139,7 @@ namespace {
static const char* CONTROLLER_TEST_VALID_CONFIG_STR =
"# Default values are used when you make no changes to the following parameters.\n"
"\n"
"version: 0.1\n"
"version: 0.4\n"
"\n"
"#----------------------+------------------------------------------------------------+------------+----------------"
"-+\n"