Skip to content

Commit 50ce465

Browse files
authored
refactor: remove deprecated zookeeper-based task runner (#19500)
1 parent b3b1ff2 commit 50ce465

61 files changed

Lines changed: 389 additions & 7787 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/configuration/index.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,6 @@ Druid interacts with ZooKeeper through a set of standard path configurations. We
156156
|`druid.zk.paths.base`|Base ZooKeeper path.|`/druid`|
157157
|`druid.zk.paths.coordinatorPath`|Used by the Coordinator for leader election.|`${druid.zk.paths.base}/coordinator`|
158158

159-
The indexing service also uses its own set of paths. These configs can be included in the common configuration.
160-
161-
|Property|Description|Default|
162-
|--------|-----------|-------|
163-
|`druid.zk.paths.indexer.base`|Base ZooKeeper path for |`${druid.zk.paths.base}/indexer`|
164-
|`druid.zk.paths.indexer.announcementsPath`|Middle Managers announce themselves here.|`${druid.zk.paths.indexer.base}/announcements`|
165-
|`druid.zk.paths.indexer.tasksPath`|Used to assign tasks to Middle Managers.|`${druid.zk.paths.indexer.base}/tasks`|
166-
|`druid.zk.paths.indexer.statusPath`|Parent path for announcement of task statuses.|`${druid.zk.paths.indexer.base}/status`|
167-
168-
If `druid.zk.paths.base` and `druid.zk.paths.indexer.base` are both set, and none of the other `druid.zk.paths.*` or `druid.zk.paths.indexer.*` values are set, then the other properties will be evaluated relative to their respective `base`.
169-
For example, if `druid.zk.paths.base` is set to `/druid1` and `druid.zk.paths.indexer.base` is set to `/druid2` then `druid.zk.paths.coordinatorPath` will default to `/druid1/coordinator` while `druid.zk.paths.indexer.announcementsPath` will default to `/druid2/announcements`.
170-
171159
The following path is used for service discovery. It is **not** affected by `druid.zk.paths.base` and **must** be specified separately.
172160

173161
|Property|Description|Default|
@@ -966,7 +954,7 @@ These Overlord static configurations can be defined in the `overlord/runtime.pro
966954

967955
|Property|Description|Default|
968956
|--------|-----------|-------|
969-
|`druid.indexer.runner.type`|Indicates whether tasks should be run locally using `local` or in a distributed environment using `remote`. The recommended option is `httpRemote`, which is similar to `remote` but uses HTTP to interact with Middle Managers instead of ZooKeeper.|`httpRemote`|
957+
|`druid.indexer.runner.type`|Indicates whether tasks should be run locally using `local` or in a distributed environment using `httpRemote`. `httpRemote` is recommended for distributed deployments and uses HTTP to interact with Middle Managers.|`httpRemote`|
970958
|`druid.indexer.server.maxConcurrentActions`|Maximum number of concurrent action requests (such as getting locks, creating segments, fetching segments etc) that the Overlord will process simultaneously. This prevents thread exhaustion while preserving access to health check endpoints. Set to `0` to disable quality of service filtering entirely. If not specified, defaults to `max(1, max(serverHttpNumThreads - 4, serverHttpNumThreads * 0.8))`.|`max(1, max(serverHttpNumThreads - 4, serverHttpNumThreads * 0.8))`|
971959
|`druid.indexer.storage.type`|Indicates whether incoming tasks should be stored locally (in heap) or in metadata storage. One of `local` or `metadata`. `local` is mainly for internal testing while `metadata` is recommended in production because storing incoming tasks in metadata storage allows for tasks to be resumed if the Overlord should fail.|`local`|
972960
|`druid.indexer.storage.recentlyFinishedThreshold`|Duration of time to store task results. Default is 24 hours. If you have hundreds of tasks running in a day, consider increasing this threshold.|`PT24H`|
@@ -981,17 +969,14 @@ These Overlord static configurations can be defined in the `overlord/runtime.pro
981969
|`druid.indexer.queue.storageSyncRate`|Sync Overlord state this often with an underlying task persistence mechanism.|`PT1M`|
982970
|`druid.indexer.queue.maxTaskPayloadSize`|Maximum allowed size in bytes of a single task payload accepted by the Overlord.|none (allow all task payload sizes)|
983971

984-
The following configs only apply if the Overlord is running in remote mode. For a description of local vs. remote mode, see [Overlord service](../design/overlord.md).
972+
The following configs apply when the Overlord is running with the `httpRemote` runner. For a description of local vs. distributed mode, see [Overlord service](../design/overlord.md).
985973

986974
|Property|Description|Default|
987975
|--------|-----------|-------|
988976
|`druid.indexer.runner.taskAssignmentTimeout`|How long to wait after a task has been assigned to a Middle Manager before throwing an error.|`PT5M`|
989977
|`druid.indexer.runner.minWorkerVersion`|The minimum Middle Manager version to send tasks to. The version number is a string. This affects the expected behavior during certain operations like comparison against `druid.worker.version`. Specifically, the version comparison follows dictionary order. Use ISO8601 date format for the version to accommodate date comparisons. |"0"|
990978
|`druid.indexer.runner.parallelIndexTaskSlotRatio`| The ratio of task slots available for parallel indexing supervisor tasks per worker. The specified value must be in the range `[0, 1]`. |1|
991-
|`druid.indexer.runner.compressZnodes`|Indicates whether or not the Overlord should expect Middle Managers to compress Znodes.|true|
992-
|`druid.indexer.runner.maxZnodeBytes`|The maximum size Znode in bytes that can be created in ZooKeeper, should be in the range of `[10KiB, 2GiB)`. [Human-readable format](human-readable-byte.md) is supported.| 512 KiB |
993-
|`druid.indexer.runner.taskCleanupTimeout`|How long to wait before failing a task after a Middle Manager is disconnected from ZooKeeper.|`PT15M`|
994-
|`druid.indexer.runner.taskShutdownLinkTimeout`|How long to wait on a shutdown request to a Middle Manager before timing out|`PT1M`|
979+
|`druid.indexer.runner.taskCleanupTimeout`|How long to wait before failing a task after a Middle Manager is disconnected.|`PT15M`|
995980
|`druid.indexer.runner.pendingTasksRunnerNumThreads`|Number of threads to allocate pending-tasks to workers, must be at least 1.|1|
996981
|`druid.indexer.runner.maxRetriesBeforeBlacklist`|Number of consecutive times the Middle Manager can fail tasks, before the worker is blacklisted, must be at least 1|5|
997982
|`druid.indexer.runner.workerBlackListBackoffTime`|How long to wait before a task is whitelisted again. This value should be greater that the value set for taskBlackListCleanupPeriod.|`PT15M`|
@@ -1322,12 +1307,10 @@ Middle Managers pass their configurations down to their child peons. The Middle
13221307
|Property|Description|Default|
13231308
|--------|-----------|-------|
13241309
|`druid.indexer.runner.allowedPrefixes`|Whitelist of prefixes for configs that can be passed down to child peons.|`com.metamx`, `druid`, `org.apache.druid`, `user.timezone`, `file.encoding`, `java.io.tmpdir`, `hadoop`|
1325-
|`druid.indexer.runner.compressZnodes`|Indicates whether or not the Middle Managers should compress Znodes.|true|
13261310
|`druid.indexer.runner.classpath`|Java classpath for the peon.|`System.getProperty("java.class.path")`|
13271311
|`druid.indexer.runner.javaCommand`|Command required to execute java.|java|
13281312
|`druid.indexer.runner.javaOpts`|_DEPRECATED_ A string of -X Java options to pass to the peon's JVM. Quotable parameters or parameters with spaces are encouraged to use javaOptsArray|`''`|
13291313
|`druid.indexer.runner.javaOptsArray`|A JSON array of strings to be passed in as options to the peon's JVM. This is additive to `druid.indexer.runner.javaOpts` and is recommended for properly handling arguments which contain quotes or spaces like `["-XX:OnOutOfMemoryError=kill -9 %p"]`|`[]`|
1330-
|`druid.indexer.runner.maxZnodeBytes`|The maximum size Znode in bytes that can be created in ZooKeeper, should be in the range of [10KiB, 2GiB). [Human-readable format](human-readable-byte.md) is supported.|512KiB|
13311314
|`druid.indexer.runner.startPort`|Starting port used for Peon services, should be greater than 1023 and less than 65536.|8100|
13321315
|`druid.indexer.runner.endPort`|Ending port used for Peon services, should be greater than or equal to `druid.indexer.runner.startPort` and less than 65536.|65535|
13331316
|`druid.indexer.runner.ports`|A JSON array of integers to specify ports that used for Peon services. If provided and non-empty, ports for Peon services will be chosen from these ports. And `druid.indexer.runner.startPort/druid.indexer.runner.endPort` will be completely ignored.|`[]`|

docs/design/zookeeper.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ The operations that happen over ZK are:
3636
1. [Coordinator](../design/coordinator.md) leader election
3737
2. [Overlord](../design/overlord.md) leader election
3838
3. Service (node) announcement and discovery — services announce their presence so other services can find them
39-
4. [Overlord](../design/overlord.md) and [Middle Manager](../design/middlemanager.md) task management
4039

41-
Segment loading, dropping, and discovery no longer use ZooKeeper — they are served over HTTP.
40+
Segment loading, segment discovery, and Overlord ↔ Middle Manager task management no longer use ZooKeeper — they are served over HTTP.
4241

4342
## Coordinator leader election
4443

docs/development/extensions-core/k8s-jobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ To do this, set the following property.
10191019
|Property| Possible Values |Description|Default|required|
10201020
|--------|-----------------|-----------|-------|--------|
10211021
|`druid.indexer.runner.k8sAndWorker.runnerStrategy.type`| `String` (e.g., `k8s`, `worker`, `taskType`)| Defines the strategy for task runner selection. |`k8s`|No|
1022-
|`druid.indexer.runner.k8sAndWorker.runnerStrategy.workerType`| `String` (e.g., `httpRemote`, `remote`)| Specifies the variant of the worker task runner to be utilized.|`httpRemote`|No|
1022+
|`druid.indexer.runner.k8sAndWorker.runnerStrategy.workerType`| `String` (e.g., `httpRemote`)| Specifies the variant of the worker task runner to be utilized.|`httpRemote`|No|
10231023
| **For `taskType` runner strategy:**|||||
10241024
|`druid.indexer.runner.k8sAndWorker.runnerStrategy.taskType.default`| `String` (e.g., `k8s`, `worker`) | Specifies the default runner to use if no overrides apply. This setting ensures there is always a fallback runner available.|None|No|
10251025
|`druid.indexer.runner.k8sAndWorker.runnerStrategy.taskType.overrides`| `JsonObject`(e.g., `{"index_kafka": "worker"}`)| Defines task-specific overrides for runner types. Each entry sets a task type to a specific runner, allowing fine control. |`{}`|No|

extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesAndWorkerTaskRunnerConfig.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.fasterxml.jackson.annotation.JsonProperty;
2424
import com.google.common.base.Preconditions;
2525
import org.apache.commons.lang3.ObjectUtils;
26-
import org.apache.druid.indexing.overlord.RemoteTaskRunnerFactory;
2726
import org.apache.druid.indexing.overlord.hrtr.HttpRemoteTaskRunnerFactory;
2827

2928
import javax.annotation.Nullable;
@@ -51,11 +50,9 @@ public KubernetesAndWorkerTaskRunnerConfig(
5150
this.runnerStrategy = ObjectUtils.getIfNull(runnerStrategy, KubernetesTaskRunnerFactory.TYPE_NAME);
5251
this.workerType = ObjectUtils.getIfNull(workerType, HttpRemoteTaskRunnerFactory.TYPE_NAME);
5352
Preconditions.checkArgument(
54-
this.workerType.equals(HttpRemoteTaskRunnerFactory.TYPE_NAME) ||
55-
this.workerType.equals(RemoteTaskRunnerFactory.TYPE_NAME),
56-
"workerType must be set to one of (%s, %s)",
57-
HttpRemoteTaskRunnerFactory.TYPE_NAME,
58-
RemoteTaskRunnerFactory.TYPE_NAME
53+
this.workerType.equals(HttpRemoteTaskRunnerFactory.TYPE_NAME),
54+
"workerType must be set to [%s]; the ZooKeeper-based 'remote' worker type has been removed.",
55+
HttpRemoteTaskRunnerFactory.TYPE_NAME
5956
);
6057
}
6158

extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesOverlordModule.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.apache.druid.guice.annotations.Self;
4545
import org.apache.druid.guice.annotations.Smile;
4646
import org.apache.druid.indexing.common.config.TaskConfig;
47-
import org.apache.druid.indexing.overlord.RemoteTaskRunnerFactory;
4847
import org.apache.druid.indexing.overlord.TaskRunnerFactory;
4948
import org.apache.druid.indexing.overlord.WorkerTaskRunner;
5049
import org.apache.druid.indexing.overlord.config.TaskQueueConfig;
@@ -264,10 +263,10 @@ public void stop()
264263
}
265264

