馃悰 source-mssql: connector forces snapshot isolation level #28543
Labels
area/connectors
Connector related issues
autoteam
connectors/source/mssql
team/db-dw-sources
Backlog for Database and Data Warehouse Sources team
team/tse
Technical Support Engineers
type/bug
Something isn't working
Connector Name
source-mssql
Connector Version
1.1.0
What step the error happened?
Configuring a new connector
Revelant information
PR with proposed fix: #28545
There appears to be a bug in source-mssql's support for CDC + Read Committed. Currently both snapshot isolation levels check the db for enabled full
Snapshot Isolation
, which it should not do when theRead Committed
isolation level is selected.Support for non-snapshot CDC is added here: #13168
In the connector spec we see a rework of
replication_method
to support theRead Committed
isolation level.replication_method
field is renamed toreplication
for hygiene.We can see from comments that the new implementation since 0.4.0 should use the
replication
parameter instead of thereplication_method
. More recently however, the connector was modified in #16215 to usereplication_method
which has caused some problems.In the original change to support
Read Committed
snapshot isolation level for MSSQL + CDC, we see the newREPLICATION_FIELD
value pulled intoCdcMssqlHelper.java
:airbyte/airbyte-integrations/connectors/source-mssql/src/main/java/io/airbyte/integrations/source/mssql/MssqlCdcHelper.java
Lines 15 to 20 in 4284ce6
isCdc
checks whether CDC is enabled. It supports bothLEGACY_REPLICATION_FIELD
andREPLICATION_FIELD
:airbyte/airbyte-integrations/connectors/source-mssql/src/main/java/io/airbyte/integrations/source/mssql/MssqlCdcHelper.java
Lines 95 to 107 in 4284ce6
getSnapshotIsolationConfig
checks the snapshot isolation level:airbyte/airbyte-integrations/connectors/source-mssql/src/main/java/io/airbyte/integrations/source/mssql/MssqlCdcHelper.java
Lines 109 to 122 in 4284ce6
Since then, the spec parameter was modified from
replication
back toreplication_method
. This means that thegetSnapshotIsolationConfig
function still needsREPLICATION_FIELD
to behasNonNull
. Unfortunately however it's always null, becauseREPLICATION_FIELD
doesn't exist anymore, we only haveLEGACY_REPLICATION_FIELD
.So now, if we look at master branch, we observe that the connector config is not passed into some functions.
i.e.,
airbyte/airbyte-integrations/connectors/source-mssql/src/main/java/io/airbyte/integrations/source/mssql/MssqlCdcHelper.java
Lines 120 to 140 in 7e4797d
tl;dr quick/non-breaking-change fix is to update functions with the correct config parameter
Since this work was originally done to make naming consistent throughout CDC connectors (a reasonable goal) we should probably look at refactoring.
Relevant log output
No response
Contribute
The text was updated successfully, but these errors were encountered: