Commit Graph

1735 Commits

Author SHA1 Message Date
mfvitale
213456c5af DBZ-7497 Properties related to configuration based snapshot mode are now optional 2024-03-28 08:59:54 +01:00
mfvitale
ee5f25ccc9 DBZ-7497 Add a configuration based snapshot modes configurable via connector properties 2024-03-28 08:59:54 +01:00
Debezium Builder
4df18d9f43 [maven-release-plugin] prepare for next development iteration 2024-03-25 09:57:05 +00:00
Debezium Builder
9656da1fad [maven-release-plugin] prepare release v2.6.0.CR1 2024-03-25 09:57:04 +00:00
mfvitale
662a0518ac DBZ-7308 Fix MySQL tests 2024-03-25 05:46:46 +01:00
mfvitale
c7a28021a6 DBZ-7308 Remove connector specific SnapshotLockProvider and SnapshotterServiceProvider 2024-03-25 05:46:46 +01:00
mfvitale
60a0b1b5c3 DBZ-7308 tableLockingStatement from SnapshotLock interface now takes just one table in input 2024-03-25 05:46:46 +01:00
mfvitale
ae9009303c DBZ-7308 Move getSnapshottingTask to RelationalSnapshotChangeEventSource 2024-03-25 05:46:46 +01:00
mfvitale
265ba0f6e6 DBZ-7308 Check if configured snapshot mode permits streaming before starting it. 2024-03-25 05:46:46 +01:00
Chris Cranford
4356db3292 DBZ-7690 Fix history comparisons for SERVER_ID_KEY and TIMESTAMP_KEY 2024-03-21 08:41:47 +01:00
Chris Cranford
1822005d7c DBZ-7665 Exclude jcl-over-slf4j dependency 2024-03-20 05:57:50 +01:00
harveyyue
48c67e40fb DBZ-7618 Implement Versioned interfaces in Transformation and Converter plugins 2024-03-14 06:35:42 +01:00
Sean Wu
a71368cf62 DBZ-7594 Correct the negative value of data type TIME replicated from MySQL. 2024-03-12 08:01:04 +01:00
mfvitale
b8dcb958cd DBZ-7608 Maintain order for schema events 2024-03-11 08:42:52 +01:00
mfvitale
5a45d8dcf4 DBZ-7608 Resolve performance issue during addSchemaEvent 2024-03-11 08:42:52 +01:00
Debezium Builder
2fb8fc3004 [maven-release-plugin] prepare for next development iteration 2024-03-06 07:47:33 +00:00
Debezium Builder
cd46b2b998 [maven-release-plugin] prepare release v2.6.0.Beta1 2024-03-06 07:47:33 +00:00
mfvitale
8a47b2333d DBZ-7588 Disable debug prints on tests 2024-03-02 11:33:48 -05:00
mfvitale
e174eae235 DBZ-7461 Remove redundant log 2024-03-01 14:12:31 +01:00
mfvitale
4ade54351f DBZ-7461 Rename SCHEMA_ONLY_RECOVERY to RECOVERY and SCHEMA_ONLY to NO_DATA 2024-03-01 14:12:31 +01:00
mfvitale
211675a355 DBZ-7461 Rename shouldSnapshot to shouldSnapshotData 2024-03-01 14:12:31 +01:00
mfvitale
562c999da4 DBZ-7461 Move out-of-the-box snapshotters to core 2024-03-01 14:12:31 +01:00
mfvitale
371905f135 DBZ-7461 Move snapshot mode validation logic to BaseSourceTask 2024-03-01 14:12:31 +01:00
mfvitale
99eee98e9d DBZ-7461 Align common code for Snapshotters 2024-03-01 14:12:31 +01:00
mfvitale
ce1b5d7231 DBZ-7461 Support WhenNeededSnapshotter for PostgreSQL 2024-03-01 14:12:31 +01:00
mfvitale
b1a907757d DBZ-7461 Support WhenNeededSnapshotter for Oracle 2024-03-01 14:12:31 +01:00
mfvitale
1f52b81b6d DBZ-7461 Support AlwaysSnapshotter for MySQL 2024-03-01 14:12:31 +01:00
James Johnston
f632fa081e DBZ-5071 Correctly handle NULL values in incremental snapshots
It turns out that the existing code for chunking a table when taking
an incremental snapshot was buggy and did not correctly handle NULL
values when building the chunk query.  An example of such a situation
would be when the user has specified "message.key.columns" to reference
a column that is part of a PostgreSQL UNIQUE INDEX that was created with
the NULLS NOT DISTINCT option.

This commit updates the new AbstractChunkQueryBuilder so that it checks
whether a key column is optional.  If it is, then additional will
appropriately consider NULL values when generating a chunk query using
"IS [NOT] NULL" clauses.

One complication is that different database engines have different
sorting behavior of ORDER BY.  It is apparently not well-defined by the
SQL standard.  Some databases consider NULL values to be higher than any
non-NULL values, and others consider them to be lower.

To handle this situation, a new nullsSortLast() function is added to the
JdbcConnection class.  By default, it returns an empty value, indicating
that the behavior of the database engine is unknown.  When an optional
field is encountered by AbstractChunkQueryBuilder in this situation, we
throw an error because we don't actually know how to correctly chunk the
query: there's no safe assumption that can be made here.