266265
/**
267-
* Provides a TaskRunnerFactory instance suitable for environments without Zookeeper.
268-
* In such environments, the standard RemoteTaskRunnerFactory may not be operational.
269-
* Depending on the workerType defined in KubernetesAndWorkerTaskRunnerConfig,
270-
* this method selects and returns an appropriate TaskRunnerFactory implementation.
266+
* Provides the worker-side {@link TaskRunnerFactory} that the {@code k8sAndWorker} runner pairs
267+
* with {@link KubernetesTaskRunnerFactory}. Only {@link HttpRemoteTaskRunnerFactory} is
268+
* supported; the ZooKeeper-based 'remote' worker type was removed, and
269+
* {@link KubernetesAndWorkerTaskRunnerConfig} enforces this at config-validation time.
271270
*/
272271
@Provides
273272
@LazySingleton
@@ -277,10 +276,8 @@ TaskRunnerFactory<? extends WorkerTaskRunner> provideWorkerTaskRunner(
277276
Injector injector
278277
)
279278
{
280-
String workerType = runnerConfig.getWorkerType();
281-
return HttpRemoteTaskRunnerFactory.TYPE_NAME.equals(workerType)
282-
? injector.getInstance(HttpRemoteTaskRunnerFactory.class)
283-
: injector.getInstance(RemoteTaskRunnerFactory.class);
279+
// workerType is validated to be HttpRemoteTaskRunnerFactory.TYPE_NAME by the config.
280+
return injector.getInstance(HttpRemoteTaskRunnerFactory.class);
284281
}
285282

286283
/**

extensions-core/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/KubernetesAndWorkerTaskRunnerConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void test_deserializable() throws IOException
3838
);
3939

4040
Assertions.assertEquals("worker", config.getRunnerStrategy());
41-
Assertions.assertEquals("remote", config.getWorkerType());
41+
Assertions.assertEquals("httpRemote", config.getWorkerType());
4242
}
4343

4444
@Test

0 commit comments

Comments
 (0)