Commit Graph

2070 Commits

Author SHA1 Message Date
Debezium Builder
db691fd16f [maven-release-plugin] prepare for next development iteration 2024-06-13 09:04:36 +00:00
Debezium Builder
73ce5c5058 [maven-release-plugin] prepare release v2.7.0.Beta2 2024-06-13 09:04:36 +00:00
mfvitale
8edb87a881 DBZ-7917 Disable ReadOnlyIncrementalSnapshotIT for PostgreSQL < 13 2024-06-13 08:41:49 +02:00
mfvitale
8dc9605aac DBZ-7917 Flush incremental snapshot window with a heartbeat message 2024-06-13 08:41:49 +02:00
mfvitale
3bf9f4d9d5 DBZ-7917 Implement read-only incremental snapshot for PostgreSQL 2024-06-13 08:41:49 +02:00
Jiri Pechanec
932fa14b84 DBZ-7079 More precise error message 2024-06-13 06:34:04 +02:00
Chris Cranford
5b0be5e5c1 DBZ-7079 Support 0 length byte buffer / string column truncation 2024-06-13 06:34:04 +02:00
twthorn
430b8125a8 DBZ-7925 Expand truncate support to byte arrays in addition to strings 2024-06-06 11:41:02 +02:00
Debezium Builder
5273bb1601 [maven-release-plugin] prepare for next development iteration 2024-06-06 05:44:28 +00:00
Debezium Builder
a79c9ef799 [maven-release-plugin] prepare release v2.7.0.Beta1 2024-06-06 05:44:27 +00:00
rajdangwal
889a18f9dc DBZ-7902: Addressed review comments 2024-06-03 14:29:27 +02:00
rajdangwal
e390275d91 DBZ-7902: Add configurable delay after snapshotting, before starting streaming 2024-06-03 14:29:27 +02:00
mfvitale
87f18eac8a DBZ-7886 Skip current data collection snapshot when SQLException occurs 2024-05-31 08:30:16 +02:00
Ankur Gupta
1cf3b72f1b DBZ-7906 Enhancing the threads utility class for broader use 2024-05-31 08:26:15 +02:00
Vadzim Ramanenka
2917b78881 DBZ-7889: Multiple completed reading from a capture instance notifications
There is a small chance the connector doesn't advance and re-reads
the same LSN range. This happens under the following conditions:
* a new capture instance has been added in the current LSN range;
* while reading CDC changes one of existing capture instances
  dissapears.
The dissapeared capture instance causes an exception which is catched
and processed in `processErrorFromChangeTableQuery`. This leads to
the current connector iteration to be correctly exited without
advancing. On the next iteration the connector starts from the same
LSN as the previous iteration and finds the same new capture instance.
Although `Set` was used to track the list of tables to be removed
`SqlServerChangeTable` doesn't implement `hashCode` so same table
could be added multiple times to the same set.

The fix is to implement `hashCode` and `equals` methods in `ChangeTable`
which is the parent class of `SqlServerChangeTable`.

