iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

Flink 2.1: add EtcdLockFactory implementation.

Open slfan1989 opened this issue 2 months ago • 6 comments

Motivation

Iceberg currently supports JdbcLock and ZkLock as distributed lock backends. With the growing adoption of Flink on Kubernetes, it is increasingly important to support a lock mechanism that aligns well with cloud-native environments.

Etcd is widely used in Kubernetes ecosystems (as the backing store of Kubernetes itself) and is implemented based on the Raft consensus algorithm, which provides strong consistency and fault tolerance. Compared to Zookeeper, Etcd typically offers simpler operations and better performance in Raft-based consensus scenarios.

Adding an EtcdLockFactory will provide users with an additional, cloud-native friendly option for distributed lock management in Flink jobs running on Kubernetes.

Changes

  • Introduce EtcdLockFactory implementation in the Flink lock module.
  • Add configuration options for Etcd client connection (URI, connection timeout, keepalive, retries, etc.).
  • Provide integration with Iceberg’s existing lock abstraction.
  • Add tests using jetcd-launcher to verify Etcd-based lock behavior.

Usage

Users can enable Etcd-based locks in Flink by configuring:

iceberg.lock.impl=etcd
iceberg.lock.etcd.uri=http://127.0.0.1:2379
iceberg.lock.etcd.connection-timeout-ms=5000
iceberg.lock.etcd.keepalive-ms=30000
iceberg.lock.etcd.keepalive-timeout-ms=10000
iceberg.lock.etcd.max-retries=2

etcd versus other key-value stores

slfan1989 avatar Oct 02 '25 15:10 slfan1989

@pvary @mxm I’ve added a new lock implementation that uses etcd as a distributed lock. Could you please help review this PR? Thanks a lot!

slfan1989 avatar Oct 03 '25 02:10 slfan1989

Cc: @Guosmilesmile

pvary avatar Oct 03 '25 05:10 pvary

@Guosmilesmile @pvary Could we continue to move forward with this pr? I would really appreciate your help. Thank you so much!

slfan1989 avatar Oct 24 '25 06:10 slfan1989

@slfan1989 Sorry, I’ve been quite busy lately. I’ll find some time to continue the review soon. Thank you!

Guosmilesmile avatar Oct 24 '25 08:10 Guosmilesmile

@Guosmilesmile When you have a moment, Could you please take another look at this PR? I really appreciate your time and help!

cc: @pvary

slfan1989 avatar Nov 10 '25 03:11 slfan1989

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Dec 12 '25 00:12 github-actions[bot]

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

github-actions[bot] avatar Dec 19 '25 00:12 github-actions[bot]