pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Move parallel vacuum code to vacuumparallel.c.
3+ messages / 3 participants
[nested] [flat]
Commits from this thread:
2021-12-23 94226d4506 Fix compilation error introduced by commit 8e1fae1938.
* pgsql: Move parallel vacuum code to vacuumparallel.c.
@ 2021-12-23 06:20 Amit Kapila <akapila@postgresql.org>
2021-12-23 06:48 ` Re: pgsql: Move parallel vacuum code to vacuumparallel.c. Amit Kapila <amit.kapila16@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Amit Kapila @ 2021-12-23 06:20 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Move parallel vacuum code to vacuumparallel.c.
This commit moves parallel vacuum related code to a new file
commands/vacuumparallel.c so that any table AM supporting indexes can
utilize parallel vacuum in order to call index AM callbacks (ambulkdelete
and amvacuumcleanup) with parallel workers.
Another reason for this refactoring is that the parallel vacuum isn't
specific to heap so it doesn't make sense to keep this code in
heap/vacuumlazy.c.
Author: Masahiko Sawada, based on suggestion from Andres Freund
Reviewed-by: Hou Zhijie, Amit Kapila, Haiying Tang
Discussion: https://www.postgresql.org/message-id/20211030212101.ae3qcouatwmy7tbr%40alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8e1fae193864527c931a704bd7908e4fbc983f5c
Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 1002 +------------------------------
src/backend/access/transam/parallel.c | 2 +-
src/backend/commands/Makefile | 1 +
src/backend/commands/vacuum.c | 5 +-
src/backend/commands/vacuumparallel.c | 1068 +++++++++++++++++++++++++++++++++
src/include/access/heapam.h | 1 -
src/include/commands/vacuum.h | 20 +
src/tools/pgindent/typedefs.list | 9 +-
8 files changed, 1125 insertions(+), 983 deletions(-)
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Move parallel vacuum code to vacuumparallel.c.
2021-12-23 06:20 pgsql: Move parallel vacuum code to vacuumparallel.c. Amit Kapila <akapila@postgresql.org>
@ 2021-12-23 06:48 ` Amit Kapila <amit.kapila16@gmail.com>
2021-12-23 07:13 ` Re: pgsql: Move parallel vacuum code to vacuumparallel.c. Masahiko Sawada <sawada.mshk@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Amit Kapila @ 2021-12-23 06:48 UTC (permalink / raw)
To: Amit Kapila <akapila@postgresql.org>; +Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
On Thu, Dec 23, 2021 at 11:50 AM Amit Kapila <akapila@postgresql.org> wrote:
>
> Move parallel vacuum code to vacuumparallel.c.
>
There appears to be one failure:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedog&dt=2021-12-23%2006%3A26%3A03.
I'll look into it.
--
With Regards,
Amit Kapila.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Move parallel vacuum code to vacuumparallel.c.
2021-12-23 06:20 pgsql: Move parallel vacuum code to vacuumparallel.c. Amit Kapila <akapila@postgresql.org>
2021-12-23 06:48 ` Re: pgsql: Move parallel vacuum code to vacuumparallel.c. Amit Kapila <amit.kapila16@gmail.com>
@ 2021-12-23 07:13 ` Masahiko Sawada <sawada.mshk@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Masahiko Sawada @ 2021-12-23 07:13 UTC (permalink / raw)
To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: Amit Kapila <akapila@postgresql.org>; pgsql-committers <pgsql-committers@lists.postgresql.org>
On Thu, Dec 23, 2021 at 3:49 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Thu, Dec 23, 2021 at 11:50 AM Amit Kapila <akapila@postgresql.org> wrote:
> >
> > Move parallel vacuum code to vacuumparallel.c.
> >
>
> There appears to be one failure:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedog&dt=2021-12-23%2006%3A26%3A03.
>
I could reproduce this error by compiling with '-std=gnu99' on my
machine (macOS):
vacuumparallel.c:198:3: warning: redefinition of typedef
'ParallelVacuumState' is a C11 feature [-Wtypedef-redefinition]
} ParallelVacuumState;
^
../../../src/include/commands/vacuum.h:68:36: note: previous definition is here
typedef struct ParallelVacuumState ParallelVacuumState;
^
1 warning generated.
It seems a C11 feature. The attached patch fixes this issue.
Regards,
--
Masahiko Sawada
EDB: https://www.enterprisedb.com/
Attachments:
fix_compile_error.patch (application/x-patch, 743B) download
diff --git a/src/backend/commands/vacuumparallel.c b/src/backend/commands/vacuumparallel.c
index 5dd70c5273..8c70efcefa 100644
--- a/src/backend/commands/vacuumparallel.c
+++ b/src/backend/commands/vacuumparallel.c
@@ -138,7 +138,7 @@ typedef struct PVIndStats
} PVIndStats;
/* Struct for maintaining a parallel vacuum state. */
-typedef struct ParallelVacuumState
+struct ParallelVacuumState
{
/* NULL for worker processes */
ParallelContext *pcxt;
@@ -195,7 +195,7 @@ typedef struct ParallelVacuumState
char *relname;
char *indname;
PVIndVacStatus status;
-} ParallelVacuumState;
+};
static int parallel_vacuum_compute_workers(Relation *indrels, int nindexes, int nrequested,
bool *will_parallel_vacuum);
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-12-23 07:13 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-12-23 06:20 pgsql: Move parallel vacuum code to vacuumparallel.c. Amit Kapila <akapila@postgresql.org>
2021-12-23 06:48 ` Amit Kapila <amit.kapila16@gmail.com>
2021-12-23 07:13 ` Masahiko Sawada <sawada.mshk@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox