解决issue:故障注入服务器重启后openGauss启动异常
This commit is contained in:
@ -927,7 +927,7 @@ bool SetDBStateFileState(DbState state, bool optional)
|
||||
securec_check_intval(rc, , false);
|
||||
|
||||
/* Write the new content into a temp file and rename it at last. */
|
||||
int fd = open(gaussdb_state_file, O_RDWR, 0);
|
||||
int fd = open(gaussdb_state_file, O_RDONLY, 0);
|
||||
if (fd == -1) {
|
||||
if (errno == ENOENT && optional) {
|
||||
write_stderr("gaussdb.state does not exist, and skipt setting since it is optional.");
|
||||
@ -945,7 +945,7 @@ bool SetDBStateFileState(DbState state, bool optional)
|
||||
write_stderr("Failed to read gaussdb.state: %d, len: %d", errno, len);
|
||||
(void)close(fd);
|
||||
(void)unlink(gaussdb_state_file);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (close(fd) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user