Commit Graph

9699 Commits

Author SHA1 Message Date
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
Jiri Pechanec
20e5693336 [ci] Use globally configured flag 2024-02-29 13:30:23 +01:00
Vojtech Juranek
b71c561cf2 [ci] Ignore flaky tests on Informix connector 2024-02-29 13:30:23 +01:00
Jiri Pechanec
4b91a71ea9 DBZ-7574 Upgrade Kafka to 3.7.0 2024-02-29 12:53:45 +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
c83c3c3922 DBZ-7582 Correctly serialize toasted HSTORE values when unavailable 2024-02-29 11:18:58 +01:00
roldanbob
e017062eb9 DBZ-7499 Fix deployment examples that expose attribute names vs values 2024-02-28 17:21:49 -05:00
Chris Cranford
c4cc05b816 DBZ-7565 Align PostgreSQL hstore.handling.mode default values 2024-02-28 09:26:16 -05:00
Chris Cranford
254fc2fa1b DBZ-7562 Add requested validate record 2024-02-27 22:40:15 -05:00
Chris Cranford
3fd66483d9 DBZ-7562 Add "default values" assertion check 2024-02-27 22:40:15 -05:00
Chris Cranford
45805eef8c DBZ-7562 Truncate values that exceed column scale 2024-02-27 22:40:15 -05:00
Enzo Cappa
cfab3505b8 DBZ-7571: fix: minor bump of PosgreSQL driver to fix vulnerability
The current version is affected by
[SNYK-JAVA-ORGPOSTGRESQL-6252740](https://security.snyk.io/vuln/SNYK-JAVA-ORGPOSTGRESQL-6252740)

The vunerability fix is the only change in the
[changelog](https://github.com/pgjdbc/pgjdbc/compare/REL42.6.0...REL42.6.1)
2024-02-27 16:43:40 -05:00
Vojtech Juranek
83c339c2ae [ci] Mark ReadOnlyIncrementalSnapshotIT#testStopSnapshotKafkaSignal as flaky 2024-02-27 16:38:15 -05:00
Vojtech Juranek
1459c25fb8 [docs] Fix typo in partition routing documentation 2024-02-27 15:47:57 -05:00
Bue-Von-Hun
94e24532f6 DBZ-2015 Remove redundant fields 2024-02-27 15:30:48 +01:00
Martin Medek
7b38ab5b32
DBZ-7569 removed lombok code from debezium-testing-system (#5327) 2024-02-27 15:08:12 +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
dependabot[bot]
c3ff0fb197 [ci] Bump tj-actions/changed-files from 42.0.4 to 42.0.5
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 42.0.4 to 42.0.5.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v42.0.4...v42.0.5)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-27 06:29:40 +01:00
Chris Cranford
09d500359f [ci] Mark MongoDbReplicaSetAuthTest Flaky 2024-02-26 21:44:16 -05:00
Martin Medek
34682b55b7 DBZ-7221 sharded mongo tests - renamed some classes, added javadocs 2024-02-26 09:56:04 +01:00
Martin Medek
28105c108f DBZ-7221 sharded mongo tests - fixed Freemarker Configuration creation, removed redundant methods, refactor 2024-02-26 09:56:04 +01:00
Martin Medek
ec90242567 DBZ-7221 sharded mongo tests - fixed deployments when internal auth isn't used, removed unnecessary permissions for debezium user 2024-02-26 09:56:04 +01:00
Martin Medek
26004d67a5 DBZ-7221 refactored mongo sharded tests, mongo deployment is now parametrized by replica, shard count, root user credentials and keyfile for internal auth. 2024-02-26 09:56:04 +01:00
Chris Cranford
b6e45beab1 DBZ-7453 Exclude testEmptyChangesProducesHeartbeat for pgoutput 2024-02-23 13:56:26 -05:00
Chris Cranford
f7bacc64f1 DBZ-7534 Guarantee per-thread parallel snapshot dispatch order 2024-02-23 13:56:26 -05:00
Chris Cranford
940b3cfbeb DBZ-7530 Make PG parallel snapshot test shouldGenerateSnapshotAndContinueStreaming stable 2024-02-23 13:56:26 -05:00
Chris Cranford
5c144cd0d0 DBZ-7559 Retry XStream ORA-23656 exceptions 2024-02-23 07:31:59 -05:00
rkerner
71c2084c4b 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
+ make changes on debezium-core and other common packages (styleguide, api, etc) trigger builds for debezium-connect-rest-extension and debezium-schema-generator too

closes https://issues.redhat.com/browse/DBZ-7416

closes https://issues.redhat.com/browse/DBZ-7416
2024-02-22 13:34:08 -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
Jiri Pechanec
4ca2a67b0d DBZ-7517 Correct contributor 2024-02-22 09:07:55 +01:00
Xianming Zhou
950215c9cc DBZ-7517 add author name and alias 2024-02-22 09:07:55 +01:00
Xianming Zhou
86c1dac16a DBZ-7517 Remove the unused 'connector' parameter in the createSourceTask method in EmbeddedEngine.java 2024-02-22 09:07:55 +01:00
Vojtech Juranek
ae802f5642 DBZ-7524 Allow to customze version regex 2024-02-22 08:41:01 +01:00
Vojtech Juranek
4feb65f50c DBZ-7524 Download image from Docker Hub as a fallback option 2024-02-22 08:41:01 +01:00
Jiri Pechanec
df18e00173 DBZ-7535 Use error level for error message 2024-02-22 08:31:58 +01:00
Vojtech Juranek
7edefef14c DBZ-7535 Ensure at least one task starts and one fails
Add also `INFO` log with number of failed tasks.
2024-02-22 08:31:58 +01: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
e680840c4a DBZ-7541 Add wait check to let database return online during SqlServerConnectorIT tests 2024-02-21 20:07:23 -05:00
roldanbob
feed723e4f DBZ-7418 Converts remaining lists of callout descriptions to tables 2024-02-21 15:57:37 -05:00
roldanbob
f7855ddb80 DBZ-7418 Fix more callout descriptions in CloudEvents doc 2024-02-21 15:57:37 -05:00
Chris Cranford
6af8a7c70b [ci] Add Flaky to shouldCreateSnapshotOfSingleDatabaseWithoutGlobalLock (MySQL) 2024-02-21 09:00:45 -05:00
Chris Cranford
ad721dcb8b [ci] Add skipping flaky tests to CI 2024-02-21 09:00:45 -05:00