pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix GIN multiple-VACUUM-scans pending list bug.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix GIN multiple-VACUUM-scans pending list bug.
@ 2026-08-19 17:47  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-08-19 17:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix GIN multiple-VACUUM-scans pending list bug.

ginbulkdelete performs pending list cleanup before it searches the entry
tree (and any posting trees) for dead TIDs.  This is necessary to avoid
leaving behind dangling TID references that index vacuuming is required
to remove; nothing prevents recently inserted pending list tuples from
containing TIDs that VACUUM already considers dead.

However, ginbulkdelete neglected to perform pending list cleanup on
VACUUM's second or subsequent call.  It was therefore possible for a
VACUUM that requires multiple rounds of index vacuuming to leave behind
dangling references.

To fix, teach ginbulkdelete to perform pending list cleanup during every
call.  In passing, tweak some related comments in the pending list
cleanup path to make it clear why it's safe for VACUUM to not _fully_
empty an index's pending list.

This was arguably an oversight in commit e2c79e14, which fixed a similar
issue where pending list cleanup by VACUUM could end early, but missed
this closely related problem.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/CAH2-Wzmsa-RPA2Ko8A5LaGOnmbpimJ--71xkiBqwgjk3Fq8YEg@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0bace7af3dff862e9643e45df11449857cc56932

Modified Files
--------------
src/backend/access/gin/ginfast.c   | 15 +++++++++------
src/backend/access/gin/ginvacuum.c | 18 ++++++++++++------
src/include/access/gin_private.h   |  2 +-
3 files changed, 22 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix GIN multiple-VACUUM-scans pending list bug.
@ 2026-08-19 17:47  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-08-19 17:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix GIN multiple-VACUUM-scans pending list bug.

ginbulkdelete performs pending list cleanup before it searches the entry
tree (and any posting trees) for dead TIDs.  This is necessary to avoid
leaving behind dangling TID references that index vacuuming is required
to remove; nothing prevents recently inserted pending list tuples from
containing TIDs that VACUUM already considers dead.

However, ginbulkdelete neglected to perform pending list cleanup on
VACUUM's second or subsequent call.  It was therefore possible for a
VACUUM that requires multiple rounds of index vacuuming to leave behind
dangling references.

To fix, teach ginbulkdelete to perform pending list cleanup during every
call.  In passing, tweak some related comments in the pending list
cleanup path to make it clear why it's safe for VACUUM to not _fully_
empty an index's pending list.

This was arguably an oversight in commit e2c79e14, which fixed a similar
issue where pending list cleanup by VACUUM could end early, but missed
this closely related problem.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/CAH2-Wzmsa-RPA2Ko8A5LaGOnmbpimJ--71xkiBqwgjk3Fq8YEg@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/76c05f5080c8c0b285247e58f7c2303a647646e6

Modified Files
--------------
src/backend/access/gin/ginfast.c   | 15 +++++++++------
src/backend/access/gin/ginvacuum.c | 18 ++++++++++++------
src/include/access/gin_private.h   |  2 +-
3 files changed, 22 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix GIN multiple-VACUUM-scans pending list bug.
@ 2026-08-19 17:47  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-08-19 17:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix GIN multiple-VACUUM-scans pending list bug.

ginbulkdelete performs pending list cleanup before it searches the entry
tree (and any posting trees) for dead TIDs.  This is necessary to avoid
leaving behind dangling TID references that index vacuuming is required
to remove; nothing prevents recently inserted pending list tuples from
containing TIDs that VACUUM already considers dead.

However, ginbulkdelete neglected to perform pending list cleanup on
VACUUM's second or subsequent call.  It was therefore possible for a
VACUUM that requires multiple rounds of index vacuuming to leave behind
dangling references.

To fix, teach ginbulkdelete to perform pending list cleanup during every
call.  In passing, tweak some related comments in the pending list
cleanup path to make it clear why it's safe for VACUUM to not _fully_
empty an index's pending list.