Additionally a synchronisation block is needed where the tables
are added to the hash map as it happens in a different thread from
the one that removes the tables from the hash map.
2024-05-31 07:24:40 +02:00
Mark Banierink
4bc98c6661 DBZ-7887 added additional JsonSerde constructor 2024-05-29 09:08:08 +02:00
Jiri Pechanec
b052d8a472 DBZ-7880 Make schema backward compatible 2024-05-22 14:20:02 +02:00
Jiri Pechanec
2dd6b4629e DBZ-7871 Use log level on first invocation 2024-05-16 13:28:14 +02:00
Roman Kudryashov
178b964b67 DBZ-7871 Change logging level for Found previous partition offset 2024-05-16 13:28:14 +02:00
sullis
369d95aa0c DBZ-7859: reduce enum array allocation 2024-05-14 13:33:17 +02:00
mfvitale
730eabc1f9 DBZ-7858 Initial snapshot completed/aborted notification will the correct offset 2024-05-14 12:14:53 +02:00
Debezium Builder
34a7c11de6 [maven-release-plugin] prepare for next development iteration 2024-05-13 06:42:03 +00:00
Debezium Builder
ebf74a8933 [maven-release-plugin] prepare release v2.7.0.Alpha2 2024-05-13 06:42:03 +00:00
mfvitale
c3a8ba4afb DBZ-7828 Correct filter query in snapshot task to handle SQLServer table quote 2024-05-10 07:42:09 +02:00
Debezium Builder
bcac0c5c7a [maven-release-plugin] prepare for next development iteration 2024-04-25 09:21:27 +00:00
Debezium Builder
0be6e6b8fd [maven-release-plugin] prepare release v2.7.0.Alpha1 2024-04-25 09:21:26 +00:00
mfvitale
f554d7f60d DBZ-7780 Avoid throw exception when snapshot is not completed and snapshot mode is no_data 2024-04-22 09:52:16 +02:00
mfvitale
30c11242ac DBZ-7616 Avoid to filter out every SET STATEMENT queries and filter just the ones related to Amazon RDS 2024-04-22 09:17:44 +02:00
mfvitale
8206d2d98d DBZ-7616 Add query timeout on JdbcConnection controlled by query.timeout.ms property 2024-04-22 09:17:44 +02:00
twthorn
3a9ea7ac4e DBZ-7698 Refactor to single factory interface/class/config 2024-04-19 10:23:30 +02:00
twthorn
0b80389f92 DBZ-7698 Rename from basic to default transaction info, add documentation, other minor changes 2024-04-19 10:23:30 +02:00
twthorn
0131401a19 DBZ-7698 Add instance method for load 2024-04-19 10:23:30 +02:00
twthorn
46ee422b53 DBZ-7698 Update config docs 2024-04-19 10:23:30 +02:00
twthorn
68cd944dc4 DBZ-7698 Add more tests 2024-04-19 10:23:30 +02:00
twthorn
993b6e73cc DBZ-7698 Fix variable definition 2024-04-19 10:23:30 +02:00
twthorn
261253d9f0 DBZ-7698 Refactor to generic transaction block customization 2024-04-19 10:23:30 +02:00
twthorn
efdc92a926 DBZ-7698 add method for backward compatibility 2024-04-19 10:23:30 +02:00
twthorn
24e4e4eb80 DBZ-7698 fix some failing tests 2024-04-19 10:23:30 +02:00
twthorn
ea8dddade3 DBZ-7698 Add ordered transaction metadata 2024-04-19 10:23:30 +02:00
Chris Cranford
60ac3c00a1 DBZ-7693 Add MariaDB connector 2024-04-18 10:27:21 +02:00
mfvitale
64454cc378 DBZ-7716 Correct IncrementalSnapshotContext dataCollectionsToSnapshot cache update 2024-04-11 07:53:48 +02:00
Fiore Mario Vitale
f37129dded DBZ-7765 Let LOG_POSITION_CHECK_ENABLED property as internal
Co-authored-by: Jiri Pechanec <jpechane@redhat.com>
2024-04-11 07:35:49 +02:00
mfvitale
6f0a56fc6f DBZ-7765 Add property to eventually disable log position validation on startup 2024-04-11 07:35:49 +02:00
mfvitale
717888f6f6 DBZ-7765 Use different query for validating log position for SQLServer 2024-04-11 07:35:49 +02:00
Roman Kudryashov
50c9f042a3 DBZ-7755 Refactor exporting to CloudEvents: remove RecordParser 2024-04-08 13:22:31 +02:00
mfvitale
ae7628a732 DBZ-7732 Add ConnectorSpecific annotation to manage multiple SPI connector specific implementation 2024-04-08 12:46:53 +02:00
mfvitale
ec3c68b0d8 DBZ-7717 Move LogPositionValidator outside JdbcConnection 2024-04-05 11:57:43 +02:00
mfvitale
ba2f893168 DBZ-7718 Support table name escaping in data collection to be snapshotted 2024-04-04 14:58:24 +02:00
Debezium Builder
ea182d83f3 [maven-release-plugin] prepare for next development iteration 2024-04-02 07:38:53 +00:00
Debezium Builder
7dcd94d19e [maven-release-plugin] prepare release v2.6.0.Final 2024-04-02 07:38:53 +00:00
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
8a6e7e93fa DBZ-7308 Manage when snapshot service is not available for connectors not supporting it 2024-03-25 05:46:46 +01: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
Jiri Pechanec
13b5224579 DBZ-7660 Reduce the severity as it is usually false positive 2024-03-22 08:42:52 +01:00
Chris Cranford
3a66a45632 DBZ-7596 Support reselection of ARRAY schema types 2024-03-18 13:44:14 +01:00
Chris Cranford
0e267d8ef6 DBZ-7596 Support reselection of PostgreSQL hstore values 2024-03-18 13:44:14 +01:00
mfvitale
71256cf1bc DBZ-7616 Honor the message.key.columns order while building query for incremental snapshot 2024-03-14 08:08:51 +01:00
harveyyue
48c67e40fb DBZ-7618 Implement Versioned interfaces in Transformation and Converter plugins 2024-03-14 06:35:42 +01:00
Chris Cranford
0ca302ab6b DBZ-7611 Only parse signal table collection id once 2024-03-12 08:55:14 +01:00
Chris Cranford
062155d573 DBZ-7611 Exclude signal table from re-selection 2024-03-12 08:55:14 +01:00
Chris Cranford
118fa1d293 DBZ-7615 Fix struct resolution for micro/nano second envelope time 2024-03-11 06:02:43 +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
2d06d847c3 DBZ-7303 Add tests for Always, When Needed and Custom snapshot mode for SQLServer connector 2024-03-04 11:17:06 +01:00
mfvitale
9ad4273791 DBZ-7303 Align snapshot modes for SqlServer connector 2024-03-04 11:17:06 +01:00
Chris Cranford
648db88868 DBZ-3401 Add new hybrid mining strategy 2024-03-03 00:46:23 -05:00
mfvitale
c942bd26d1 DBZ-7461 Revisit snapshot modes behavior when snapshot already completed 2024-03-01 14:12:31 +01:00
mfvitale
ce17bdcce6 DBZ-7461 Add generic properties for redo log archive and retention 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
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
3d93516b53 DBZ-5071 Create new RowValueConstructorChunkQueryBuilder
The default query builder has maximum SQL compatibility, but the query
plans it makes are not always optimal, especially in the case of
multi-column keys.  For example, PostgreSQL is unable to to effectively
create a query plan that does index scanning when faced with such a
query.

