DBZ-2582 Fixing LSN casing

This commit is contained in:
James Gormley 2020-10-09 14:55:32 -04:00 committed by Gunnar Morling
parent 3d8714d6dd
commit bea46a3059
3 changed files with 7 additions and 7 deletions

View File

@ -156,8 +156,8 @@ public Lsn getMaxLsn() throws SQLException {
}, "Maximum LSN query must return exactly one value"));
}
public MaxLsnResult getMaxLsnResult(boolean skipLowActivityLSNsEnabled) throws SQLException {
if (skipLowActivityLSNsEnabled) {
public MaxLsnResult getMaxLsnResult(boolean skipLowActivityLsnsEnabled) throws SQLException {
if (skipLowActivityLsnsEnabled) {
return prepareQueryAndMap(GET_MAX_LSN_SKIP_LOW_ACTIVTY, statement -> {
}, singleResultMapper(rs -> {
final MaxLsnResult ret = new MaxLsnResult(Lsn.valueOf(rs.getBytes(1)), Lsn.valueOf(rs.getBytes(2)));

View File

@ -370,7 +370,7 @@ public static ConfigDef configDef() {
private final SourceTimestampMode sourceTimestampMode;
private final ColumnNameFilter columnFilter;
private final boolean readOnlyDatabaseConnection;
private final boolean skipLowActivityLSNsEnabled;
private final boolean skipLowActivityLsnsEnabled;
public SqlServerConnectorConfig(Configuration config) {
super(SqlServerConnector.class, config, config.getString(SERVER_NAME), new SystemTablesPredicate(), x -> x.schema() + "." + x.table(), true);
@ -395,7 +395,7 @@ public SqlServerConnectorConfig(Configuration config) {
}
this.sourceTimestampMode = SourceTimestampMode.fromMode(config.getString(SOURCE_TIMESTAMP_MODE_CONFIG_NAME));
this.skipLowActivityLSNsEnabled = config.getBoolean(MAX_LSN_OPTIMIZATION);
this.skipLowActivityLsnsEnabled = config.getBoolean(MAX_LSN_OPTIMIZATION);
}
private static ColumnNameFilter getColumnExcludeNameFilter(String excludedColumnPatterns) {
@ -452,8 +452,8 @@ public boolean isReadOnlyDatabaseConnection() {
return readOnlyDatabaseConnection;
}
public boolean isSkipLowActivityLSNsEnabled() {
return skipLowActivityLSNsEnabled;
public boolean isSkipLowActivityLsnsEnabled() {
return skipLowActivityLsnsEnabled;
}
@Override

View File

@ -125,7 +125,7 @@ public void execute(ChangeEventSourceContext context) throws InterruptedExceptio
if (connectorConfig.isReadOnlyDatabaseConnection()) {
dataConnection.commit();
}
final MaxLsnResult maxLsnResult = dataConnection.getMaxLsnResult(connectorConfig.isSkipLowActivityLSNsEnabled());
final MaxLsnResult maxLsnResult = dataConnection.getMaxLsnResult(connectorConfig.isSkipLowActivityLsnsEnabled());
// Shouldn't happen if the agent is running, but it is better to guard against such situation
if (!maxLsnResult.getMaxLsn().isAvailable() || !maxLsnResult.getMaxTransactionalLsn().isAvailable()) {