Derived JdbcConnection classes can then override the nullsSortLast
function, and return a value indicating the actual behavior of that
database engine.  When this is done, the AbstractChunkQueryBuilder then
knows how to correctly build a chunk query that can handle NULL values.

To help test this, new tests have been added to
AbstractIncrementalSnapshotTest.  First, the existing insertsWithoutPks
test has been moved and deduplicated from MySQL and PostgreSQL so that
the test case can be reused on other engines.  Second, a new
insertsWithoutPksAndNull test is run, which inserts data with NULL
values in the message key columns.  To demonstrate that chunk queries
are being correctly generated for practically every case, the
INCREMENTAL_SNAPSHOT_CHUNK_SIZE is set to 1 so that NULL values are not
returned in the middle of a chunk, which can cause us to skip testing
the code we need to test.
2024-02-29 13:36:26 +01:00
Vojtech Juranek
83c339c2ae [ci] Mark ReadOnlyIncrementalSnapshotIT#testStopSnapshotKafkaSignal as flaky 2024-02-27 16:38:15 -05:00
Bue-Von-Hun
94e24532f6 DBZ-2015 Remove redundant fields 2024-02-27 15:30:48 +01:00
Lourens Naude
bba11001b3 DBZ-7567 Fix null event timestamp possible from FORMAT_DESCRIPTION and PREVIOUS_GTIDS events in MySqlStreamingChangeEventSource::setEventTimestamp 2024-02-27 10:05:34 +01:00
rkerner
1e69e40ec2 DBZ-7416 Fix duplicate SMTs sometimes returned by Kafka Connect. Moved deduplication from Map to LinkedHashSet.
+ minor fixes added for cleanup and centralization of common code

closes https://issues.redhat.com/browse/DBZ-7416
2024-02-22 13:34:08 -05:00
Jiri Pechanec
68b6591142 DBZ-7416 Fix duplicate SMTs sometimes returned by Kafka Connect. Moved deduplication from Map to LinkedHashSet.
closes https://issues.redhat.com/browse/DBZ-7416
2024-02-22 13:34:08 -05:00
mfvitale
08e46815e4 DBZ-7508 Exit from readChunk after createDataEventsForTable if snapshot is not running anymore 2024-02-22 12:13:37 -05:00
Chris Cranford
6af8a7c70b [ci] Add Flaky to shouldCreateSnapshotOfSingleDatabaseWithoutGlobalLock (MySQL) 2024-02-21 09:00:45 -05:00
mfvitale
7ed5649e07 DBZ-7302 Implement Snapshotter for Oracle 2024-02-20 14:45:59 +01:00
mfvitale
9fe60a698d DBZ-7302 Move snapshot.locking.mode.custom.name, snapshot.query.mode and snapshot.query.mode.custom.name to CommonConnectorConfig 2024-02-20 14:45:59 +01:00
Lourens Naude
b93218e3ce DBZ-7500 prefer a more concise and self documenting version of setEventTimestamp as proposed by Chris Cranford 2024-02-17 14:22:43 -05:00
Lourens Naude
ae9539ab93 DBZ-7500 Fallback to seconds resolution for MariaDB as high resolution timestamps on MARIADB_GTID events are not supported 2024-02-17 14:22:43 -05:00
Lourens Naude
70aa83b371 DBZ-7500 Fix MySQL 8 event timestamp resolution logic error where fallback to seconds occurs erroneously for non-GTID events 2024-02-17 14:22:43 -05:00
Chris Cranford
928aa26cdb DBZ-7107 Fix source info test failures 2024-02-16 12:52:20 +01:00
Debezium Builder
10e327602c [maven-release-plugin] prepare for next development iteration 2024-02-13 09:20:04 +00:00
Debezium Builder
0c5b05738c [maven-release-plugin] prepare release v2.6.0.Alpha2 2024-02-13 09:20:04 +00:00
Vojtech Juranek
eef8ee4cea DBZ-7024 Move async engine into separate package 2024-02-12 13:43:21 +01:00
Vojtech Juranek
78f7c40410 DBZ-7024 Don't stop engine before tasks are fully running 2024-02-12 13:43:21 +01:00
Vojtech Juranek
834b522739 DBZ-7024 Fix ReadOnlyIncrementalSnapshotIT after switch to async engine 2024-02-12 13:43:21 +01:00
Vojtech Juranek
6c71cb7f88 DBZ-7024 Fix StreamingSourceIT after switch to async engine 2024-02-12 13:43:21 +01:00
Vojtech Juranek
ec58dd6a1c DBZ-7024 Fix MySqlRestartIT after switch to async engine 2024-02-12 13:43:21 +01:00
Vojtech Juranek
3a902ff1d6 DBZ-7024 Fix MySqlConnectorSchemaValidateIT after switch to async engine 2024-02-12 13:43:21 +01:00
Vojtech Juranek
0137d5f15e DBZ-7024 Switch MySQL tests inheriting from AbstractConnectorTest to async engine 2024-02-12 13:43:21 +01:00