Can we disable table locking with the source Postg...
# ask-ai
j
Can we disable table locking with the source PostgreSQL connector?
u
New message text here
j
@kapa.ai This table locking is related to initial table snapshotting, we have CDC enabled
u
You're correct that the table locking issue is related to the initial table snapshotting when using CDC (Change Data Capture) in Airbyte. Let me provide some more details based on the information available: When Airbyte performs a sync for the first time using CDC, it needs to take an initial consistent snapshot of your database. To avoid acquiring table locks during this process, Airbyte uses snapshot isolation. This allows simultaneous writes by other database clients while the initial snapshot is being taken [Documentation > Integrations > Sources > Microsoft SQL Server (MSSQL) > Change Data Capture (CDC) > Setting up CDC for MSSQL > 2. Enable snapshot isolation](https://docs.airbyte.com/integrations/sources/mssql#2-enable-snapshot-isolation). For Microsoft SQL Server (MSSQL), Airbyte requires snapshot isolation to be enabled on the database you want to sync. This is done by running the following SQL command:
Copy code
sql ALTER DATABASE {database name}     SET ALLOW_SNAPSHOT_ISOLATION ON;
It's important to note that this requirement is specific to Airbyte's implementation of CDC for MSSQL. As mentioned in one of the forum discussions, this is not a standard requirement for CDC in MSSQL itself, but rather a design choice made by Airbyte to ensure consistent initial snapshots without locking tables [Forum Post: Regarding CDC option for Replication Method (MSSQL Server connector)](https://discuss.airbyte.io/t/453). For other databases like MySQL, Airbyte also tries to avoid table locks during the initial snapshot. However, the specific implementation may differ. For MySQL, Airbyte doesn't acquire table locks (except for tables defined with MyISAM engine) while creating the snapshot [Documentation > Integrations > Sources > Mysql > Troubleshooting MySQL Sources > Troubleshooting > EventDataDeserializationException errors during initial snapshot](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#eventdatadeserializationexception-errors-during-initial-snapshot). The goal of these measures is to allow for a consistent initial snapshot of the database without disrupting ongoing write operations, which is crucial for maintaining data integrity when setting up CDC replication in Airbyte.