-
- Downloads
Enable logical slots to follow timeline switches
When decoding from a logical slot, it's necessary for xlog reading to be able to read xlog from historical (i.e. not current) timelines; otherwise, decoding fails after failover, because the archives are in the historical timeline. This is required to make "failover logical slots" possible; it currently has no other use, although theoretically it could be used by an extension that creates a slot on a standby and continues to replay from the slot when the standby is promoted. This commit includes a module in src/test/modules with functions to manipulate the slots (which is not otherwise possible in SQL code) in order to enable testing, and a new test in src/test/recovery to ensure that the behavior is as expected. Author: Craig Ringer Reviewed-By: Oleksii Kliukin, Andres Freund, Petr Jelínek
Showing
- src/backend/access/transam/xlogreader.c 9 additions, 0 deletionssrc/backend/access/transam/xlogreader.c
- src/backend/access/transam/xlogutils.c 221 additions, 23 deletionssrc/backend/access/transam/xlogutils.c
- src/backend/replication/logical/logicalfuncs.c 9 additions, 8 deletionssrc/backend/replication/logical/logicalfuncs.c
- src/include/access/xlogreader.h 18 additions, 0 deletionssrc/include/access/xlogreader.h
- src/test/modules/Makefile 1 addition, 0 deletionssrc/test/modules/Makefile
- src/test/modules/test_slot_timelines/.gitignore 3 additions, 0 deletionssrc/test/modules/test_slot_timelines/.gitignore
- src/test/modules/test_slot_timelines/Makefile 22 additions, 0 deletionssrc/test/modules/test_slot_timelines/Makefile
- src/test/modules/test_slot_timelines/README 19 additions, 0 deletionssrc/test/modules/test_slot_timelines/README
- src/test/modules/test_slot_timelines/expected/load_extension.out 19 additions, 0 deletions...t/modules/test_slot_timelines/expected/load_extension.out
- src/test/modules/test_slot_timelines/sql/load_extension.sql 7 additions, 0 deletionssrc/test/modules/test_slot_timelines/sql/load_extension.sql
- src/test/modules/test_slot_timelines/test_slot_timelines--1.0.sql 16 additions, 0 deletions.../modules/test_slot_timelines/test_slot_timelines--1.0.sql
- src/test/modules/test_slot_timelines/test_slot_timelines.c 133 additions, 0 deletionssrc/test/modules/test_slot_timelines/test_slot_timelines.c
- src/test/modules/test_slot_timelines/test_slot_timelines.conf 2 additions, 0 deletions...test/modules/test_slot_timelines/test_slot_timelines.conf
- src/test/modules/test_slot_timelines/test_slot_timelines.control 5 additions, 0 deletions...t/modules/test_slot_timelines/test_slot_timelines.control
- src/test/recovery/Makefile 2 additions, 0 deletionssrc/test/recovery/Makefile
- src/test/recovery/t/006_logical_decoding_timelines.pl 304 additions, 0 deletionssrc/test/recovery/t/006_logical_decoding_timelines.pl
src/test/modules/test_slot_timelines/README
0 → 100644
Please register or sign in to comment