From 9fc1eada11db78d7b11e67d1739314e55722856a Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Mon, 13 Jan 2020 12:56:22 -0500 Subject: [PATCH] DBZ-1600 Remove deprecated "slot.drop_on_stop" postgres configuration option --- .../postgresql/PostgresConnectorConfig.java | 13 ------ .../postgresql/PostgresConnectorIT.java | 45 ------------------- 2 files changed, 58 deletions(-) diff --git a/debezium-connector-postgres/src/main/java/io/debezium/connector/postgresql/PostgresConnectorConfig.java b/debezium-connector-postgres/src/main/java/io/debezium/connector/postgresql/PostgresConnectorConfig.java index b26d7025c..6de723a6e 100755 --- a/debezium-connector-postgres/src/main/java/io/debezium/connector/postgresql/PostgresConnectorConfig.java +++ b/debezium-connector-postgres/src/main/java/io/debezium/connector/postgresql/PostgresConnectorConfig.java @@ -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 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); } diff --git a/debezium-connector-postgres/src/test/java/io/debezium/connector/postgresql/PostgresConnectorIT.java b/debezium-connector-postgres/src/test/java/io/debezium/connector/postgresql/PostgresConnectorIT.java index a8d4d99b3..2f9e35284 100644 --- a/debezium-connector-postgres/src/test/java/io/debezium/connector/postgresql/PostgresConnectorIT.java +++ b/debezium-connector-postgres/src/test/java/io/debezium/connector/postgresql/PostgresConnectorIT.java @@ -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