Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
cb7ce7d0
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,发现更多精彩内容 >>
提交
cb7ce7d0
编写于
1月 07, 2001
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix recent breakage of query-cancel logic, see my pghackers message
of 6 Jan 2001 21:55.
上级
6781aa47
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
65 addition
and
36 deletion
+65
-36
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+53
-21
src/backend/utils/init/globals.c
src/backend/utils/init/globals.c
+2
-2
src/include/miscadmin.h
src/include/miscadmin.h
+2
-2
src/include/utils/elog.h
src/include/utils/elog.h
+8
-11
未找到文件。
src/backend/tcop/postgres.c
浏览文件 @
cb7ce7d0
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.19
8 2000/12/20 21:51:52
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.19
9 2001/01/07 04:17:29
tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -94,7 +94,7 @@ DLLIMPORT sigjmp_buf Warn_restart;
bool
Warn_restart_ready
=
false
;
bool
InError
=
false
;
bool
ProcDiePending
=
false
;
volatile
bool
ProcDiePending
=
false
;
static
bool
EchoQuery
=
false
;
/* default don't echo */
char
pg_pathname
[
MAXPGPATH
];
...
...
@@ -920,7 +920,10 @@ finish_xact_command(void)
void
handle_warn
(
SIGNAL_ARGS
)
{
/* Don't joggle the elbow of a critical section */
/* Don't joggle the elbow of proc_exit */
if
(
proc_exit_inprogress
)
return
;
/* Don't joggle the elbow of a critical section, either */
if
(
CritSectionCount
>
0
)
{
QueryCancel
=
true
;
...
...
@@ -956,28 +959,38 @@ quickdie(SIGNAL_ARGS)
void
die
(
SIGNAL_ARGS
)
{
int
save_errno
=
errno
;
PG_SETMASK
(
&
BlockSig
);
/* Don't joggle the elbow of a critical section */
/* Don't joggle the elbow of proc_exit */
if
(
proc_exit_inprogress
)
{
errno
=
save_errno
;
return
;
}
/* Don't joggle the elbow of a critical section, either */
if
(
CritSectionCount
>
0
)
{
QueryCancel
=
true
;
ProcDiePending
=
true
;
errno
=
save_errno
;
return
;
}
/* Don't joggle the elbow of proc_exit, either */
if
(
proc_exit_inprogress
)
return
;
elog
(
FATAL
,
"The system is shutting down"
);
/* Otherwise force immediate proc_exit */
ForceProcDie
();
}
/* signal handler for floating point exception */
static
void
FloatExceptionHandler
(
SIGNAL_ARGS
)
/*
* This is split out of die() so that it can be invoked later from
* END_CRIT_CODE.
*/
void
ForceProcDie
(
void
)
{
elog
(
ERROR
,
"floating point exception!"
" The last floating point operation either exceeded legal ranges"
" or was a divide by zero"
);
/* Reset flag to avoid another elog() during shutdown */
ProcDiePending
=
false
;
/* Send error message and do proc_exit() */
elog
(
FATAL
,
"The system is shutting down"
);
}
/* signal handler for query cancel signal from postmaster */
...
...
@@ -986,22 +999,41 @@ QueryCancelHandler(SIGNAL_ARGS)
{
int
save_errno
=
errno
;
/* Don't joggle the elbow of proc_exit, nor an already-in-progress abort */
if
(
proc_exit_inprogress
||
InError
)
{
errno
=
save_errno
;
return
;
}
/* Set flag to cause CancelQuery to be called when it's safe */
QueryCancel
=
true
;
/* If we happen to be waiting for a lock, get out of that */
LockWaitCancel
();
/* Otherwise, bide our time... */
errno
=
save_errno
;
}
void
CancelQuery
(
void
)
{
/*
* QueryCancel flag will be reset in main loop, which we reach by
* longjmp from elog().
*/
/* Reset flag to avoid another elog() during error recovery */
QueryCancel
=
false
;
/* Create an artificial error condition to get out of query */
elog
(
ERROR
,
"Query was cancelled."
);
}
/* signal handler for floating point exception */
static
void
FloatExceptionHandler
(
SIGNAL_ARGS
)
{
elog
(
ERROR
,
"floating point exception!"
" The last floating point operation either exceeded legal ranges"
" or was a divide by zero"
);
}
static
void
SigHupHandler
(
SIGNAL_ARGS
)
{
...
...
@@ -1651,7 +1683,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
if
(
!
IsUnderPostmaster
)
{
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"$Revision: 1.19
8 $ $Date: 2000/12/20 21:51:52
$
\n
"
);
puts
(
"$Revision: 1.19
9 $ $Date: 2001/01/07 04:17:29
$
\n
"
);
}
/*
...
...
src/backend/utils/init/globals.c
浏览文件 @
cb7ce7d0
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.4
8 2000/12/28 13:00:24 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.4
9 2001/01/07 04:17:29 tgl
Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
...
...
@@ -34,7 +34,7 @@ ProtocolVersion FrontendProtocol = PG_PROTOCOL_LATEST;
bool
Noversion
=
false
;
bool
Quiet
=
false
;
bool
QueryCancel
=
false
;
volatile
bool
QueryCancel
=
false
;
int
MyProcPid
;
struct
Port
*
MyProcPort
;
...
...
src/include/miscadmin.h
浏览文件 @
cb7ce7d0
...
...
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: miscadmin.h,v 1.7
5 2000/11/29 20:59:54
tgl Exp $
* $Id: miscadmin.h,v 1.7
6 2001/01/07 04:17:28
tgl Exp $
*
* NOTES
* some of the information in this file will be moved to
...
...
@@ -42,7 +42,7 @@ extern int PostmasterMain(int argc, char *argv[]);
*/
extern
bool
Noversion
;
extern
bool
Quiet
;
extern
bool
QueryCancel
;
extern
volatile
bool
QueryCancel
;
extern
char
*
DataDir
;
extern
int
MyProcPid
;
...
...
src/include/utils/elog.h
浏览文件 @
cb7ce7d0
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: elog.h,v 1.2
1 2000/12/18 00:44:50
tgl Exp $
* $Id: elog.h,v 1.2
2 2001/01/07 04:17:28
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -30,11 +30,13 @@ extern int Use_syslog;
/*
* If CritSectionCount > 0, signal handlers mustn't do
* elog(ERROR|FATAL), instead remember what action is
* required with QueryCancel & ProcDiePending.
* required with QueryCancel or ProcDiePending.
* ProcDiePending will be honored at critical section exit,
* but QueryCancel is only checked at specified points.
*/
extern
uint32
CritSectionCount
;
/* duplicates access/xlog.h */
extern
bool
QueryCancel
;
/* duplicates miscadmin.h */
extern
bool
ProcDiePending
;
extern
volatile
bool
ProcDiePending
;
extern
void
ForceProcDie
(
void
);
/* in postgres.c */
#define START_CRIT_CODE (CritSectionCount++)
...
...
@@ -43,13 +45,8 @@ extern bool ProcDiePending;
if (CritSectionCount == 0) \
elog(STOP, "Not in critical section"); \
CritSectionCount--; \
if (CritSectionCount == 0 && QueryCancel) \
{ \
if (ProcDiePending) \
elog(FATAL, "The system is shutting down"); \
else \
elog(ERROR, "Query was cancelled."); \
} \
if (CritSectionCount == 0 && ProcDiePending) \
ForceProcDie(); \
} while(0)
extern
bool
Log_timestamp
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录