Skip relations dropped concurrently in GetSubscriptionRelations().

GetSubscriptionRelations() can see a pg_subscription_rel row for a
relation whose pg_class row was removed by a concurrent DROP. In this
case, get_rel_relkind() returns '\0'. Skip such relations since they no
longer exist and do not need synchronization.

Replace the assertion on relkind with an error. Once the dropped
relation case is handled, any other unexpected relkind indicates a
relation kind that cannot be part of a subscription and should be
reported rather than ignored.

Author: Vignesh C <[email protected]>
Reviewed-by: Amit Kapila <[email protected]>
Reviewed-by: Bharath Rupireddy <[email protected]>
Reviewed-by: Hayato Kuroda <[email protected]>
Reviewed-by: Kyotaro Horiguchi <[email protected]>
Backpatch-through: 19
Discussion: 
https://postgr.es/m/CALDaNm3eeKocRtQyUPdg2kaxJ-VAo5pwcNytDKNT1Yc0t2V_ug%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/05f37b2b5eac5feab774a990a64ad16e2d03f5f5

Modified Files
--------------
src/backend/catalog/pg_subscription.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)

Reply via email to