DBZ-1600 Remove deprecated "slot.drop_on_stop" postgres configuration option

This commit is contained in:
Chris Cranford 2020-01-13 12:56:22 -05:00 committed by Gunnar Morling
parent 4a27746dad
commit 9fc1eada11
2 changed files with 0 additions and 58 deletions

View File

@ -589,13 +589,6 @@ public static SchemaRefreshMode parse(String value) {
"Whether or not to drop the logical replication slot when the connector finishes orderly" +
"By default the replication is kept so that on restart progress can resume from the last recorded location");
public static final Field DROP_SLOT_ON_STOP_OBSOLETE = Field.create("slot.drop_on_stop")
.withDisplayName("Drop slot on stop")
.withType(Type.BOOLEAN)
.withImportance(Importance.MEDIUM)
.withDescription(
"Obsolete! Replaced with slot.drop.on.stop");
public static final Field PUBLICATION_NAME = Field.create("publication.name")
.withDisplayName("Publication")
.withType(Type.STRING)
@ -942,9 +935,6 @@ protected boolean dropSlotOnStop() {
if (getConfig().hasKey(DROP_SLOT_ON_STOP.name())) {
return getConfig().getBoolean(DROP_SLOT_ON_STOP);
}
if (getConfig().hasKey(DROP_SLOT_ON_STOP_OBSOLETE.name())) {
return getConfig().getBoolean(DROP_SLOT_ON_STOP_OBSOLETE);
}
// Return default value
return getConfig().getBoolean(DROP_SLOT_ON_STOP);
}
@ -986,9 +976,6 @@ public Configuration jdbcConfig() {
}
protected Map<String, ConfigValue> validate() {
if (getConfig().hasKey(DROP_SLOT_ON_STOP_OBSOLETE.name())) {
LOGGER.warn("Parameter '{}' is obsolete and is scheduled to be removed. Please use '{}'.", DROP_SLOT_ON_STOP_OBSOLETE, DROP_SLOT_ON_STOP);
}
return getConfig().validate(ALL_FIELDS);
}

View File

@ -193,51 +193,6 @@ public void shouldValidateReplicationSlotName() throws Exception {
assertConfigurationErrors(validatedConfig, PostgresConnectorConfig.SLOT_NAME, 1);
}
@Test
public void shouldUseObsoleteDropSlotOnStop() throws Exception {
final String obsoleteParamLogMessage = "Parameter 'slot.drop_on_stop' is obsolete and is scheduled to be removed. Please use 'slot.drop.on.stop'.";
LogInterceptor logInterceptor = new LogInterceptor();
Configuration config = Configuration.create()
.with(PostgresConnectorConfig.DROP_SLOT_ON_STOP_OBSOLETE, true)
.build();
PostgresConnector connector = new PostgresConnector();
connector.validate(config.asMap());
assertThat(logInterceptor.containsWarnMessage(obsoleteParamLogMessage)).isTrue();
PostgresConnectorConfig connectorConfig = new PostgresConnectorConfig(config);
Assertions.assertThat(connectorConfig.dropSlotOnStop()).isTrue();
logInterceptor = new LogInterceptor();
config = Configuration.create()
.with(PostgresConnectorConfig.DROP_SLOT_ON_STOP, true)
.build();
connector = new PostgresConnector();
connector.validate(config.asMap());
assertThat(logInterceptor.containsWarnMessage(obsoleteParamLogMessage)).isFalse();
connectorConfig = new PostgresConnectorConfig(config);
Assertions.assertThat(connectorConfig.dropSlotOnStop()).isTrue();
logInterceptor = new LogInterceptor();
config = Configuration.create()
.build();
connector = new PostgresConnector();
connector.validate(config.asMap());
assertThat(logInterceptor.containsWarnMessage(obsoleteParamLogMessage)).isFalse();
connectorConfig = new PostgresConnectorConfig(config);
Assertions.assertThat(connectorConfig.dropSlotOnStop()).isFalse();
logInterceptor = new LogInterceptor();
config = Configuration.create()
.with(PostgresConnectorConfig.DROP_SLOT_ON_STOP_OBSOLETE, false)
.with(PostgresConnectorConfig.DROP_SLOT_ON_STOP, true)
.build();
connector = new PostgresConnector();
connector.validate(config.asMap());
assertThat(logInterceptor.containsWarnMessage(obsoleteParamLogMessage)).isTrue();
connectorConfig = new PostgresConnectorConfig(config);
Assertions.assertThat(connectorConfig.dropSlotOnStop()).isTrue();
}
@Test
public void shouldSupportSSLParameters() throws Exception {
// the default docker image we're testing against doesn't use SSL, so check that the connector fails to start when