pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Fix assertion failure when updating full_page_writes for checkpo
7+ messages / 2 participants
[nested] [flat]
* pgsql: Fix assertion failure when updating full_page_writes for checkpo
@ 2018-09-28 11:42 Amit Kapila <akapila@postgresql.org>
0 siblings, 0 replies; 7+ messages in thread
From: Amit Kapila @ 2018-09-28 11:42 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix assertion failure when updating full_page_writes for checkpointer.
When the checkpointer receives a SIGHUP signal to update its configuration,
it may need to update the shared memory for full_page_writes and need to
write a WAL record for it. Now, it is quite possible that the XLOG
machinery has not been initialized by that time and it will lead to
assertion failure while doing that. Fix is to allow the initialization of
the XLOG machinery outside critical section.
This bug has been introduced by the commit 2c03216d83 which added the XLOG
machinery initialization in RecoveryInProgress code path.
Reported-by: Dilip Kumar
Author: Dilip Kumar
Reviewed-by: Michael Paquier and Amit Kapila
Backpatch-through: 9.5
Discussion: https://postgr.es/m/CAFiTN-u4BA8KXcQUWDPNgaKAjDXC=C2whnzBM8TAcv=stckYUw@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a86bf6057edf7bc344f1ab6ba7824b561ed9068a
Modified Files
--------------
src/backend/access/transam/xlog.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix assertion failure when updating full_page_writes for checkpo
@ 2018-09-28 11:42 Amit Kapila <akapila@postgresql.org>
0 siblings, 0 replies; 7+ messages in thread
From: Amit Kapila @ 2018-09-28 11:42 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix assertion failure when updating full_page_writes for checkpointer.
When the checkpointer receives a SIGHUP signal to update its configuration,
it may need to update the shared memory for full_page_writes and need to
write a WAL record for it. Now, it is quite possible that the XLOG
machinery has not been initialized by that time and it will lead to
assertion failure while doing that. Fix is to allow the initialization of
the XLOG machinery outside critical section.
This bug has been introduced by the commit 2c03216d83 which added the XLOG
machinery initialization in RecoveryInProgress code path.
Reported-by: Dilip Kumar
Author: Dilip Kumar
Reviewed-by: Michael Paquier and Amit Kapila
Backpatch-through: 9.5
Discussion: https://postgr.es/m/CAFiTN-u4BA8KXcQUWDPNgaKAjDXC=C2whnzBM8TAcv=stckYUw@mail.gmail.com
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/6c8671bc395c9be44571e424c458b94ec20975d3
Modified Files
--------------
src/backend/access/transam/xlog.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix assertion failure when updating full_page_writes for checkpo
@ 2018-09-28 11:42 Amit Kapila <akapila@postgresql.org>
0 siblings, 0 replies; 7+ messages in thread
From: Amit Kapila @ 2018-09-28 11:42 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix assertion failure when updating full_page_writes for checkpointer.
When the checkpointer receives a SIGHUP signal to update its configuration,
it may need to update the shared memory for full_page_writes and need to
write a WAL record for it. Now, it is quite possible that the XLOG
machinery has not been initialized by that time and it will lead to
assertion failure while doing that. Fix is to allow the initialization of
the XLOG machinery outside critical section.
This bug has been introduced by the commit 2c03216d83 which added the XLOG
machinery initialization in RecoveryInProgress code path.
Reported-by: Dilip Kumar
Author: Dilip Kumar
Reviewed-by: Michael Paquier and Amit Kapila
Backpatch-through: 9.5
Discussion: https://postgr.es/m/CAFiTN-u4BA8KXcQUWDPNgaKAjDXC=C2whnzBM8TAcv=stckYUw@mail.gmail.com
Branch
------
REL_10_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/8256d7ae9ee3f8fec4bbe763b042b62d684e623f
Modified Files
--------------
src/backend/access/transam/xlog.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix assertion failure when updating full_page_writes for checkpo
@ 2018-09-28 11:42 Amit Kapila <akapila@postgresql.org>
0 siblings, 0 replies; 7+ messages in thread
From: Amit Kapila @ 2018-09-28 11:42 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix assertion failure when updating full_page_writes for checkpointer.
When the checkpointer receives a SIGHUP signal to update its configuration,
it may need to update the shared memory for full_page_writes and need to
write a WAL record for it. Now, it is quite possible that the XLOG
machinery has not been initialized by that time and it will lead to
assertion failure while doing that. Fix is to allow the initialization of
the XLOG machinery outside critical section.
This bug has been introduced by the commit 2c03216d83 which added the XLOG
machinery initialization in RecoveryInProgress code path.
Reported-by: Dilip Kumar
Author: Dilip Kumar
Reviewed-by: Michael Paquier and Amit Kapila
Backpatch-through: 9.5
Discussion: https://postgr.es/m/CAFiTN-u4BA8KXcQUWDPNgaKAjDXC=C2whnzBM8TAcv=stckYUw@mail.gmail.com
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/e315bd7db96a8cd41207cec1f036afffb282640e
Modified Files
--------------
src/backend/access/transam/xlog.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix assertion failure when updating full_page_writes for checkpo
@ 2018-09-28 11:42 Amit Kapila <akapila@postgresql.org>
0 siblings, 0 replies; 7+ messages in thread
From: Amit Kapila @ 2018-09-28 11:42 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix assertion failure when updating full_page_writes for checkpointer.
When the checkpointer receives a SIGHUP signal to update its configuration,
it may need to update the shared memory for full_page_writes and need to
write a WAL record for it. Now, it is quite possible that the XLOG
machinery has not been initialized by that time and it will lead to
assertion failure while doing that. Fix is to allow the initialization of
the XLOG machinery outside critical section.
This bug has been introduced by the commit 2c03216d83 which added the XLOG
machinery initialization in RecoveryInProgress code path.
Reported-by: Dilip Kumar
Author: Dilip Kumar
Reviewed-by: Michael Paquier and Amit Kapila
Backpatch-through: 9.5
Discussion: https://postgr.es/m/CAFiTN-u4BA8KXcQUWDPNgaKAjDXC=C2whnzBM8TAcv=stckYUw@mail.gmail.com
Branch
------
REL9_5_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/85cc9c4e2da88d7a1d160e091ec41f3fed7d271b
Modified Files
--------------
src/backend/access/transam/xlog.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix assertion failure when updating stats_fetch_consistency in a
@ 2023-05-10 02:25 Michael Paquier <michael@paquier.xyz>
0 siblings, 0 replies; 7+ messages in thread
From: Michael Paquier @ 2023-05-10 02:25 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix assertion failure when updating stats_fetch_consistency in a transaction
An update of the GUC stats_fetch_consistency in a transaction would be
able to trigger an assertion when doing cache->snapshot. In this case,
when retrieving a pgstat entry after the switch, a new snapshot would be
rebuilt, confusing pgstat_build_snapshot() because a snapshot is already
cached with an unexpected mode ("cache").
In order to fix this problem, this commit adds a flag to force a
snapshot clear each time this GUC is changed. Some tests are added to
check, while on it.
Some optimizations in avoiding the snapshot clear should be possible
depending on what is cached and the current GUC value, I guess, but this
solution is simple, and ensures that the state of the cache is updated
each time a new pgstat entry is fetched, hence being consistent with the
level wanted by the client that has set the GUC.
Note that cache->none and snapshot->none would not cause issues, as
fetching a pgstat entry would be retrieved from shared memory on the
second attempt, however a snapshot would still be cached. Similarly,
none->snapshot and none->cache would build a new snapshot on the second
fetch attempt. Finally, snapshot->cache would cache a new snapshot on
the second attempt.
Reported-by: Alexander Lakhin
Author: Kyotaro Horiguchi
Discussion: https://postgr.es/m/17804-2a118cd046f2d0e5@postgresql.org
backpatch-through: 15
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/605994651b6a4209b418cb09d3c223ca269f7cfc
Modified Files
--------------
doc/src/sgml/config.sgml | 5 ++--
src/backend/utils/activity/pgstat.c | 36 ++++++++++++++++++++--
src/backend/utils/misc/guc_tables.c | 2 +-
src/include/utils/guc_hooks.h | 1 +
src/test/regress/expected/stats.out | 59 +++++++++++++++++++++++++++++++++++++
src/test/regress/sql/stats.sql | 20 +++++++++++++
6 files changed, 118 insertions(+), 5 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix assertion failure when updating stats_fetch_consistency in a
@ 2023-05-10 02:25 Michael Paquier <michael@paquier.xyz>
0 siblings, 0 replies; 7+ messages in thread
From: Michael Paquier @ 2023-05-10 02:25 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix assertion failure when updating stats_fetch_consistency in a transaction
An update of the GUC stats_fetch_consistency in a transaction would be
able to trigger an assertion when doing cache->snapshot. In this case,
when retrieving a pgstat entry after the switch, a new snapshot would be
rebuilt, confusing pgstat_build_snapshot() because a snapshot is already
cached with an unexpected mode ("cache").
In order to fix this problem, this commit adds a flag to force a
snapshot clear each time this GUC is changed. Some tests are added to
check, while on it.
Some optimizations in avoiding the snapshot clear should be possible
depending on what is cached and the current GUC value, I guess, but this
solution is simple, and ensures that the state of the cache is updated
each time a new pgstat entry is fetched, hence being consistent with the
level wanted by the client that has set the GUC.
Note that cache->none and snapshot->none would not cause issues, as
fetching a pgstat entry would be retrieved from shared memory on the
second attempt, however a snapshot would still be cached. Similarly,
none->snapshot and none->cache would build a new snapshot on the second
fetch attempt. Finally, snapshot->cache would cache a new snapshot on
the second attempt.
Reported-by: Alexander Lakhin
Author: Kyotaro Horiguchi
Discussion: https://postgr.es/m/17804-2a118cd046f2d0e5@postgresql.org
backpatch-through: 15
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/ccd21e1cfa11fa4f39d01d95cf119beae9cf4d20
Modified Files
--------------
doc/src/sgml/config.sgml | 5 ++--
src/backend/utils/activity/pgstat.c | 34 ++++++++++++++++++++-
src/backend/utils/misc/guc.c | 2 +-
src/include/pgstat.h | 2 ++
src/test/regress/expected/stats.out | 59 +++++++++++++++++++++++++++++++++++++
src/test/regress/sql/stats.sql | 20 +++++++++++++
6 files changed, 118 insertions(+), 4 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2023-05-10 02:25 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-28 11:42 pgsql: Fix assertion failure when updating full_page_writes for checkpo Amit Kapila <akapila@postgresql.org>
2018-09-28 11:42 pgsql: Fix assertion failure when updating full_page_writes for checkpo Amit Kapila <akapila@postgresql.org>
2018-09-28 11:42 pgsql: Fix assertion failure when updating full_page_writes for checkpo Amit Kapila <akapila@postgresql.org>
2018-09-28 11:42 pgsql: Fix assertion failure when updating full_page_writes for checkpo Amit Kapila <akapila@postgresql.org>
2018-09-28 11:42 pgsql: Fix assertion failure when updating full_page_writes for checkpo Amit Kapila <akapila@postgresql.org>
2023-05-10 02:25 pgsql: Fix assertion failure when updating stats_fetch_consistency in a Michael Paquier <michael@paquier.xyz>
2023-05-10 02:25 pgsql: Fix assertion failure when updating stats_fetch_consistency in a Michael Paquier <michael@paquier.xyz>
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