Tables Become Read-Only During HVR Activation
Issue
During HVR activation, source tables without a primary key become read-only, blocking UPDATE and DELETE operations until activation finishes.
Environment
- HVR 6
- Source: PostgreSQL version 16.0
- Target: Databricks
- Over 14,000 tables activated concurrently
Resolution
Before you start activation:
- Set
REPLICA IDENTITY FULLon each table that doesn't have a primary key. - Avoid using supplemental logging during activation for tables without a primary key, since it can block the source application.
- Confirm that the database user has permission to create publications.
- Check existing database sessions for locks that could cause deadlocks.
- Schedule activation during a period of low activity to minimize the impact on source applications.
- Prepare all required schema changes, including setting
REPLICA IDENTITY, before you start activation.
Cause
This issue occurs when a source table doesn't have a primary key and its replica identity isn't set to FULL. PostgreSQL requires a replica identity to identify rows for UPDATE and DELETE operations during logical replication. Without one, PostgreSQL rejects these operations to prevent changes that it can't replicate reliably.