Skip to content

Conversation

@alexr17
Copy link
Contributor

@alexr17 alexr17 commented Mar 11, 2025

Change Logs

Adds a heartbeat manager for the lock provider with conditional writes.

See RFC: #12927

Impact

This heartbeat manager is responsible for maintaining a thread which constantly updates the lock file in storage.

The heartbeat manager runs on a thread in same jvm as lock manager/writer client. This allows us to abstract away maintaining the lock from the lock provider. From the perspective of lock provider, all it does is call heartbeatManager.startHeartbeatForThread(Thread.currentThread()).

Risk level (write none, low medium or high below)

None

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".

None

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@github-actions github-actions bot added the size:L PR with lines of changes in (300, 1000] label Mar 11, 2025
}

if (this.hasActiveHeartbeat()) {
logger.warn("Owner {}: Heartbeat is already running.", ownerId);
Copy link
Contributor

@danny0405 danny0405 Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this HeartbeatManager is hold by a client, and the conflict resolution is taken care by the server(heartbeat recipient).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure I understand what you are asking:

  • heartbeat manager runs on a thread in same jvm as lock manager/writer client
  • this allows us to abstract away maintaining the lock from the lock provider.
  • from the perspective of lock provider, all it does is call heartbeatManager.startHeartbeatForThread(Thread.currentThread())

I will update the PR description with these details.

@alexr17 alexr17 changed the title [HUDI-9156][RFC-91] Add lock provider heartbeat manager [HUDI-9156]Add lock provider heartbeat manager Apr 7, 2025
@alexr17 alexr17 changed the title [HUDI-9156]Add lock provider heartbeat manager [HUDI-9156] Add lock provider heartbeat manager Apr 7, 2025
@hudi-bot
Copy link
Collaborator

hudi-bot commented Apr 7, 2025

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Copy link
Contributor

@danny0405 danny0405 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API looks good to me.

@danny0405 danny0405 merged commit 802f5ae into apache:master Apr 8, 2025
47 checks passed
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 8, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 9, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 11, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 15, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-1.0.2 size:L PR with lines of changes in (300, 1000]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants