Commit Graph

883 Commits

Author SHA1 Message Date
Chris Cranford
212fe3db38 DBZ-7933 Fix default value TIME precision for micro/nano -seconds 2024-06-10 14:27:50 +02:00
Jiri Pechanec
b3eaab178b DBZ-7936 Fix test by removing earlier validation 2024-06-10 10:15:36 +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
e390275d91 DBZ-7902: Add configurable delay after snapshotting, before starting streaming 2024-06-03 14:29:27 +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
Vadzim Ramanenka
1045ecf604 DBZ-7893: Account for possible # in a column name
In the case when there is a `#` in a column name it gets replaced with
the capture instance name according to how the CDC data query is built.

This patch makes the replacement more specific by changing the
replacement placeholder from `#` to `#table` in this particular case.
2024-05-29 09:23:55 +02:00
Jiri Pechanec
b052d8a472 DBZ-7880 Make schema backward compatible 2024-05-22 14:20:02 +02:00
Jiri Pechanec
c09c2c6712 DBZ-7641 Update tests 2024-05-15 05:42:12 +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
8206d2d98d DBZ-7616 Add query timeout on JdbcConnection controlled by query.timeout.ms property 2024-04-22 09:17:44 +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
rajdangwal
3a8421ba4a DBZ-7750: Set default for max.iteration.transactions to 500 2024-04-08 10:32:12 +02:00
mfvitale
ec3c68b0d8 DBZ-7717 Move LogPositionValidator outside JdbcConnection 2024-04-05 11:57:43 +02:00
mfvitale
1190389edc DBZ-7718 Support table name escaping in BlockingSnapshotIT 2024-04-04 14:58:24 +02:00
mfvitale
5ce6fc8196 DBZ-7729 Fix shouldNotStreamWhenUsingSnapshotModeInitialOnly test assertion due to log message change 2024-04-04 14:52:45 +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
Ciaran O'Reilly
d8c323a520 DBZ-7359 incorporate 1st set of review feedback 2024-03-26 11:10:53 +01:00
Ciaran O'Reilly
1070e5f505 DBZ-7359 fix checkstyle and formatting check failures 2024-03-26 11:10:53 +01:00
Ciaran O'Reilly
fefcd4e79c DBZ-7359 Added setQueryColumnValue fix and supporting Integration Tests 2024-03-26 11:10:53 +01:00
Vojtech Juranek
3f3672c9e7 [ci] Mark stopCurrentIncrementalSnapshotWithoutCollectionsAndTakeNewNewIncrementalSnapshotAfterRestart as flaky 2024-03-25 17:48:31 +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
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
7f46f72747 DBZ-7657 Use SQL Server 2022 instead of 2019 2024-03-19 11:37:28 +01:00
Chris Cranford
fa482da850 [ci] Mark SqlServerConnectorIT restartInMiddleOfTx* tests Flaky 2024-03-18 13:12:05 +01:00
Chris Cranford
4361d3a30a DBZ-7593 Fix test failures 2024-03-07 11:01:43 +01:00
Chris Cranford
a76dfdebfa DBZ-7593 Always capture all permitted schema structures by default 2024-03-07 11:01: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
Vojtech Juranek
0c34c6ac68 [ci] Add missing ConditionalFail rule 2024-03-04 08:30:16 +01: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
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
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