This was arguably an oversight in commit e2c79e14, which fixed a similar
issue where pending list cleanup by VACUUM could end early, but missed
this closely related problem.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/CAH2-Wzmsa-RPA2Ko8A5LaGOnmbpimJ--71xkiBqwgjk3Fq8YEg@mail.gmail.com
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8637383f5ff1cb7eefd0f9ea4e3da81a70ca206b

Modified Files
--------------
src/backend/access/gin/ginfast.c   | 15 +++++++++------
src/backend/access/gin/ginvacuum.c | 18 ++++++++++++------
src/include/access/gin_private.h   |  2 +-
3 files changed, 22 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix GIN multiple-VACUUM-scans pending list bug.
@ 2026-08-19 17:47  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-08-19 17:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix GIN multiple-VACUUM-scans pending list bug.

ginbulkdelete performs pending list cleanup before it searches the entry
tree (and any posting trees) for dead TIDs.  This is necessary to avoid
leaving behind dangling TID references that index vacuuming is required
to remove; nothing prevents recently inserted pending list tuples from
containing TIDs that VACUUM already considers dead.

However, ginbulkdelete neglected to perform pending list cleanup on
VACUUM's second or subsequent call.  It was therefore possible for a
VACUUM that requires multiple rounds of index vacuuming to leave behind
dangling references.

To fix, teach ginbulkdelete to perform pending list cleanup during every
call.  In passing, tweak some related comments in the pending list
cleanup path to make it clear why it's safe for VACUUM to not _fully_
empty an index's pending list.

This was arguably an oversight in commit e2c79e14, which fixed a similar
issue where pending list cleanup by VACUUM could end early, but missed
this closely related problem.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/CAH2-Wzmsa-RPA2Ko8A5LaGOnmbpimJ--71xkiBqwgjk3Fq8YEg@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fb7c2a5140faaca787f91e3c0d9f7ecfffb74c70

Modified Files
--------------
src/backend/access/gin/ginfast.c   | 15 +++++++++------
src/backend/access/gin/ginvacuum.c | 18 ++++++++++++------
src/include/access/gin_private.h   |  2 +-
3 files changed, 22 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix GIN multiple-VACUUM-scans pending list bug.
@ 2026-08-19 17:47  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-08-19 17:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix GIN multiple-VACUUM-scans pending list bug.

ginbulkdelete performs pending list cleanup before it searches the entry
tree (and any posting trees) for dead TIDs.  This is necessary to avoid
leaving behind dangling TID references that index vacuuming is required
to remove; nothing prevents recently inserted pending list tuples from
containing TIDs that VACUUM already considers dead.

However, ginbulkdelete neglected to perform pending list cleanup on
VACUUM's second or subsequent call.  It was therefore possible for a
VACUUM that requires multiple rounds of index vacuuming to leave behind
dangling references.

To fix, teach ginbulkdelete to perform pending list cleanup during every
call.  In passing, tweak some related comments in the pending list
cleanup path to make it clear why it's safe for VACUUM to not _fully_
empty an index's pending list.

This was arguably an oversight in commit e2c79e14, which fixed a similar
issue where pending list cleanup by VACUUM could end early, but missed
this closely related problem.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/CAH2-Wzmsa-RPA2Ko8A5LaGOnmbpimJ--71xkiBqwgjk3Fq8YEg@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b0a36462bf28ad233f016f4b8ad3ce021ff9b76b

Modified Files
--------------
src/backend/access/gin/ginfast.c   | 15 +++++++++------
src/backend/access/gin/ginvacuum.c | 18 ++++++++++++------
src/include/access/gin_private.h   |  2 +-
3 files changed, 22 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix GIN multiple-VACUUM-scans pending list bug.
@ 2026-08-19 17:47  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-08-19 17:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix GIN multiple-VACUUM-scans pending list bug.

