pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Prevent GIN deleted pages from being reclaimed too early
6+ messages / 1 participants
[nested] [flat]

* pgsql: Prevent GIN deleted pages from being reclaimed too early
@ 2018-12-13 03:55 Alexander Korotkov <akorotkov@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2018-12-13 03:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent GIN deleted pages from being reclaimed too early

When GIN vacuum deletes a posting tree page, it assumes that no concurrent
searchers can access it, thanks to ginStepRight() locking two pages at once.
However, since 9.4 searches can skip parts of posting trees descending from the
root.  That leads to the risk that page is deleted and reclaimed before
concurrent search can access it.

This commit prevents the risk of above by waiting for every transaction, which
might wait to reference this page, to finish.  Due to binary compatibility
we can't change GinPageOpaqueData to store corresponding transaction id.
Instead we reuse page header pd_prune_xid field, which is unused in index pages.

Discussion: https://postgr.es/m/31a702a.14dd.166c1366ac1.Coremail.chjischj%40163.com
Author: Andrey Borodin, Alexander Korotkov
Reviewed-by: Alexander Korotkov
Backpatch-through: 9.4

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/access/gin/README      | 10 ++++------
src/backend/access/gin/ginutil.c   |  7 +------
src/backend/access/gin/ginvacuum.c |  6 +++++-
src/backend/access/gin/ginxlog.c   |  1 +
src/include/access/ginblock.h      | 10 ++++++++++
src/include/access/ginxlog.h       |  1 +
6 files changed, 22 insertions(+), 13 deletions(-)



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

* pgsql: Prevent GIN deleted pages from being reclaimed too early
@ 2018-12-13 03:56 Alexander Korotkov <akorotkov@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2018-12-13 03:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent GIN deleted pages from being reclaimed too early

When GIN vacuum deletes a posting tree page, it assumes that no concurrent
searchers can access it, thanks to ginStepRight() locking two pages at once.
However, since 9.4 searches can skip parts of posting trees descending from the
root.  That leads to the risk that page is deleted and reclaimed before
concurrent search can access it.

This commit prevents the risk of above by waiting for every transaction, which
might wait to reference this page, to finish.  Due to binary compatibility
we can't change GinPageOpaqueData to store corresponding transaction id.
Instead we reuse page header pd_prune_xid field, which is unused in index pages.

Discussion: https://postgr.es/m/31a702a.14dd.166c1366ac1.Coremail.chjischj%40163.com
Author: Andrey Borodin, Alexander Korotkov
Reviewed-by: Alexander Korotkov
Backpatch-through: 9.4

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/access/gin/README      | 10 ++++------
src/backend/access/gin/ginutil.c   |  7 +------
src/backend/access/gin/ginvacuum.c |  6 +++++-
src/backend/access/gin/ginxlog.c   |  1 +
src/include/access/ginblock.h      | 10 ++++++++++
src/include/access/ginxlog.h       |  1 +
6 files changed, 22 insertions(+), 13 deletions(-)



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

* pgsql: Prevent GIN deleted pages from being reclaimed too early
@ 2018-12-13 03:56 Alexander Korotkov <akorotkov@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2018-12-13 03:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent GIN deleted pages from being reclaimed too early

When GIN vacuum deletes a posting tree page, it assumes that no concurrent
searchers can access it, thanks to ginStepRight() locking two pages at once.
However, since 9.4 searches can skip parts of posting trees descending from the
root.  That leads to the risk that page is deleted and reclaimed before
concurrent search can access it.

This commit prevents the risk of above by waiting for every transaction, which
might wait to reference this page, to finish.  Due to binary compatibility
we can't change GinPageOpaqueData to store corresponding transaction id.
Instead we reuse page header pd_prune_xid field, which is unused in index pages.

Discussion: https://postgr.es/m/31a702a.14dd.166c1366ac1.Coremail.chjischj%40163.com
Author: Andrey Borodin, Alexander Korotkov
Reviewed-by: Alexander Korotkov
Backpatch-through: 9.4

Branch
------
REL9_6_STABLE

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

Modified Files
--------------
src/backend/access/gin/README      | 10 ++++------
src/backend/access/gin/ginutil.c   |  7 +------
src/backend/access/gin/ginvacuum.c |  6 +++++-
src/backend/access/gin/ginxlog.c   |  1 +
src/include/access/gin_private.h   | 11 +++++++++++
5 files changed, 22 insertions(+), 13 deletions(-)



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

* pgsql: Prevent GIN deleted pages from being reclaimed too early
@ 2018-12-13 03:56 Alexander Korotkov <akorotkov@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2018-12-13 03:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent GIN deleted pages from being reclaimed too early

When GIN vacuum deletes a posting tree page, it assumes that no concurrent
searchers can access it, thanks to ginStepRight() locking two pages at once.
However, since 9.4 searches can skip parts of posting trees descending from the
root.  That leads to the risk that page is deleted and reclaimed before
concurrent search can access it.

