You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by zt...@apache.org on 2022/07/15 16:24:34 UTC
[hawq] branch master updated: HAWQ-1843. fix bug of access database flat file concurrently
This is an automated email from the ASF dual-hosted git repository.
ztao1987 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hawq.git
The following commit(s) were added to refs/heads/master by this push:
new 187e98e9c HAWQ-1843. fix bug of access database flat file concurrently
187e98e9c is described below
commit 187e98e9c14baecd09e607304d82c50f808df2b4
Author: ztao1987 <zh...@gmail.com>
AuthorDate: Sat Jul 16 00:23:50 2022 +0800
HAWQ-1843. fix bug of access database flat file concurrently
---
src/backend/cdb/cdbdatabaseinfo.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/backend/cdb/cdbdatabaseinfo.c b/src/backend/cdb/cdbdatabaseinfo.c
index d49219b39..0d24e25fc 100644
--- a/src/backend/cdb/cdbdatabaseinfo.c
+++ b/src/backend/cdb/cdbdatabaseinfo.c
@@ -982,10 +982,19 @@ DatabaseInfo_Scan(
if(IsLocalPath(fromfile)){//on local disk
struct stat fst;
- if (lstat(fromfile, &fst) < 0)
- ereport(ERROR,
- (errcode_for_file_access(),
- errmsg("could not stat file \"%s\": %m", fromfile)));
+ if (lstat(fromfile, &fst) < 0) {
+ if (errno != ENOENT)
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not stat file \"%s\": %m", fromfile)));
+ /*
+ * If the file went away while scanning, it's no error.
+ * This could happen especillay with shared relcache init file
+ * that is stored in global tablespace.
+ */
+ elog(LOG, "skipping missing file %s", fromfile);
+ continue;
+ }
if (S_ISDIR(fst.st_mode))
{