Skip to content

2.31.0.0-b176

@arpang arpang tagged this 18 Jun 03:20
Summary:
77482fb6a9a76621f35afcf6fce798027852ef05 / D49737 added "yb_system" YSQL database, which is meant for non-catalog global YSQL tables for YB's internal usage. Currently, its only has pg_yb_notifications table, which is used by LISTEN/NOTIFY.

Since yb_system hosts global tables, its tables can contain data belonging to all databases in the cluster. Replicating it via CDC can cause data from databases not part of the replication to be replicated.

This revision blocks CDC on yb_system database. But LISTEN/NOTIFY requires creating an internal CDC stream on this database. Ensure this continues to work by:
 - Reserving the "yb_notifications_" slot name prefix for LISTEN/NOTIFY internal slots. Users cannot create slots with this prefix.
 - Allowing only slots with the above prefix to create CDC streams on yb_system database.

Backport-through: 2025.2

Test Plan:
   ./yb_build.sh --java-test 'org.yb.pgsql.TestPgReplicationSlot#testCdcStreamOnYbSystemBlocked'
   ./yb_build.sh --java-test 'org.yb.pgsql.TestPgReplicationSlot#testReservedSlotNamePrefix'

Reviewers: sumukh.phalgaonkar, xCluster, hsunder, stiwary

Reviewed By: sumukh.phalgaonkar

Subscribers: yql, ybase

Differential Revision: https://phorge.dev.yugabyte.com/D52081
Assets 2
Loading