Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
a06ea6f5
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,发现更多精彩内容 >>
提交
a06ea6f5
编写于
1月 23, 2010
作者:
S
Simon Riggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add explanatory detail to Hot Standby cancelation error messages
with errdetail(). Add errhint() to suggest retry in certain cases.
上级
959ac58c
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
46 addition
and
5 deletion
+46
-5
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+46
-5
未找到文件。
src/backend/tcop/postgres.c
浏览文件 @
a06ea6f5
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.58
6 2010/01/23 16:37:12
sriggs Exp $
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.58
7 2010/01/23 17:04:05
sriggs Exp $
*
*
* NOTES
* NOTES
* this is the "main" module of the postgres backend and
* this is the "main" module of the postgres backend and
...
@@ -172,8 +172,9 @@ static int UseNewLine = 1; /* Use newlines query delimiters (the default) */
...
@@ -172,8 +172,9 @@ static int UseNewLine = 1; /* Use newlines query delimiters (the default) */
static
int
UseNewLine
=
0
;
/* Use EOF as query delimiters */
static
int
UseNewLine
=
0
;
/* Use EOF as query delimiters */
#endif
/* TCOP_DONTUSENEWLINE */
#endif
/* TCOP_DONTUSENEWLINE */
/* whether
we were cancelled during recovery by conflict processing or not
*/
/* whether
or not, and why, we were cancelled by conflict with recovery
*/
static
bool
RecoveryConflictPending
=
false
;
static
bool
RecoveryConflictPending
=
false
;
static
ProcSignalReason
RecoveryConflictReason
;
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
* decls for routines only used in this file
* decls for routines only used in this file
...
@@ -188,6 +189,7 @@ static bool check_log_statement(List *stmt_list);
...
@@ -188,6 +189,7 @@ static bool check_log_statement(List *stmt_list);
static
int
errdetail_execute
(
List
*
raw_parsetree_list
);
static
int
errdetail_execute
(
List
*
raw_parsetree_list
);
static
int
errdetail_params
(
ParamListInfo
params
);
static
int
errdetail_params
(
ParamListInfo
params
);
static
int
errdetail_abort
(
void
);
static
int
errdetail_abort
(
void
);
static
int
errdetail_recovery_conflict
(
void
);
static
void
start_xact_command
(
void
);
static
void
start_xact_command
(
void
);
static
void
finish_xact_command
(
void
);
static
void
finish_xact_command
(
void
);
static
bool
IsTransactionExitStmt
(
Node
*
parsetree
);
static
bool
IsTransactionExitStmt
(
Node
*
parsetree
);
...
@@ -2254,6 +2256,39 @@ errdetail_abort(void)
...
@@ -2254,6 +2256,39 @@ errdetail_abort(void)
return
0
;
return
0
;
}
}
/*
* errdetail_recovery_conflict
*
* Add an errdetail() line showing conflict source.
*/
static
int
errdetail_recovery_conflict
(
void
)
{
switch
(
RecoveryConflictReason
)
{
case
PROCSIG_RECOVERY_CONFLICT_BUFFERPIN
:
errdetail
(
"User was holding shared buffer pin for too long."
);
break
;
case
PROCSIG_RECOVERY_CONFLICT_LOCK
:
errdetail
(
"User was holding a relation lock for too long."
);
break
;
case
PROCSIG_RECOVERY_CONFLICT_TABLESPACE
:
errdetail
(
"User was or may have been using tablespace that must be dropped."
);
break
;
case
PROCSIG_RECOVERY_CONFLICT_SNAPSHOT
:
errdetail
(
"User query might have needed to see row versions that must be removed."
);
break
;
case
PROCSIG_RECOVERY_CONFLICT_DATABASE
:
errdetail
(
"User was connected to a database that must be dropped."
);
break
;
default:
break
;
/* no errdetail */
}
return
0
;
}
/*
/*
* exec_describe_statement_message
* exec_describe_statement_message
*
*
...
@@ -2716,6 +2751,7 @@ RecoveryConflictInterrupt(ProcSignalReason reason)
...
@@ -2716,6 +2751,7 @@ RecoveryConflictInterrupt(ProcSignalReason reason)
*/
*/
if
(
!
proc_exit_inprogress
)
if
(
!
proc_exit_inprogress
)
{
{
RecoveryConflictReason
=
reason
;
switch
(
reason
)
switch
(
reason
)
{
{
case
PROCSIG_RECOVERY_CONFLICT_BUFFERPIN
:
case
PROCSIG_RECOVERY_CONFLICT_BUFFERPIN
:
...
@@ -2835,7 +2871,8 @@ ProcessInterrupts(void)
...
@@ -2835,7 +2871,8 @@ ProcessInterrupts(void)
else
if
(
RecoveryConflictPending
)
else
if
(
RecoveryConflictPending
)
ereport
(
FATAL
,
ereport
(
FATAL
,
(
errcode
(
ERRCODE_ADMIN_SHUTDOWN
),
(
errcode
(
ERRCODE_ADMIN_SHUTDOWN
),
errmsg
(
"terminating connection due to conflict with recovery"
)));
errmsg
(
"terminating connection due to conflict with recovery"
),
errdetail_recovery_conflict
()));
else
else
ereport
(
FATAL
,
ereport
(
FATAL
,
(
errcode
(
ERRCODE_ADMIN_SHUTDOWN
),
(
errcode
(
ERRCODE_ADMIN_SHUTDOWN
),
...
@@ -2883,11 +2920,15 @@ ProcessInterrupts(void)
...
@@ -2883,11 +2920,15 @@ ProcessInterrupts(void)
if
(
DoingCommandRead
)
if
(
DoingCommandRead
)
ereport
(
FATAL
,
ereport
(
FATAL
,
(
errcode
(
ERRCODE_ADMIN_SHUTDOWN
),
(
errcode
(
ERRCODE_ADMIN_SHUTDOWN
),
errmsg
(
"terminating connection due to conflict with recovery"
)));
errmsg
(
"terminating connection due to conflict with recovery"
),
errdetail_recovery_conflict
(),
errhint
(
"In a moment you should be able to reconnect to the"
" database and repeat your command."
)));
else
else
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_QUERY_CANCELED
),
(
errcode
(
ERRCODE_QUERY_CANCELED
),
errmsg
(
"canceling statement due to conflict with recovery"
)));
errmsg
(
"canceling statement due to conflict with recovery"
),
errdetail_recovery_conflict
()));
}
}
/*
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录