pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix hash bucket split buffer pin leak.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix hash bucket split buffer pin leak.
@ 2026-10-14 18:27 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-10-14 18:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix hash bucket split buffer pin leak.

The process by which a hash index inserter finishes an incomplete bucket
split involves a walk of the new bucket (the bucket "being populated")
to collect the TIDs that the interrupted split already moved.  This
process keeps a pin on the new bucket's primary page, and then takes
conditional cleanup locks on both buckets.  When either lock could not
be acquired, we gave up, but neglected to release the new bucket's pin.

To fix, release the buffer pin on failure.

Oversight in commit 6d46f4783, which improved hash index bucket split
behavior by switching it from using a heavyweight lock to using these
cleanup locks.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/CAH2-Wz=b9sSBv15HsgZAuazjJu8-YRGHOpLjvp+dJgEDaBx0Ng@mail.gmail.com
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/49103c3cd639d42eaa26eb2076b621deec0e03f3

Modified Files
--------------
src/backend/access/hash/hashpage.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Fix hash bucket split buffer pin leak.
@ 2026-10-14 18:27 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-10-14 18:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix hash bucket split buffer pin leak.

The process by which a hash index inserter finishes an incomplete bucket
split involves a walk of the new bucket (the bucket "being populated")
to collect the TIDs that the interrupted split already moved.  This
process keeps a pin on the new bucket's primary page, and then takes
conditional cleanup locks on both buckets.  When either lock could not
be acquired, we gave up, but neglected to release the new bucket's pin.

To fix, release the buffer pin on failure.

Oversight in commit 6d46f4783, which improved hash index bucket split
behavior by switching it from using a heavyweight lock to using these
cleanup locks.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/CAH2-Wz=b9sSBv15HsgZAuazjJu8-YRGHOpLjvp+dJgEDaBx0Ng@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_19_STABLE

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

Modified Files
--------------
src/backend/access/hash/hashpage.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Fix hash bucket split buffer pin leak.
@ 2026-10-14 18:27 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-10-14 18:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix hash bucket split buffer pin leak.

The process by which a hash index inserter finishes an incomplete bucket
split involves a walk of the new bucket (the bucket "being populated")
to collect the TIDs that the interrupted split already moved.  This
process keeps a pin on the new bucket's primary page, and then takes
conditional cleanup locks on both buckets.  When either lock could not
be acquired, we gave up, but neglected to release the new bucket's pin.

To fix, release the buffer pin on failure.

Oversight in commit 6d46f4783, which improved hash index bucket split
behavior by switching it from using a heavyweight lock to using these
cleanup locks.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/CAH2-Wz=b9sSBv15HsgZAuazjJu8-YRGHOpLjvp+dJgEDaBx0Ng@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_18_STABLE

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

Modified Files
--------------
src/backend/access/hash/hashpage.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Fix hash bucket split buffer pin leak.
@ 2026-10-14 18:27 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-10-14 18:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix hash bucket split buffer pin leak.

The process by which a hash index inserter finishes an incomplete bucket
split involves a walk of the new bucket (the bucket "being populated")
to collect the TIDs that the interrupted split already moved.  This
process keeps a pin on the new bucket's primary page, and then takes
conditional cleanup locks on both buckets.  When either lock could not
be acquired, we gave up, but neglected to release the new bucket's pin.

To fix, release the buffer pin on failure.

Oversight in commit 6d46f4783, which improved hash index bucket split
behavior by switching it from using a heavyweight lock to using these
cleanup locks.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/CAH2-Wz=b9sSBv15HsgZAuazjJu8-YRGHOpLjvp+dJgEDaBx0Ng@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_17_STABLE

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

Modified Files
--------------
src/backend/access/hash/hashpage.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Fix hash bucket split buffer pin leak.
@ 2026-10-14 18:27 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-10-14 18:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix hash bucket split buffer pin leak.

The process by which a hash index inserter finishes an incomplete bucket
split involves a walk of the new bucket (the bucket "being populated")
to collect the TIDs that the interrupted split already moved.  This
process keeps a pin on the new bucket's primary page, and then takes
conditional cleanup locks on both buckets.  When either lock could not
be acquired, we gave up, but neglected to release the new bucket's pin.

To fix, release the buffer pin on failure.

Oversight in commit 6d46f4783, which improved hash index bucket split
behavior by switching it from using a heavyweight lock to using these
cleanup locks.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/CAH2-Wz=b9sSBv15HsgZAuazjJu8-YRGHOpLjvp+dJgEDaBx0Ng@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_16_STABLE

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

Modified Files
--------------
src/backend/access/hash/hashpage.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Fix hash bucket split buffer pin leak.
@ 2026-10-14 18:27 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-10-14 18:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix hash bucket split buffer pin leak.

The process by which a hash index inserter finishes an incomplete bucket
split involves a walk of the new bucket (the bucket "being populated")
to collect the TIDs that the interrupted split already moved.  This
process keeps a pin on the new bucket's primary page, and then takes
conditional cleanup locks on both buckets.  When either lock could not
be acquired, we gave up, but neglected to release the new bucket's pin.

To fix, release the buffer pin on failure.

Oversight in commit 6d46f4783, which improved hash index bucket split
behavior by switching it from using a heavyweight lock to using these
cleanup locks.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/CAH2-Wz=b9sSBv15HsgZAuazjJu8-YRGHOpLjvp+dJgEDaBx0Ng@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4f45920f04f122dae244077da7286f39913c93fb

Modified Files
--------------
src/backend/access/hash/hashpage.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Fix hash bucket split buffer pin leak.
@ 2026-10-14 18:27 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2026-10-14 18:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix hash bucket split buffer pin leak.

The process by which a hash index inserter finishes an incomplete bucket
split involves a walk of the new bucket (the bucket "being populated")
to collect the TIDs that the interrupted split already moved.  This
process keeps a pin on the new bucket's primary page, and then takes
conditional cleanup locks on both buckets.  When either lock could not
be acquired, we gave up, but neglected to release the new bucket's pin.

To fix, release the buffer pin on failure.

Oversight in commit 6d46f4783, which improved hash index bucket split
behavior by switching it from using a heavyweight lock to using these
cleanup locks.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/CAH2-Wz=b9sSBv15HsgZAuazjJu8-YRGHOpLjvp+dJgEDaBx0Ng@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3eaa726e7be562bc6231e01bd8620909df4fb6b7

Modified Files
--------------
src/backend/access/hash/hashpage.c | 2 ++
1 file changed, 2 insertions(+)



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


end of thread, other threads:[~2026-10-14 18:27 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 18:27 pgsql: Fix hash bucket split buffer pin leak. Peter Geoghegan <pg@bowt.ie>
2026-10-14 18:27 pgsql: Fix hash bucket split buffer pin leak. Peter Geoghegan <pg@bowt.ie>
2026-10-14 18:27 pgsql: Fix hash bucket split buffer pin leak. Peter Geoghegan <pg@bowt.ie>
2026-10-14 18:27 pgsql: Fix hash bucket split buffer pin leak. Peter Geoghegan <pg@bowt.ie>
2026-10-14 18:27 pgsql: Fix hash bucket split buffer pin leak. Peter Geoghegan <pg@bowt.ie>
2026-10-14 18:27 pgsql: Fix hash bucket split buffer pin leak. Peter Geoghegan <pg@bowt.ie>
2026-10-14 18:27 pgsql: Fix hash bucket split buffer pin leak. 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