8000 Bugfix: don't create ignorance table in parallel worker. · postgrespro/aqo@794f6ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 794f6ba

Browse files
committed
Bugfix: don't create ignorance table in parallel worker.
1 parent 0430253 commit 794f6ba

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ignorance.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "ignorance.h"
33

44
#include "access/heapam.h"
5+
#include "access/parallel.h"
56
#include "executor/spi.h"
67
#include "utils/lsyscache.h"
78
#include "miscadmin.h"
@@ -16,9 +17,10 @@ set_ignorance(bool newval, void *extra)
1617
* It is not problem. We will check existence at each update and create this
1718
* table in dynamic mode, if needed.
1819
*/
19-
if (IsUnderPostmaster && newval && (aqo_log_ignorance != newval))
20+
if (IsUnderPostmaster && !IsParallelWorker() && newval &&
21+
(aqo_log_ignorance != newval))
2022
/* Create storage and no error, if it exists already. */
21-
(bool) create_ignorance_table(true);
23+
create_ignorance_table(true);
2224

2325
aqo_log_ignorance = newval;
2426
}
@@ -101,7 +103,7 @@ update_ignorance(int qhash, int fhash, int fss_hash, Plan *plan)
101103
if (!OidIsValid(reloid))
102104
{
103105
/* This table doesn't created on instance startup. Create now. */
104-
(bool) create_ignorance_table(false);
106+
create_ignorance_table(false);
105107
reloid = RangeVarGetRelid(rv, NoLock, true);
106108
if (!OidIsValid(reloid))
107109
elog(PANIC, "Ignorance table does not exists!");

0 commit comments

Comments
 (0)
0