santosh-d3vpl3x opened a new pull request, #18843:
URL: https://github.com/apache/druid/pull/18843
Fixes #18746.
### Description
Add contrib extension `druid-consul-extensions` to let Druid use Consul for
service discovery and Coordinator/Overlord leader election as
an alternative to ZooKeeper, using the HTTP server view and indexer runner.
#### Consul-based discovery and leader election
- Wire `ConsulDiscoveryModule` to provide Consul-backed announcer, discovery
provider, and leader selector when the extension is enabled.
- Implement `ConsulDruidNodeAnnouncer`, `ConsulDruidNodeDiscoveryProvider`,
and `ConsulLeaderSelector` on top of `ConsulApiClient` /
`DefaultConsulApiClient`, with `ConsulServiceIds`, `ConsulDiscoveryConfig`,
and `ConsulSSLConfig` for configuration.
- Add `ConsulMetrics`, retry/backoff handling, and clear logging around
registration, watches, and leader lock lifecycle.
#### Tests and documentation
- Add unit tests for config, announcer, leader selector, client security,
and service ID behavior.
- Add embedded/docker Consul discovery tests covering plain, TLS, and mTLS,
including restart/failover.
- Document the extension, configuration examples, a basic Consul dev
harness, and a high-level migration path from ZooKeeper.
#### Release note
Add optional contrib extension `druid-consul-extensions` that lets Druid
clusters use Consul for service discovery and
Coordinator/Overlord leader election instead of ZooKeeper, with support for
ACLs, TLS/mTLS, and metrics. This requires
`druid.serverview.type=http` and `druid.indexer.runner.type=httpRemote` to
be enabled cluster-wide before switching selectors to Consul.
---
##### Key changed/added classes in this PR
-
`extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryModule`
-
`extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig`
-
`extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeAnnouncer`
-
`extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider`
-
`extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulLeaderSelector`
-
`extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulApiClient`
-
`embedded-tests/src/test/java/org/apache/druid/testing/embedded/docker/BaseConsulDiscoveryDockerTest`
and Consul Docker test subclasses
---
This PR has:
- [x] been self-reviewed.
- [x] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [x] added documentation for new or modified features or behaviors.
- [x] a release note entry in the PR description.
- [x] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [x] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [x] added integration tests.
- [x] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]