DBZ-8181 Drop several deprecated Oracle configuration options
This commit is contained in:
parent
b00ae60373
commit
2b95be0be9
@ -169,17 +169,6 @@ public class OracleConnectorConfig extends HistorizedRelationalDatabaseConnector
|
||||
.withGroup(Field.createGroupEntry(Field.Group.CONNECTOR_SNAPSHOT, 11))
|
||||
.withDescription("A token to replace on snapshot predicate template");
|
||||
|
||||
@Deprecated
|
||||
public static final Field LOG_MINING_TRANSACTION_RETENTION = Field.create("log.mining.transaction.retention.hours")
|
||||
.withDisplayName("Log Mining long running transaction retention")
|
||||
.withType(Type.LONG)
|
||||
.withWidth(Width.SHORT)
|
||||
.withImportance(Importance.MEDIUM)
|
||||
.withDefault(0)
|
||||
.withValidation(Field::isNonNegativeLong)
|
||||
.withDescription("Hours to keep long running transactions in transaction buffer between log mining " +
|
||||
"sessions. By default, all transactions are retained.");
|
||||
|
||||
public static final Field LOG_MINING_TRANSACTION_RETENTION_MS = Field.create("log.mining.transaction.retention.ms")
|
||||
.withDisplayName("Log Mining long running transaction retention")
|
||||
.withType(Type.LONG)
|
||||
@ -324,16 +313,6 @@ public class OracleConnectorConfig extends HistorizedRelationalDatabaseConnector
|
||||
.withValidation(OracleConnectorConfig::validateUsernameExcludeList)
|
||||
.withDescription("Comma separated list of usernames to exclude from LogMiner query.");
|
||||
|
||||
@Deprecated
|
||||
public static final Field LOG_MINING_ARCHIVE_DESTINATION_NAME = Field.create("log.mining.archive.destination.name")
|
||||
.withDisplayName("Name of the archive log destination to be used for reading archive logs")
|
||||
.withType(Type.STRING)
|
||||
.withWidth(Width.MEDIUM)
|
||||
.withImportance(Importance.LOW)
|
||||
.withGroup(Field.createGroupEntry(Field.Group.CONNECTION_ADVANCED, 20))
|
||||
.withDescription("Sets the specific archive log destination as the source for reading archive logs." +
|
||||
"When not set, the connector will automatically select the first LOCAL and VALID destination.");
|
||||
|
||||
public static final Field ARCHIVE_DESTINATION_NAME = Field.create("archive.destination.name")
|
||||
.withDisplayName("Name of the archive log destination to be used for reading archive logs")
|
||||
.withType(Type.STRING)
|
||||
@ -343,16 +322,6 @@ public class OracleConnectorConfig extends HistorizedRelationalDatabaseConnector
|
||||
.withDescription("Sets the specific archive log destination as the source for reading archive logs." +
|
||||
"When not set, the connector will automatically select the first LOCAL and VALID destination.");
|
||||
|
||||
@Deprecated
|
||||
public static final Field LOG_MINING_ARCHIVE_LOG_HOURS = Field.create("log.mining.archive.log.hours")
|
||||
.withDisplayName("Log Mining Archive Log Hours")
|
||||
.withType(Type.LONG)
|
||||
.withWidth(Width.SHORT)
|
||||
.withImportance(Importance.LOW)
|
||||
.withGroup(Field.createGroupEntry(Field.Group.CONNECTION_ADVANCED, 10))
|
||||
.withDefault(0)
|
||||
.withDescription("The number of hours in the past from SYSDATE to mine archive logs. Using 0 mines all available archive logs");
|
||||
|
||||
public static final Field ARCHIVE_LOG_HOURS = Field.create("archive.log.hours")
|
||||
.withDisplayName("Archive Log Hours")
|
||||
.withType(Type.LONG)
|
||||
@ -706,7 +675,6 @@ public class OracleConnectorConfig extends HistorizedRelationalDatabaseConnector
|
||||
SNAPSHOT_LOCKING_MODE,
|
||||
RAC_NODES,
|
||||
INTERVAL_HANDLING_MODE,
|
||||
LOG_MINING_ARCHIVE_LOG_HOURS,
|
||||
ARCHIVE_LOG_HOURS,
|
||||
LOG_MINING_BATCH_SIZE_DEFAULT,
|
||||
LOG_MINING_BATCH_SIZE_MIN,
|
||||
@ -715,13 +683,11 @@ public class OracleConnectorConfig extends HistorizedRelationalDatabaseConnector
|
||||
LOG_MINING_SLEEP_TIME_MIN_MS,
|
||||
LOG_MINING_SLEEP_TIME_MAX_MS,
|
||||
LOG_MINING_SLEEP_TIME_INCREMENT_MS,
|
||||
LOG_MINING_TRANSACTION_RETENTION,
|
||||
LOG_MINING_TRANSACTION_RETENTION_MS,
|
||||
LOG_MINING_ARCHIVE_LOG_ONLY_MODE,
|
||||
LOB_ENABLED,
|
||||
LOG_MINING_USERNAME_INCLUDE_LIST,
|
||||
LOG_MINING_USERNAME_EXCLUDE_LIST,
|
||||
LOG_MINING_ARCHIVE_DESTINATION_NAME,
|
||||
ARCHIVE_DESTINATION_NAME,
|
||||
LOG_MINING_BUFFER_TYPE,
|
||||
LOG_MINING_BUFFER_DROP_ON_STOP,
|
||||
@ -864,7 +830,7 @@ public OracleConnectorConfig(Configuration config) {
|
||||
// LogMiner
|
||||
this.logMiningStrategy = LogMiningStrategy.parse(config.getString(LOG_MINING_STRATEGY));
|
||||
this.racNodes = resolveRacNodes(config);
|
||||
this.archiveLogRetention = resolveArchiveLogHours(config);
|
||||
this.archiveLogRetention = config.getDuration(ARCHIVE_LOG_HOURS, ChronoUnit.HOURS);
|
||||
this.logMiningBatchSizeMin = config.getInteger(LOG_MINING_BATCH_SIZE_MIN);
|
||||
this.logMiningBatchSizeMax = config.getInteger(LOG_MINING_BATCH_SIZE_MAX);
|
||||
this.logMiningBatchSizeDefault = config.getInteger(LOG_MINING_BATCH_SIZE_DEFAULT);
|
||||
@ -872,11 +838,11 @@ public OracleConnectorConfig(Configuration config) {
|
||||
this.logMiningSleepTimeMax = Duration.ofMillis(config.getInteger(LOG_MINING_SLEEP_TIME_MAX_MS));
|
||||
this.logMiningSleepTimeDefault = Duration.ofMillis(config.getInteger(LOG_MINING_SLEEP_TIME_DEFAULT_MS));
|
||||
this.logMiningSleepTimeIncrement = Duration.ofMillis(config.getInteger(LOG_MINING_SLEEP_TIME_INCREMENT_MS));
|
||||
this.logMiningTransactionRetention = resolveLogMiningTransactionRetentionDuration(config);
|
||||
this.logMiningTransactionRetention = config.getDuration(LOG_MINING_TRANSACTION_RETENTION_MS, ChronoUnit.MILLIS);
|
||||
this.archiveLogOnlyMode = config.getBoolean(LOG_MINING_ARCHIVE_LOG_ONLY_MODE);
|
||||
this.logMiningUsernameIncludes = Strings.setOfTrimmed(config.getString(LOG_MINING_USERNAME_INCLUDE_LIST), String::new);
|
||||
this.logMiningUsernameExcludes = Strings.setOfTrimmed(config.getString(LOG_MINING_USERNAME_EXCLUDE_LIST), String::new);
|
||||
this.archiveLogDestinationName = resolveArchiveLogDestinationName(config);
|
||||
this.archiveLogDestinationName = config.getString(ARCHIVE_DESTINATION_NAME);
|
||||
this.logMiningBufferType = LogMiningBufferType.parse(config.getString(LOG_MINING_BUFFER_TYPE));
|
||||
this.logMiningBufferTransactionEventsThreshold = config.getLong(LOG_MINING_BUFFER_TRANSACTION_EVENTS_THRESHOLD);
|
||||
this.logMiningBufferDropOnStop = config.getBoolean(LOG_MINING_BUFFER_DROP_ON_STOP);
|
||||
@ -906,34 +872,6 @@ public OracleConnectorConfig(Configuration config) {
|
||||
this.openLogReplicatorPort = config.getInteger(OLR_PORT, 0);
|
||||
}
|
||||
|
||||
private String resolveArchiveLogDestinationName(Configuration config) {
|
||||
|
||||
String archiveLogDestinationName = config.getString(ARCHIVE_DESTINATION_NAME);
|
||||
String logMiningArchiveLogDestinationName = config.getString(LOG_MINING_ARCHIVE_DESTINATION_NAME);
|
||||
if (archiveLogDestinationName == null) {
|
||||
if (logMiningArchiveLogDestinationName != null) {
|
||||
LOGGER.warn("The option {} is deprecated and replaced by {} and will be removed in a future build.",
|
||||
LOG_MINING_ARCHIVE_DESTINATION_NAME.name(), ARCHIVE_DESTINATION_NAME.name());
|
||||
return logMiningArchiveLogDestinationName;
|
||||
}
|
||||
}
|
||||
return archiveLogDestinationName;
|
||||
}
|
||||
|
||||
private Duration resolveArchiveLogHours(Configuration config) {
|
||||
|
||||
Duration archiveLogHours = config.getDuration(ARCHIVE_LOG_HOURS, ChronoUnit.HOURS);
|
||||
Duration logMiningArchiveLogHours = config.getDuration(LOG_MINING_ARCHIVE_LOG_HOURS, ChronoUnit.HOURS);
|
||||
if (archiveLogHours.isZero()) {
|
||||
if (!logMiningArchiveLogHours.isZero()) {
|
||||
LOGGER.warn("The option {} is deprecated and replaced by {} and will be removed in a future build.",
|
||||
LOG_MINING_ARCHIVE_LOG_HOURS.name(), ARCHIVE_LOG_HOURS.name());
|
||||
return logMiningArchiveLogHours;
|
||||
}
|
||||
}
|
||||
return archiveLogHours;
|
||||
}
|
||||
|
||||
private static String toUpperCase(String property) {
|
||||
return property == null ? null : property.toUpperCase();
|
||||
}
|
||||
@ -2038,20 +1976,6 @@ private Set<String> resolveRacNodes(Configuration config) {
|
||||
}).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
private Duration resolveLogMiningTransactionRetentionDuration(Configuration config) {
|
||||
// Calculate the log mining transaction retention between the two properties
|
||||
Duration logMiningTransactionRetentionMs = config.getDuration(LOG_MINING_TRANSACTION_RETENTION_MS, ChronoUnit.MILLIS);
|
||||
Duration logMiningTransactionRetentionHours = config.getDuration(LOG_MINING_TRANSACTION_RETENTION, ChronoUnit.HOURS);
|
||||
if (logMiningTransactionRetentionMs.isZero()) {
|
||||
if (!logMiningTransactionRetentionHours.isZero()) {
|
||||
LOGGER.warn("The option {} is deprecated and replaced by {} and will be removed in a future build.",
|
||||
LOG_MINING_TRANSACTION_RETENTION.name(), LOG_MINING_TRANSACTION_RETENTION_MS.name());
|
||||
return logMiningTransactionRetentionHours;
|
||||
}
|
||||
}
|
||||
return logMiningTransactionRetentionMs;
|
||||
}
|
||||
|
||||
public static int validateOutServerName(Configuration config, Field field, ValidationOutput problems) {
|
||||
if (ConnectorAdapter.XSTREAM.equals(ConnectorAdapter.parse(config.getString(CONNECTOR_ADAPTER)))) {
|
||||
return Field.isRequired(config, field, problems);
|
||||
|
@ -185,11 +185,11 @@ public void validTransactionRetentionDefaults() throws Exception {
|
||||
@Test
|
||||
@FixFor("DBZ-2754")
|
||||
public void testTransactionRetention() throws Exception {
|
||||
final Field transactionRetentionField = OracleConnectorConfig.LOG_MINING_TRANSACTION_RETENTION;
|
||||
final Field transactionRetentionField = OracleConnectorConfig.LOG_MINING_TRANSACTION_RETENTION_MS;
|
||||
|
||||
Configuration config = Configuration.create()
|
||||
.with(CommonConnectorConfig.TOPIC_PREFIX, "myserver")
|
||||
.with(transactionRetentionField, 3)
|
||||
.with(transactionRetentionField, 10_800_000)
|
||||
.build();
|
||||
|
||||
assertThat(config.validateAndRecord(Collections.singletonList(transactionRetentionField), LOGGER::error)).isTrue();
|
||||
|
@ -280,7 +280,7 @@ public void testOtherMetrics() {
|
||||
@Test
|
||||
@FixFor("DBZ-2754")
|
||||
public void testCustomTransactionRetention() throws Exception {
|
||||
init(TestHelper.defaultConfig().with(OracleConnectorConfig.LOG_MINING_TRANSACTION_RETENTION, 3));
|
||||
init(TestHelper.defaultConfig().with(OracleConnectorConfig.LOG_MINING_TRANSACTION_RETENTION_MS, 10_800_000));
|
||||
assertThat(metrics.getHoursToKeepTransactionInBuffer()).isEqualTo(3);
|
||||
assertThat(metrics.getMillisecondsToKeepTransactionsInBuffer()).isEqualTo(3 * 3600000);
|
||||
}
|
||||
@ -288,7 +288,7 @@ public void testCustomTransactionRetention() throws Exception {
|
||||
@Test
|
||||
@FixFor("DBZ-5179")
|
||||
public void testRollbackTransactionIdSetSizeLimit() throws Exception {
|
||||
init(TestHelper.defaultConfig().with(OracleConnectorConfig.LOG_MINING_TRANSACTION_RETENTION, 3));
|
||||
init(TestHelper.defaultConfig().with(OracleConnectorConfig.LOG_MINING_TRANSACTION_RETENTION_MS, 10_800_000));
|
||||
|
||||
// Check state up to maximum size
|
||||
for (int i = 1; i <= 10; ++i) {
|
||||
@ -309,7 +309,7 @@ public void testRollbackTransactionIdSetSizeLimit() throws Exception {
|
||||
@Test
|
||||
@FixFor("DBZ-5179")
|
||||
public void testAbandonedTransactionIdSetSizeLimit() throws Exception {
|
||||
init(TestHelper.defaultConfig().with(OracleConnectorConfig.LOG_MINING_TRANSACTION_RETENTION, 3));
|
||||
init(TestHelper.defaultConfig().with(OracleConnectorConfig.LOG_MINING_TRANSACTION_RETENTION_MS, 10_800_000));
|
||||
|
||||
// Check state up to maximum size
|
||||
for (int i = 1; i <= 10; ++i) {
|
||||
|
@ -2489,22 +2489,22 @@ The {prodname} Oracle connector only uses destinations that have a status of `VA
|
||||
If your Oracle environment includes multiple destinations that satisfy that criteria, consult with your Oracle administrator to determine which archive log destination {prodname} should use.
|
||||
|
||||
.Procedure
|
||||
* To specify the archive log destination that you want {prodname} to use, set the xref:oracle-property-log-mining-archive-destination-name[`log.mining.archive.destination.name`] property in the connector configuration. +
|
||||
* To specify the archive log destination that you want {prodname} to use, set the xref:oracle-property-archive-destination-name[`archive.destination.name`] property in the connector configuration. +
|
||||
+
|
||||
For example, suppose that a database is configured with two archive destination paths, `/path/one` and `/path/two`, and that the `V$ARCHIVE_DEST_STATUS` table associates these paths with destination names that are specified in the column `DEST_NAME`.
|
||||
If both destinations satisfy the criteria for {prodname} -- that is, their `status` is `VALID` and their `type` is `LOCAL` -- to configure the connector to use the archive logs that the database writes to `/path/two`, set the value of `log.mining.archive.destination.name` to the value in the `DEST_NAME` column that is associated with `/path/two` in the `V$ARCHIVE_DEST_STATUS` table.
|
||||
If both destinations satisfy the criteria for {prodname} -- that is, their `status` is `VALID` and their `type` is `LOCAL` -- to configure the connector to use the archive logs that the database writes to `/path/two`, set the value of `archive.destination.name` to the value in the `DEST_NAME` column that is associated with `/path/two` in the `V$ARCHIVE_DEST_STATUS` table.
|
||||
For example, if the `DEST_NAME` is `LOG_ARCHIVE_DEST_3` for `/path/two`, you would configure Debezium as follows:
|
||||
|
||||
[source,json]
|
||||
----
|
||||
{
|
||||
"log.mining.archive.destination.name": "LOG_ARCHIVE_DEST_3"
|
||||
"archive.destination.name": "LOG_ARCHIVE_DEST_3"
|
||||
}
|
||||
----
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
Do not set the value of `log.mining.archive.destination.name` to the path that the database uses for the archive logs.
|
||||
Do not set the value of `archive.destination.name` to the path that the database uses for the archive logs.
|
||||
Set the property to the name of an archive log destination in the `DEST_NAME` column for a row in the `V$ARCHIVE_DEST_STATUS` table that satisfies your archive log retention policy.
|
||||
====
|
||||
|
||||
@ -4004,7 +4004,7 @@ This also servers as a measure for adjusting batch size - when the difference be
|
||||
|`200`
|
||||
|The maximum amount of time up or down that the connector uses to tune the optimal sleep time when reading data from logminer. Value is in milliseconds.
|
||||
|
||||
|[[oracle-property-log-mining-archive-log-hours]]<<oracle-property-log-mining-archive-log-hours, `+log.mining.archive.log.hours+`>>
|
||||
|[[oracle-property-archive-log-hours]]<<oracle-property-archive-log-hours, `+archive.log.hours+`>>
|
||||
|`0`
|
||||
|The number of hours in the past from SYSDATE to mine archive logs.
|
||||
When the default setting (`0`) is used, the connector mines all archive logs.
|
||||
@ -4035,7 +4035,7 @@ Because all of the DML operations that are part of a transaction are buffered un
|
||||
long-running transactions should be avoided in order to not overflow that buffer.
|
||||
Any transaction that exceeds this configured value is discarded entirely, and the connector does not emit any messages for the operations that were part of the transaction.
|
||||
|
||||
|[[oracle-property-log-mining-archive-destination-name]]<<oracle-property-log-mining-archive-destination-name, `+log.mining.archive.destination.name+`>>
|
||||
|[[oracle-property-archive-destination-name]]<<oracle-property-archive-destination-name, `+archive.destination.name+`>>
|
||||
|No default
|
||||
|Specifies the configured Oracle archive destination to use when mining archive logs with LogMiner. +
|
||||
+
|
||||
|
Loading…
Reference in New Issue
Block a user