test: add physical and logical replication tests#263
Merged
Conversation
Add two new shell test scripts that verify pg_textsearch works correctly with Postgres replication: - replication.sh: Physical (streaming) replication tests 1. Standby starts up with replicated bm25 index 2. BM25 queries work on hot standby 3. Inserts on primary replicate to standby 4. Standby promotion preserves index functionality - logical_replication.sh: Logical replication tests 1. Initial table sync + index build on subscriber 2. INSERT replication with search verification 3. DELETE replication removes entries from search 4. UPDATE replication reflects new content in search Both physical and logical replication work correctly with the existing codebase. The lazy rebuild path in tp_get_local_index_state handles standby/subscriber startup by rebuilding memtable state from replicated on-disk pages.
- Add test-replication and test-logical-replication to .PHONY - Add comment explaining why replication tests are not in test-shell - Change warn to error for DELETE replication assertion - Change warn to error for post-promotion insert assertion - Add exit $exit_code at end of cleanup functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test-replicationandtest-logical-replicationMakefile targetsBoth replication modes work correctly with the existing codebase. The lazy rebuild path in
tp_get_local_index_state→tp_rebuild_index_from_diskhandles standby/subscriber startup by reconstructing memtable state from replicated on-disk pages (metapage, segments, docid pages).Testing
All 8 replication tests pass locally: