Skip to content

Conversation

@danolivo
Copy link
Contributor

@danolivo danolivo commented Jan 20, 2026

There are several questions that may arise if you look more closely at the changed code. But we just fixed the problem here.

- Add new excluded_schema regression test
- Reformat multi-parameter SQL function definitions for readability
  (sub_create, sub_show_status, repset_create, repset_drop)

This test demonstrates two issues:
1. table from an 'excluded' schema disables subscription.
2. Spock tests are unstable.
Previous commits exposed test instability due to non-deterministic ordering
in query results.

Changes made to stabilize output:

- Replace SELECT * FROM spock.sub_create() with SELECT 1 FROM spock.sub_create()
  to avoid returning implementation-dependent OIDs.
- Queries on spock.local_sync_status now join with spock.subscription to display
  subscription names instead of internal IDs, with proper ORDER BY on sub_name
  (using COLLATE "C") and additional columns (sync_kind, sync_nspname,
  sync_relname) where needed.
- Add ORDER BY subscription_name COLLATE "C" to spock.sub_show_status() calls.
@danolivo danolivo requested a review from mason-sharp January 20, 2026 08:53
@danolivo danolivo self-assigned this Jan 20, 2026
@danolivo danolivo added the enhancement New feature or request label Jan 20, 2026
Centralize extension and schema skipping logic into helper functions
build_exclude_extension_string() and build_exclude_schema_string().
Use dynamic list instead of fixed-size array for argument construction.

Global skip lists for schemas and extensions (spock, lolor, snowflake)
are now defined in spock_node.c and exported via spock_node.h.
@danolivo danolivo changed the title Demo for the issue Spoc 387 + regression tests stabilisation Spoc 387 + regression tests stabilisation Jan 20, 2026
Previously, tables in ignored schemas (spock, lolor, snowflake) could be
added to replication sets, which would then cause replication failures
at runtime. This change adds proactive validation that rejects such
tables at the time they are added to a replication set, providing clear
error messages with hints for resolution.

Add EnsureRelationNotIgnored() function that checks both the global
skip_schema and skip_extension lists. Call it from both
replication_set_add_table() and replication_set_add_seq().

Also fix PG17 compatibility by using CheckRelationOidLockedByMe()
instead of LockHeldByMe() with LOCKTAG, and move the test helper
function pg_current_xlog_location() to the spock schema to avoid
potential conflicts with user functions in public schema.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants