report_iud_time函数中try catch跳转后锁队列混乱

This commit is contained in:
wangxin 2021-08-04 14:55:06 +08:00 committed by cchen676
parent 1a20907a0c
commit fd31bfbba6
1 changed files with 7 additions and 22 deletions

View File

@ -170,10 +170,8 @@ static void report_iud_time(QueryDesc *query)
if (OidIsValid(rid) == false || rid < FirstNormalObjectId) { if (OidIsValid(rid) == false || rid < FirstNormalObjectId) {
continue; continue;
} }
MemoryContext current_ctx = CurrentMemoryContext;
Relation rel = NULL; Relation rel = NULL;
PG_TRY();
{
rel = heap_open(rid, AccessShareLock); rel = heap_open(rid, AccessShareLock);
if (rel->rd_rel->relkind == RELKIND_RELATION) { if (rel->rd_rel->relkind == RELKIND_RELATION) {
if (rel->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT || if (rel->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT ||
@ -183,19 +181,6 @@ static void report_iud_time(QueryDesc *query)
} }
heap_close(rel, AccessShareLock); heap_close(rel, AccessShareLock);
} }
PG_CATCH();
{
(void)MemoryContextSwitchTo(current_ctx);
ErrorData *edata = CopyErrorData();
ereport(DEBUG1, (errmsg("Failed to send data changed time, cause: %s", edata->message)));
FlushErrorState();
FreeErrorData(edata);
if (rel != NULL) {
heap_close(rel, AccessShareLock);
}
}
PG_END_TRY();
}
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------