From 252dfdd9487baabaa5c6548f80fa9ac0d32ef93a Mon Sep 17 00:00:00 2001 From: lukeman Date: Thu, 25 Apr 2024 14:38:32 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=9B=9E=E5=90=883.0.0=E3=80=91?= =?UTF-8?q?=E5=A4=84=E7=90=86issue=EF=BC=9A=E6=95=85=E9=9A=9C=E6=B3=A8?= =?UTF-8?q?=E5=85=A5=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=87=8D=E5=90=AF=E5=90=8E?= =?UTF-8?q?openGauss=E5=90=AF=E5=8A=A8=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/process/postmaster/postmaster.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gausskernel/process/postmaster/postmaster.cpp b/src/gausskernel/process/postmaster/postmaster.cpp index 839e482f83..0355715037 100644 --- a/src/gausskernel/process/postmaster/postmaster.cpp +++ b/src/gausskernel/process/postmaster/postmaster.cpp @@ -904,9 +904,10 @@ bool SetDBStateFileState(DbState state, bool optional) len = read(fd, &s, sizeof(GaussState)); /* sizeof(int) is for current_connect_idx of GaussState */ if ((len != sizeof(GaussState)) && (len != sizeof(GaussState) - sizeof(int))) { - write_stderr("Failed to read gaussdb.state: %d", errno); + write_stderr("Failed to read gaussdb.state: %d, len: %d", errno, len); (void)close(fd); - return false; + (void)unlink(gaussdb_state_file); + return true; } if (close(fd) != 0) { -- Gitee