diff options
author | Peter Geoghegan <pg@bowt.ie> | 2022-08-18 17:34:12 -0700 |
---|---|---|
committer | Peter Geoghegan <pg@bowt.ie> | 2022-08-18 17:34:12 -0700 |
commit | 08c23f4204066aa86361eb6232d94284aa8dff00 (patch) | |
tree | aa482dc2ada2299b0a834effd8c6c54f47f925fb /src | |
parent | 72af71aad9ce541ecea67ceaa7961ca39f89f227 (diff) | |
download | postgresql-08c23f4204066aa86361eb6232d94284aa8dff00.tar.gz postgresql-08c23f4204066aa86361eb6232d94284aa8dff00.zip |
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 <sawada.mshk@gmail.com>
Reported-By: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://postgr.es/m/20220818133406.GL26426@telsasoft.com
Backpatch: 15-, the first version with the refactoring commit.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/commands/vacuumparallel.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/commands/vacuumparallel.c b/src/backend/commands/vacuumparallel.c index 1753da6c830..5c6f646eff9 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]; |