[DBZ-PGYB][yugabyte/yugabyte-db#31289] Support upstream heartbeat behavior during streaming phase#198
Open
bakul-gupta wants to merge 1 commit intoybdb-debezium-2.5.2from
Open
[DBZ-PGYB][yugabyte/yugabyte-db#31289] Support upstream heartbeat behavior during streaming phase#198bakul-gupta wants to merge 1 commit intoybdb-debezium-2.5.2from
bakul-gupta wants to merge 1 commit intoybdb-debezium-2.5.2from
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8d8eef6. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
The YugabyteDB heartbeat implementation only dispatches heartbeats during the snapshot-to-streaming transition phase via
forcedBeat(). The regular timer-drivenheartbeat()method is a no-op, so during the streaming phase neitherheartbeat.interval.msnorheartbeat.action.queryhas any effect on YugabyteDB.Solution
Extend the YB-specific heartbeat to support upstream behavior during the streaming phase, while keeping snapshot-phase behavior and the snapshot-to-streaming transition behavior unchanged.
YBHeartbeatImpl:heartbeat(...)now delegates to the upstream timer-driven path whenheartbeat.interval.ms > 0and the offset shows snapshot is no longer in effect.forcedBeat(...)is unchanged.YBDatabaseHeartbeatImpl(new): extendsDatabaseHeartbeatImplwith the same streaming-only gate onheartbeat(...). InheritedforcedBeat(...)runsheartbeat.action.queryon each emitted heartbeat.PostgresConnectorConfig.createHeartbeat: returns the no-op heartbeat only when neither the transition wait nor streaming heartbeats are needed; picksYBDatabaseHeartbeatImplwhen an interval and an action query are both configured; falls back toYBHeartbeatImplotherwise.Behavior after this change
heartbeat.interval.ms > 0, periodic heartbeat records are produced; whenheartbeat.action.queryis also set, the query runs on each tick.Note
Medium Risk
Changes heartbeat emission and optional database action-query execution for YugabyteDB, which can affect connector liveness/offset behavior and adds periodic DB load during streaming.
Overview
Restores upstream heartbeat behavior for YugabyteDB during the streaming phase:
YBHeartbeatImpl.heartbeat()is no longer a no-op and now emits periodic heartbeats whenheartbeat.interval.ms > 0, while still suppressing heartbeats during snapshot based on the offset’s snapshot flag.Adds
YBDatabaseHeartbeatImplto supportheartbeat.action.queryfor YugabyteDB, and updatesPostgresConnectorConfig.createHeartbeat()to (a) return NOOP only when neither snapshot-to-streaming transition waiting nor streaming heartbeats are needed, and (b) chooseYBDatabaseHeartbeatImplwhen both an interval and action query are configured (otherwise falling back toYBHeartbeatImpl).Reviewed by Cursor Bugbot for commit 8d8eef6. Bugbot is set up for automated code reviews on this repo. Configure here.