ginbulkdelete performs pending list cleanup before it searches the entry
tree (and any posting trees) for dead TIDs.  This is necessary to avoid
leaving behind dangling TID references that index vacuuming is required
to remove; nothing prevents recently inserted pending list tuples from
containing TIDs that VACUUM already considers dead.

However, ginbulkdelete neglected to perform pending list cleanup on
VACUUM's second or subsequent call.  It was therefore possible for a
VACUUM that requires multiple rounds of index vacuuming to leave behind
dangling references.

To fix, teach ginbulkdelete to perform pending list cleanup during every
call.  In passing, tweak some related comments in the pending list
cleanup path to make it clear why it's safe for VACUUM to not _fully_
empty an index's pending list.

This was arguably an oversight in commit e2c79e14, which fixed a similar
issue where pending list cleanup by VACUUM could end early, but missed
this closely related problem.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/CAH2-Wzmsa-RPA2Ko8A5LaGOnmbpimJ--71xkiBqwgjk3Fq8YEg@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/adf440cbe69920b0475ffca118041de4a8e369ca

Modified Files
--------------
src/backend/access/gin/ginfast.c   | 15 +++++++++------
src/backend/access/gin/ginvacuum.c | 18 ++++++++++++------
src/include/access/gin_private.h   |  2 +-
3 files changed, 22 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix GIN multiple-VACUUM-scans pending list bug.
@ 2026-08-19 17:47  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-08-19 17:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix GIN multiple-VACUUM-scans pending list bug.

ginbulkdelete performs pending list cleanup before it searches the entry
tree (and any posting trees) for dead TIDs.  This is necessary to avoid
leaving behind dangling TID references that index vacuuming is required
to remove; nothing prevents recently inserted pending list tuples from
containing TIDs that VACUUM already considers dead.

However, ginbulkdelete neglected to perform pending list cleanup on
VACUUM's second or subsequent call.  It was therefore possible for a
VACUUM that requires multiple rounds of index vacuuming to leave behind
dangling references.

To fix, teach ginbulkdelete to perform pending list cleanup during every
call.  In passing, tweak some related comments in the pending list
cleanup path to make it clear why it's safe for VACUUM to not _fully_
empty an index's pending list.

This was arguably an oversight in commit e2c79e14, which fixed a similar
issue where pending list cleanup by VACUUM could end early, but missed
this closely related problem.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/CAH2-Wzmsa-RPA2Ko8A5LaGOnmbpimJ--71xkiBqwgjk3Fq8YEg@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d778f00c145d94285e77587f00a44dcf99cc0620

Modified Files
--------------
src/backend/access/gin/ginfast.c   | 15 +++++++++------
src/backend/access/gin/ginvacuum.c | 18 ++++++++++++------
src/include/access/gin_private.h   |  2 +-
3 files changed, 22 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2026-08-19 17:47 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-19 17:47 pgsql: Fix GIN multiple-VACUUM-scans pending list bug. Peter Geoghegan <pg@bowt.ie>
2026-08-19 17:47 pgsql: Fix GIN multiple-VACUUM-scans pending list bug. Peter Geoghegan <pg@bowt.ie>
2026-08-19 17:47 pgsql: Fix GIN multiple-VACUUM-scans pending list bug. Peter Geoghegan <pg@bowt.ie>
2026-08-19 17:47 pgsql: Fix GIN multiple-VACUUM-scans pending list bug. Peter Geoghegan <pg@bowt.ie>
2026-08-19 17:47 pgsql: Fix GIN multiple-VACUUM-scans pending list bug. Peter Geoghegan <pg@bowt.ie>
2026-08-19 17:47 pgsql: Fix GIN multiple-VACUUM-scans pending list bug. Peter Geoghegan <pg@bowt.ie>
2026-08-19 17:47 pgsql: Fix GIN multiple-VACUUM-scans pending list bug. Peter Geoghegan <pg@bowt.ie>

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