mirror of
https://github.com/postgres/postgres.git
synced 2025-07-24 14:22:24 +03:00
Stabilize 035_standby_logical_decoding.pl.
Some tests try to invalidate logical slots on the standby server by running VACUUM on the primary. The problem is that xl_running_xacts was getting generated and replayed before the VACUUM command, leading to the advancement of the active slot's catalog_xmin. Due to this, active slots were not getting invalidated, leading to test failures. We fix it by skipping the generation of xl_running_xacts for the required tests with the help of injection points. As the required interface for injection points was not present in back branches, we fixed the failing tests in them by disallowing the slot to become active for the required cases (where rows_removed conflict could be generated). Author: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Backpatch-through: 16, where it was introduced Discussion: https://postgr.es/m/Z6oQXc8LmiTLfwLA@ip-10-97-1-34.eu-west-3.compute.internal
This commit is contained in:
@ -31,6 +31,7 @@
|
||||
#include "storage/sinvaladt.h"
|
||||
#include "storage/standby.h"
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/injection_point.h"
|
||||
#include "utils/ps_status.h"
|
||||
#include "utils/timeout.h"
|
||||
#include "utils/timestamp.h"
|
||||
@ -1287,6 +1288,17 @@ LogStandbySnapshot(void)
|
||||
|
||||
Assert(XLogStandbyInfoActive());
|
||||
|
||||
#ifdef USE_INJECTION_POINTS
|
||||
if (IS_INJECTION_POINT_ATTACHED("skip-log-running-xacts"))
|
||||
{
|
||||
/*
|
||||
* This record could move slot's xmin forward during decoding, leading
|
||||
* to unpredictable results, so skip it when requested by the test.
|
||||
*/
|
||||
return GetInsertRecPtr();
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get details of any AccessExclusiveLocks being held at the moment.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user