Some databases support the concept of row value constructors.  In
these cases, we can use these as an alternative to make a much more
simple and easier to understand query.  Not only is it easier for
humans to understand, but most importantly, the query planner also gets
the hint and finally uses the relevant multi-column index!  This commit
starts out with support for PostgreSQL and MySQL.
2024-02-29 13:36:26 +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
James Johnston
9352957244 DBZ-5071 Refactor buildChunkQuery into ChunkQueryBuilder
This commit prepares the way for further dialect-specific improvements
to incremental snapshot chunk queries by extracting the buildChunkQuery
and related functions behind a new ChunkQueryBuilder interface.  The
implementation is mostly in an AbstractChunkQueryBuilder, and a
DefaultChunkQueryBuilder inherits from that.

The chunk builders are instantiated by JdbcConnection via a new
chunkQueryBuilder function.  The base class uses the default, but
derived JdbcConnection classes could use a dialect-specific chunk query
builder.
2024-02-29 13:36:26 +01:00
Chris Cranford
66e23613ce DBZ-7072 Retry Oracle Flashback-based snapshot queries 2024-02-29 13:33:10 +01:00
ani-sha
cb81f75481 DBZ-6858 Add suggestions from code review 2024-02-29 11:55:51 +01:00
ani-sha
7feeed855f DBZ-6858 Simplify metadata logic 2024-02-29 11:55:51 +01:00
ani-sha
3bb5cb4c8e DBZ-6858 Use SignalMetadata class to provide open/close timestamps 2024-02-29 11:55:51 +01:00
ani-sha
f8cd1a6353 DBZ-6858 Timestamp metadata for watermarking signals 2024-02-29 11:55:51 +01:00
Chris Cranford
f7bacc64f1 DBZ-7534 Guarantee per-thread parallel snapshot dispatch order 2024-02-23 13:56:26 -05: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
4c15d2bd3f DBZ-6236 Fix test failures 2024-02-22 00:14:26 -05:00
Chris Cranford
0516c0cdbb DBZ-6236 Reset ErrorHandler retry counter on successful poll 2024-02-22 00:14:26 -05:00
mfvitale
7ed5649e07 DBZ-7302 Implement Snapshotter for Oracle 2024-02-20 14:45:59 +01:00
mfvitale
7a0ee72b31 DBZ-7302 Improve Snapshotter and SnapshotQuery Java docs 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
harveyyue
82f5e6ea77 DBZ-7480 Allow special characters in signal table name 2024-02-19 11:43:20 +01:00
Vojtech Juranek
ae53895cd8 DBZ-7495 Define constant for executor shutdown timeout
Unify executor shutdown timeout for executor services in the code base.
2024-02-19 08:45:33 +01:00