On Tue, 6 Feb 2024 at 08:30, Alexander Lakhin <exclus...@gmail.com> wrote: > > Hello Amit, > > 05.02.2024 15:20, Amit Kapila wrote: > > If this can be reproduced frequently then we can even try to test the > > patch in that thread by Osumi-San [1] (I haven't tested that it > > applies cleanly but shouldn't be difficult to make it work) based on > > the theory that walsender is starting up at an LSN somewhere before > > where the publication is created. > > > > [1] - > > https://www.postgresql.org/message-id/TYCPR01MB83737A68CD5D554EA82BD7B9EDD39%40TYCPR01MB8373.jpnprd01.prod.outlook.com > > > > Yes, with the aforementioned modification of bgwriter.c and when running > 20 tests in parallel, I got failures on iterations 20. 3, 21 ..., but with the > updated Osumi-San's patch (which adds wait_for_catchup('sub1') before every > ALTER SUBSCRIPTION sub1 SET PUBLICATION ...) applied, 300 iterations ran > with no failures.
I was able to reproduce the issue with the patch changes suggested in bgwriter, but for me it failed in the 287th run. Then I had run the test 1000 times with the test changes shared at [1] and the test had passed all the 1000 times successfully. I have measured the test execution with average of 10 runs and found that it takes about 1.2 seconds more time to execute with the changes: Without patch: 8.454 seconds With test change patch: 9.672 seconds For the test execution comparison I had used a machine which has total Memory of 755.536 GB, 120 CPUs and RHEL 7 Operating System. [1] - https://www.postgresql.org/message-id/e6ce3cf7-4025-f129-e3ac-0f778469f720%40gmail.com Regards, Vignesh