This commit prevents the risk of above by waiting for every transaction, which
might wait to reference this page, to finish.  Due to binary compatibility
we can't change GinPageOpaqueData to store corresponding transaction id.
Instead we reuse page header pd_prune_xid field, which is unused in index pages.

Discussion: https://postgr.es/m/31a702a.14dd.166c1366ac1.Coremail.chjischj%40163.com
Author: Andrey Borodin, Alexander Korotkov
Reviewed-by: Alexander Korotkov
Backpatch-through: 9.4

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
src/backend/access/gin/README      | 10 ++++------
src/backend/access/gin/ginutil.c   |  7 +------
src/backend/access/gin/ginvacuum.c |  6 +++++-
src/backend/access/gin/ginxlog.c   |  1 +
src/include/access/gin_private.h   | 14 +++++++++++++-
5 files changed, 24 insertions(+), 14 deletions(-)



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

* pgsql: Prevent GIN deleted pages from being reclaimed too early
@ 2018-12-13 03:56 Alexander Korotkov <akorotkov@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2018-12-13 03:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent GIN deleted pages from being reclaimed too early

When GIN vacuum deletes a posting tree page, it assumes that no concurrent
searchers can access it, thanks to ginStepRight() locking two pages at once.
However, since 9.4 searches can skip parts of posting trees descending from the
root.  That leads to the risk that page is deleted and reclaimed before
concurrent search can access it.

This commit prevents the risk of above by waiting for every transaction, which
might wait to reference this page, to finish.  Due to binary compatibility
we can't change GinPageOpaqueData to store corresponding transaction id.
Instead we reuse page header pd_prune_xid field, which is unused in index pages.

Discussion: https://postgr.es/m/31a702a.14dd.166c1366ac1.Coremail.chjischj%40163.com
Author: Andrey Borodin, Alexander Korotkov
Reviewed-by: Alexander Korotkov
Backpatch-through: 9.4

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1cf175c74f103e9f0905c41d761940282c3d21f1

Modified Files
--------------
src/backend/access/gin/README      | 10 ++++------
src/backend/access/gin/ginutil.c   |  7 +------
src/backend/access/gin/ginvacuum.c |  6 +++++-
src/include/access/gin_private.h   | 12 ++++++++++++
4 files changed, 22 insertions(+), 13 deletions(-)



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

* pgsql: Prevent GIN deleted pages from being reclaimed too early
@ 2018-12-13 03:56 Alexander Korotkov <akorotkov@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2018-12-13 03:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent GIN deleted pages from being reclaimed too early

When GIN vacuum deletes a posting tree page, it assumes that no concurrent
searchers can access it, thanks to ginStepRight() locking two pages at once.
However, since 9.4 searches can skip parts of posting trees descending from the
root.  That leads to the risk that page is deleted and reclaimed before
concurrent search can access it.

This commit prevents the risk of above by waiting for every transaction, which
might wait to reference this page, to finish.  Due to binary compatibility
we can't change GinPageOpaqueData to store corresponding transaction id.
Instead we reuse page header pd_prune_xid field, which is unused in index pages.

Discussion: https://postgr.es/m/31a702a.14dd.166c1366ac1.Coremail.chjischj%40163.com
Author: Andrey Borodin, Alexander Korotkov
Reviewed-by: Alexander Korotkov
Backpatch-through: 9.4

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/52ac6cd2d0cd70e01291e0ac4ee6d068b69bc478

Modified Files
--------------
src/backend/access/gin/README      | 10 ++++------
src/backend/access/gin/ginutil.c   |  7 +------
src/backend/access/gin/ginvacuum.c |  6 +++++-
src/backend/access/gin/ginxlog.c   |  1 +
src/include/access/ginblock.h      | 10 ++++++++++
src/include/access/ginxlog.h       |  1 +
6 files changed, 22 insertions(+), 13 deletions(-)



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


end of thread, other threads:[~2018-12-13 03:56 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13 03:55 pgsql: Prevent GIN deleted pages from being reclaimed too early Alexander Korotkov <akorotkov@postgresql.org>
2018-12-13 03:56 pgsql: Prevent GIN deleted pages from being reclaimed too early Alexander Korotkov <akorotkov@postgresql.org>
2018-12-13 03:56 pgsql: Prevent GIN deleted pages from being reclaimed too early Alexander Korotkov <akorotkov@postgresql.org>
2018-12-13 03:56 pgsql: Prevent GIN deleted pages from being reclaimed too early Alexander Korotkov <akorotkov@postgresql.org>
2018-12-13 03:56 pgsql: Prevent GIN deleted pages from being reclaimed too early Alexander Korotkov <akorotkov@postgresql.org>
2018-12-13 03:56 pgsql: Prevent GIN deleted pages from being reclaimed too early Alexander Korotkov <akorotkov@postgresql.org>

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