summaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/heap/vacuumlazy.c3
-rw-r--r--src/backend/access/transam/parallel.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c
index 62035b7f9c3..30778a15639 100644
--- a/src/backend/access/heap/vacuumlazy.c
+++ b/src/backend/access/heap/vacuumlazy.c
@@ -961,8 +961,7 @@ heap_vacuum_rel(Relation rel, const VacuumParams params,
* soon in cases where the failsafe prevented significant amounts of heap
* vacuuming.
*/
- pgstat_report_vacuum(RelationGetRelid(rel),
- rel->rd_rel->relisshared,
+ pgstat_report_vacuum(rel,
Max(vacrel->new_live_tuples, 0),
vacrel->recently_dead_tuples +
vacrel->missed_dead_tuples,
diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c
index 956b23816de..642c61fc55c 100644
--- a/src/backend/access/transam/parallel.c
+++ b/src/backend/access/transam/parallel.c
@@ -508,8 +508,12 @@ InitializeParallelDSM(ParallelContext *pcxt)
void
ReinitializeParallelDSM(ParallelContext *pcxt)
{
+ MemoryContext oldcontext;
FixedParallelState *fps;
+ /* We might be running in a very short-lived memory context. */
+ oldcontext = MemoryContextSwitchTo(TopTransactionContext);
+
/* Wait for any old workers to exit. */
if (pcxt->nworkers_launched > 0)
{
@@ -547,6 +551,9 @@ ReinitializeParallelDSM(ParallelContext *pcxt)
pcxt->worker[i].error_mqh = shm_mq_attach(mq, pcxt->seg, NULL);
}
}
+
+ /* Restore previous memory context. */
+ MemoryContextSwitchTo(oldcontext);
}
/*