Disable logical decoding as unsupported
authorTomas Vondra <[email protected]>
Wed, 30 Aug 2017 21:55:30 +0000 (23:55 +0200)
committerTomas Vondra <[email protected]>
Wed, 30 Aug 2017 22:12:25 +0000 (00:12 +0200)
Commit 665c224a6b2afa disabled CREATE PUBLICATION/SUBSCRIPTION, but
it was still possible to create a logical replication slot and call
pg_logical_slot_get_changes() on it.

That would however crash and burn as ReorderBufferCommit() relies on
subtransactions, and BeginInternalSubTransaction() is not expected
to fail, leading to segfaults in the PG_CATCH block.

Simply disallowing creating logical slots (and whatever else relies
on CheckLogicalDecodingRequirements) seems like the best fix.

src/backend/replication/logical/logical.c

index efb9785f25e5fc23f2c5149dee9e617706400e94..f6774df96f2ab88b662bb9b9d9bc045978e4ebd1 100644 (file)
@@ -77,6 +77,16 @@ CheckLogicalDecodingRequirements(void)
 {
        CheckSlotRequirements();
 
+       /*
+        * Postgres-XL does not support logical replication for now. We could create
+        * the logical replication slot, but attempts to decode the WAL would crash
+        * and burn as ReorderBufferCommit() uses subtransactions internally. We need
+        */
+       ereport(ERROR,
+                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                        errmsg("Postgres-XL does not support logical replication"),
+                        errdetail("The feature is not currently supported")));
+
        if (wal_level < WAL_LEVEL_LOGICAL)
                ereport(ERROR,
                                (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),