summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Geoghegan2022-08-19 00:34:14 +0000
committerPeter Geoghegan2022-08-19 00:34:14 +0000
commit662ba729a67e5c6e43efbc5263e1d2c3a72a8741 (patch)
tree7e49189c7af0afb5ad43f2d431a97f7cd5de109e
parentd9fbb8862959912c5266364059c0abeda0c93bbf (diff)
Initialize index stats during parallel VACUUM.
Initialize shared memory allocated for index stats to avoid a hard crash. This was possible when parallel VACUUM became confused about the current phase of index processing. Oversight in commit 8e1fae1938, which refactored parallel VACUUM. Author: Masahiko Sawada <[email protected]> Reported-By: Justin Pryzby <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch: 15-, the first version with the refactoring commit.
-rw-r--r--src/backend/commands/vacuumparallel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/commands/vacuumparallel.c b/src/backend/commands/vacuumparallel.c
index 1753da6c83..5c6f646eff 100644
--- a/src/backend/commands/vacuumparallel.c
+++ b/src/backend/commands/vacuumparallel.c
@@ -317,6 +317,7 @@ parallel_vacuum_init(Relation rel, Relation *indrels, int nindexes,
/* Prepare index vacuum stats */
indstats = (PVIndStats *) shm_toc_allocate(pcxt->toc, est_indstats_len);
+ MemSet(indstats, 0, est_indstats_len);
for (int i = 0; i < nindexes; i++)
{
Relation indrel = indrels[i];