Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
86ad18ce
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
86ad18ce
编写于
3月 09, 2016
作者:
H
Heikki Linnakangas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert some superfluous error message changes vs. upstream.
Will make merging code to fd.c easier.
上级
64cd603a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
16 deletion
+18
-16
src/backend/storage/file/fd.c
src/backend/storage/file/fd.c
+18
-16
未找到文件。
src/backend/storage/file/fd.c
浏览文件 @
86ad18ce
...
@@ -451,7 +451,7 @@ set_max_safe_fds(void)
...
@@ -451,7 +451,7 @@ set_max_safe_fds(void)
if
(
max_safe_fds
<
FD_MINFREE
)
if
(
max_safe_fds
<
FD_MINFREE
)
ereport
(
FATAL
,
ereport
(
FATAL
,
(
errcode
(
ERRCODE_INSUFFICIENT_RESOURCES
),
(
errcode
(
ERRCODE_INSUFFICIENT_RESOURCES
),
errmsg
(
"insufficient file
handle
s available to start server process"
),
errmsg
(
"insufficient file
descriptor
s available to start server process"
),
errdetail
(
"System allows %d, we need at least %d."
,
errdetail
(
"System allows %d, we need at least %d."
,
max_safe_fds
+
NUM_RESERVED_FDS
,
max_safe_fds
+
NUM_RESERVED_FDS
,
FD_MINFREE
+
NUM_RESERVED_FDS
)));
FD_MINFREE
+
NUM_RESERVED_FDS
)));
...
@@ -493,7 +493,7 @@ tryAgain:
...
@@ -493,7 +493,7 @@ tryAgain:
ereport
(
LOG
,
ereport
(
LOG
,
(
errcode
(
ERRCODE_INSUFFICIENT_RESOURCES
),
(
errcode
(
ERRCODE_INSUFFICIENT_RESOURCES
),
errmsg
(
"out of file
handle
s: %m; release and retry"
)));
errmsg
(
"out of file
descriptor
s: %m; release and retry"
)));
errno
=
0
;
errno
=
0
;
if
(
ReleaseLruFile
())
if
(
ReleaseLruFile
())
goto
tryAgain
;
goto
tryAgain
;
...
@@ -564,8 +564,7 @@ LruDelete(File file)
...
@@ -564,8 +564,7 @@ LruDelete(File file)
/* close the file */
/* close the file */
if
(
close
(
vfdP
->
fd
))
if
(
close
(
vfdP
->
fd
))
elog
(
ERROR
,
"could not close file
\"
%s
\"
: %m"
,
elog
(
ERROR
,
"could not close file
\"
%s
\"
: %m"
,
vfdP
->
fileName
);
vfdP
->
fileName
);
--
nfile
;
--
nfile
;
vfdP
->
fd
=
VFD_CLOSED
;
vfdP
->
fd
=
VFD_CLOSED
;
...
@@ -1366,7 +1365,8 @@ FileSeek(File file, int64 offset, int whence)
...
@@ -1366,7 +1365,8 @@ FileSeek(File file, int64 offset, int whence)
switch
(
whence
)
switch
(
whence
)
{
{
case
SEEK_SET
:
case
SEEK_SET
:
Assert
(
offset
>=
INT64CONST
(
0
));
if
(
offset
<
0
)
elog
(
ERROR
,
"invalid seek offset: %ld"
,
offset
);
VfdCache
[
file
].
seekPos
=
offset
;
VfdCache
[
file
].
seekPos
=
offset
;
break
;
break
;
case
SEEK_CUR
:
case
SEEK_CUR
:
...
@@ -1380,7 +1380,7 @@ FileSeek(File file, int64 offset, int whence)
...
@@ -1380,7 +1380,7 @@ FileSeek(File file, int64 offset, int whence)
offset
,
whence
);
offset
,
whence
);
break
;
break
;
default:
default:
Assert
(
!
"invalid whence"
);
elog
(
ERROR
,
"invalid whence: %d"
,
whence
);
break
;
break
;
}
}
}
}
...
@@ -1389,7 +1389,8 @@ FileSeek(File file, int64 offset, int whence)
...
@@ -1389,7 +1389,8 @@ FileSeek(File file, int64 offset, int whence)
switch
(
whence
)
switch
(
whence
)
{
{
case
SEEK_SET
:
case
SEEK_SET
:
Assert
(
offset
>=
INT64CONST
(
0
));
if
(
offset
<
0
)
elog
(
ERROR
,
"invalid seek offset: "
INT64_FORMAT
,
offset
);
if
(
VfdCache
[
file
].
seekPos
!=
offset
)
if
(
VfdCache
[
file
].
seekPos
!=
offset
)
VfdCache
[
file
].
seekPos
=
pg_lseek64
(
VfdCache
[
file
].
fd
,
VfdCache
[
file
].
seekPos
=
pg_lseek64
(
VfdCache
[
file
].
fd
,
offset
,
whence
);
offset
,
whence
);
...
@@ -1404,7 +1405,7 @@ FileSeek(File file, int64 offset, int whence)
...
@@ -1404,7 +1405,7 @@ FileSeek(File file, int64 offset, int whence)
offset
,
whence
);
offset
,
whence
);
break
;
break
;
default:
default:
Assert
(
!
"invalid whence"
);
elog
(
ERROR
,
"invalid whence: %d"
,
whence
);
break
;
break
;
}
}
}
}
...
@@ -1506,7 +1507,7 @@ AllocateFile(const char *name, const char *mode)
...
@@ -1506,7 +1507,7 @@ AllocateFile(const char *name, const char *mode)
*/
*/
if
(
numAllocatedDescs
>=
MAX_ALLOCATED_DESCS
||
if
(
numAllocatedDescs
>=
MAX_ALLOCATED_DESCS
||
numAllocatedDescs
>=
max_safe_fds
-
1
)
numAllocatedDescs
>=
max_safe_fds
-
1
)
elog
(
ERROR
,
"
could not allocate file: out of file handles
"
);
elog
(
ERROR
,
"
too many private files demanded
"
);
TryAgain:
TryAgain:
if
((
file
=
fopen
(
name
,
mode
))
!=
NULL
)
if
((
file
=
fopen
(
name
,
mode
))
!=
NULL
)
...
@@ -1526,7 +1527,7 @@ TryAgain:
...
@@ -1526,7 +1527,7 @@ TryAgain:
ereport
(
LOG
,
ereport
(
LOG
,
(
errcode
(
ERRCODE_INSUFFICIENT_RESOURCES
),
(
errcode
(
ERRCODE_INSUFFICIENT_RESOURCES
),
errmsg
(
"out of file
handle
s: %m; release and retry"
)));
errmsg
(
"out of file
descriptor
s: %m; release and retry"
)));
errno
=
0
;
errno
=
0
;
if
(
ReleaseLruFile
())
if
(
ReleaseLruFile
())
goto
TryAgain
;
goto
TryAgain
;
...
@@ -1544,7 +1545,7 @@ TryAgain:
...
@@ -1544,7 +1545,7 @@ TryAgain:
static
int
static
int
FreeDesc
(
AllocateDesc
*
desc
)
FreeDesc
(
AllocateDesc
*
desc
)
{
{
int
result
=
0
;
int
result
;
/* Close the underlying object */
/* Close the underlying object */
switch
(
desc
->
kind
)
switch
(
desc
->
kind
)
...
@@ -1556,7 +1557,8 @@ FreeDesc(AllocateDesc *desc)
...
@@ -1556,7 +1557,8 @@ FreeDesc(AllocateDesc *desc)
result
=
closedir
(
desc
->
desc
.
dir
);
result
=
closedir
(
desc
->
desc
.
dir
);
break
;
break
;
default:
default:
Assert
(
false
);
elog
(
ERROR
,
"AllocateDesc kind not recognized"
);
result
=
0
;
/* keep compiler quiet */
break
;
break
;
}
}
...
@@ -1590,7 +1592,7 @@ FreeFile(FILE *file)
...
@@ -1590,7 +1592,7 @@ FreeFile(FILE *file)
}
}
/* Only get here if someone passes us a file not in allocatedDescs */
/* Only get here if someone passes us a file not in allocatedDescs */
elog
(
LOG
,
"file to be closed was not opened through the virtual file descriptor system
"
);
elog
(
WARNING
,
"file passed to FreeFile was not obtained from AllocateFile
"
);
Assert
(
false
);
Assert
(
false
);
return
fclose
(
file
);
return
fclose
(
file
);
...
@@ -1621,7 +1623,7 @@ AllocateDir(const char *dirname)
...
@@ -1621,7 +1623,7 @@ AllocateDir(const char *dirname)
*/
*/
if
(
numAllocatedDescs
>=
MAX_ALLOCATED_DESCS
||
if
(
numAllocatedDescs
>=
MAX_ALLOCATED_DESCS
||
numAllocatedDescs
>=
max_safe_fds
-
1
)
numAllocatedDescs
>=
max_safe_fds
-
1
)
elog
(
ERROR
,
"
could not allocate directory: out of file handles
"
);
elog
(
ERROR
,
"
too many private dirs demanded
"
);
TryAgain:
TryAgain:
if
((
dir
=
opendir
(
dirname
))
!=
NULL
)
if
((
dir
=
opendir
(
dirname
))
!=
NULL
)
...
@@ -1641,7 +1643,7 @@ TryAgain:
...
@@ -1641,7 +1643,7 @@ TryAgain:
ereport
(
LOG
,
ereport
(
LOG
,
(
errcode
(
ERRCODE_INSUFFICIENT_RESOURCES
),
(
errcode
(
ERRCODE_INSUFFICIENT_RESOURCES
),
errmsg
(
"out of file
handle
s: %m; release and retry"
)));
errmsg
(
"out of file
descriptor
s: %m; release and retry"
)));
errno
=
0
;
errno
=
0
;
if
(
ReleaseLruFile
())
if
(
ReleaseLruFile
())
goto
TryAgain
;
goto
TryAgain
;
...
@@ -1728,7 +1730,7 @@ FreeDir(DIR *dir)
...
@@ -1728,7 +1730,7 @@ FreeDir(DIR *dir)
}
}
/* Only get here if someone passes us a dir not in allocatedDescs */
/* Only get here if someone passes us a dir not in allocatedDescs */
elog
(
LOG
,
"directory to be closed was not opened through the virtual file descriptor system
"
);
elog
(
WARNING
,
"dir passed to FreeDir was not obtained from AllocateDir
"
);
Assert
(
false
);
Assert
(
false
);
return
closedir
(
dir
);
return
closedir
(
dir
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录