Skip to content

[PGPRO-5360] Fix for freeze (Valgrind and compilation with -Og option) #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/pathman_workers.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ bgw_main_concurrent_part(Datum main_arg)
ConcurrentPartSlot *part_slot;
char *sql = NULL;
int64 rows;
bool failed;
int failures_count = 0;
volatile bool failed;
volatile int failures_count = 0;
LOCKMODE lockmode = RowExclusiveLock;

/* Update concurrent part slot */
Expand Down Expand Up @@ -497,7 +497,7 @@ bgw_main_concurrent_part(Datum main_arg)
Oid types[2] = { OIDOID, INT4OID };
Datum vals[2] = { part_slot->relid, part_slot->batch_size };

bool rel_locked = false;
volatile bool rel_locked = false;

/* Reset loop variables */
failed = false;
Expand Down Expand Up @@ -545,14 +545,12 @@ bgw_main_concurrent_part(Datum main_arg)

/* Great, now relation is locked */
rel_locked = true;
(void) rel_locked; /* mute clang analyzer */

/* Make sure that relation exists */
if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(part_slot->relid)))
{
/* Exit after we raise ERROR */
failures_count = PART_WORKER_MAX_ATTEMPTS;
(void) failures_count; /* mute clang analyzer */

elog(ERROR, "relation %u does not exist", part_slot->relid);
}
Expand All @@ -562,7 +560,6 @@ bgw_main_concurrent_part(Datum main_arg)
{
/* Exit after we raise ERROR */
failures_count = PART_WORKER_MAX_ATTEMPTS;
(void) failures_count; /* mute clang analyzer */

elog(ERROR, "relation \"%s\" is not partitioned",
get_rel_name(part_slot->relid));
Expand Down