Re: Synchronizing slots from primary to standby
От | shveta malik |
---|---|
Тема | Re: Synchronizing slots from primary to standby |
Дата | |
Msg-id | CAJpy0uCQ2PDCAqcnbdOz6q_ZqmBfMyBpVqKDqL_XZBP=eK-1yw@mail.gmail.com обсуждение исходный текст |
Ответ на | RE: Synchronizing slots from primary to standby ("Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>) |
Список | pgsql-hackers |
On Fri, Mar 29, 2024 at 6:36 AM Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com> wrote: > > Attach a new version patch which fixed an un-initialized variable issue and > added some comments. Also, temporarily enable DEBUG2 for the 040 tap-test so that > we can analyze the possible CFbot failures easily. As suggested by Amit in [1], for the fix being discussed where we need to advance the synced slot on standby, we need to skip the dbid check in fast_forward mode in CreateDecodingContext(). We tried few tests to make sure that there was no table-access done during fast-forward mode 1) Initially we tried avoiding database-id check in CreateDecodingContext() only when called by pg_logical_replication_slot_advance(). 'make check-world' passed on HEAD for the same. 2) But the more generic solution was to skip the database check if "fast_forward" is true. It was tried and 'make check-world' passed on HEAD for that as well. 3) Another thing tried by Hou-San was to run pgbench after skipping db check in the fast_forward logical decoding case. pgbench was run to generate some changes and then the logical slot was advanced to the latest position in another database. A LOG was added in relation_open to catch table access. It was found that there was no table-access in fast forward logical decoding i.e. no LOGS for table-open were generated during the test. Steps given at [2] [1]: https://www.postgresql.org/message-id/CAA4eK1KMiKangJa4NH_K1oFc87Y01n3rnpuwYagT59Y%3DADW8Dw%40mail.gmail.com [2]: -------------- 1. apply the DEBUG patch (attached as .txt) which will log the relation open and table cache access. 2. create a slot: SELECT 'init' FROM pg_create_logical_replication_slot('logicalslot', 'test_decoding', false, false, true); 3. run pgbench to generate some data. pgbench -i postgres pgbench --aggregate-interval=5 --time=5 --client=10 --log --rate=1000 --latency-limit=10 --failures-detailed --max-tries=10 postgres 4. start a fresh session in a different db and advance the slot to the latest position. There should be no relation open or CatCache log between the LOG "starting logical decoding for slot .." and LOG "decoding over". SELECT pg_replication_slot_advance('logicalslot', pg_current_wal_lsn()); -------------- thanks Shveta
Вложения
В списке pgsql-hackers по дате отправления: