Skip to content

Commit 27d1437

Browse files
authored
[DB sources] : Add back Debezium heartbeat timeout error (#42055)
1 parent 1c06673 commit 27d1437

File tree

6 files changed

+84
-94
lines changed

6 files changed

+84
-94
lines changed

airbyte-cdk/java/airbyte-cdk/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ corresponds to that version.
175175
=======
176176
| Version | Date | Pull Request | Subject |
177177
|:------------|:-----------| :--------------------------------------------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
178+
| 0.41.7 | 2024-07-17 | [\#42055](https://github.com/airbytehq/airbyte/pull/42055) | Add debezium heartbeat timeout back to shutdown debezium. |
178179
| 0.41.6 | 2024-07-17 | [\#41996](https://github.com/airbytehq/airbyte/pull/41996) | Fix java interop compilation issue in Config/TransientErrorException. |
179180
| 0.41.5 | 2024-07-16 | [\#42011] (https://github.com/airbytehq/airbyte/pull/42011) | Async consumer accepts null default namespace |
180181
| 0.41.4 | 2024-07-15 | [\#41959](https://github.com/airbytehq/airbyte/pull/41959) | Allow setting `internal_message` in Config/TransientErrorException. Destinations: shorten error message for INCOMPLETE stream status. |
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.41.6
1+
version=0.41.7

airbyte-cdk/java/airbyte-cdk/db-sources/src/main/kotlin/io/airbyte/cdk/integrations/debezium/internals/DebeziumRecordIterator.kt

+1-13
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,8 @@ class DebeziumRecordIterator<T>(
255255
private fun heartbeatPosNotChanging(): Boolean {
256256
if (this.tsLastHeartbeat == null) {
257257
return false
258-
} else if (!isTest() && receivedFirstRecord) {
259-
// Closing debezium due to heartbeat position not changing only exists as an escape
260-
// hatch
261-
// for testing setups. In production, we rely on the platform heartbeats to kill the
262-
// sync
263-
// ONLY if we haven't received a record from Debezium. If a record has not been received
264-
// from Debezium and the heartbeat isn't changing, the sync should be shut down due to
265-
// heartbeat position not changing.
266-
return false
267258
}
259+
268260
val timeElapsedSinceLastHeartbeatTs =
269261
Duration.between(this.tsLastHeartbeat, LocalDateTime.now())
270262
return timeElapsedSinceLastHeartbeatTs.compareTo(firstRecordWaitTime) > 0
@@ -288,10 +280,6 @@ class DebeziumRecordIterator<T>(
288280
}
289281
}
290282

291-
private fun isTest(): Boolean {
292-
return config.has("is_test") && config["is_test"].asBoolean()
293-
}
294-
295283
/**
296284
* [DebeziumRecordIterator.heartbeatEventSourceField] acts as a cache so that we avoid using
297285
* reflection to setAccessible for each event

airbyte-integrations/connectors/source-postgres/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ java {
1212
}
1313

1414
airbyteJavaConnector {
15-
cdkVersionRequired = '0.41.6'
15+
cdkVersionRequired = '0.41.7'
1616
features = ['db-sources', 'datastore-postgres']
1717
useLocalCdk = false
1818
}

airbyte-integrations/connectors/source-postgres/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ data:
99
connectorSubtype: database
1010
connectorType: source
1111
definitionId: decd338e-5647-4c0b-adf4-da0e75f5a750
12-
dockerImageTag: 3.5.0
12+
dockerImageTag: 3.5.1
1313
dockerRepository: airbyte/source-postgres
1414
documentationUrl: https://docs.airbyte.com/integrations/sources/postgres
1515
githubIssueLabel: source-postgres

0 commit comments

Comments
 (0)