You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kfaraz (via GitHub)" <gi...@apache.org> on 2025/03/07 08:52:13 UTC
[PR] Use compaction dynamic config to enable compaction supervisors (druid)
kfaraz opened a new pull request, #17782:
URL: https://github.com/apache/druid/pull/17782
### Description
#16768 introduces the option to run compaction as a supervisor on Overlord instead of via coordinator duties.
It also packages several improvements over the traditional compaction duty, such as support for using
the MSQ engine to launch compaction tasks.
However, that patch relies on an Overlord runtime property to enable/disable this feature, which can be
cumbersome and error prone, given that both Coordinator and Overlord need to be aware of it.
It also leads to a poorer design since half of compaction-related features are controlled by the compaction
dynamic config whereas the other half is controlled by the runtime properties.
This patch reconciles the two by simply using compaction dynamic config for all purposes.
It has the added benefit of allowing a quick switch between Overlord supervisor and Coordinator duty, in
case something misbehaves or perhaps for testing purposes.
### Changes
- Remove runtime property object `CompactionSupervisorConfig`
- Add fields `useSupervisors` and `engine` to cluster-level compaction dynamic config
- Remove unused field `useAutoScaleSlots`
### Release note
TODO
<hr>
This PR has:
- [ ] been self-reviewed.
- [ ] 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.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
- [ ] 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.
- [ ] 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.
- [ ] added integration tests.
- [ ] 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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #17782:
URL: https://github.com/apache/druid/pull/17782#issuecomment-2744974980
Sounds good. Thanks for the clarification, @vogievetsky .
Do you think it would also help to have a separate `GET /druid/coordinator/v1/config/compaction/cluster`
to fetch just the cluster config and not the whole compaction config (including all datasources)?
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #17782:
URL: https://github.com/apache/druid/pull/17782#issuecomment-2744965596
@vogievetsky , had you updated the config in a prior API call to use `engine: msq`?
You can verify that by doing a `GET /druid/coordinator/v1/config/compaction`.
(On that note, I think we should also add a separate `GET /druid/coordinator/v1/config/compaction/cluster`).
The update API `POST /druid/coordinator/v1/config/compaction/cluster` only updates the configs
that have been specified in the payload and leaves the rest unchanged.
This was done to align with the API `POST /druid/coordinator/v1/config` (i.e. update coordinator dynamic config)
which behaves in a similar way.
I would personally prefer if both of these APIs (or atleast the new one) just updated the whole object
(since that is what most users would expect anyway).
Please let me know what you think. I will make the necessary changes.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #17782:
URL: https://github.com/apache/druid/pull/17782#issuecomment-2745984864
@vogievetsky , I am merging this PR for now.
Will create a follow up PR for any further changes.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r1994395619
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,88 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy`|Policy to prioritize intervals for compaction|`newestSegmentFirst`|
+|`useSupervisors`|Whether compaction should be run on Overlord using supervisors instead of Coordinator duties.|false|
+|`engine`|Engine to use for running compaction tasks, native or MSQ.|Native|
Review Comment:
This should list the values exactly as you feed them into the API like `"native"` or `"msq"`. Does this property only apply if `useSupervisors: true`? if so it should be noted.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r2007002370
##########
docs/data-management/automatic-compaction.md:
##########
@@ -243,11 +243,12 @@ You can run automatic compaction using compaction supervisors on the Overlord ra
* Tracked compaction task status to avoid re-compacting an interval repeatedly
-To use compaction supervisors, set the following properties in your Overlord runtime properties:
- * `druid.supervisor.compaction.enabled` to `true` so that compaction tasks can be run as supervisor tasks
- * `druid.supervisor.compaction.engine` to `msq` to specify the MSQ task engine as the compaction engine or to `native` to use the native engine. This is the default engine if the `engine` field is omitted from your compaction config
+To use compaction supervisors, update the [compaction dynamic config](../api-reference/automatic-compaction-api.md#update-cluster-level-compaction-config) and set:
-Compaction supervisors use the same syntax as auto-compaction using Coordinator duties with one key difference: you submit the auto-compaction as a a supervisor spec. In the spec, set the `type` to `autocompact` and include the auto-compaction config in the `spec`.
+* `useSupervisors` to `true` so that compaction tasks can be run as supervisor tasks
Review Comment:
NVM. I think these are compaction specific endpoints so we donot need the compaction key.
Changes LGTM.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on PR #17782:
URL: https://github.com/apache/druid/pull/17782#issuecomment-2722885226
Is the `/druid/coordinator/v1/config/compaction/cluster` API added in this PR?
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r1984762094
##########
server/src/test/java/org/apache/druid/server/http/CoordinatorCompactionConfigsResourceTest.java:
##########
@@ -134,7 +136,7 @@
final DruidCompactionConfig defaultConfig
= verifyAndGetPayload(resource.getCompactionConfig(), DruidCompactionConfig.class);
- Response response = resource.setCompactionTaskLimit(0.5, 9, true, mockHttpServletRequest);
+ Response response = resource.setCompactionTaskLimit(0.5, 9, mockHttpServletRequest);
Review Comment:
## Deprecated method or constructor invocation
Invoking [CoordinatorCompactionConfigsResource.setCompactionTaskLimit](1) should be avoided because it has been deprecated.
[Show more details](https://github.com/apache/druid/security/code-scanning/8710)
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r1995891956
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,88 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy`|Policy to prioritize intervals for compaction|`newestSegmentFirst`|
Review Comment:
Yes, should have kept this PR in draft. Still working on the docs.
But yes, the result of the GET is the correct format.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r2006994876
##########
docs/data-management/automatic-compaction.md:
##########
@@ -243,11 +243,12 @@ You can run automatic compaction using compaction supervisors on the Overlord ra
* Tracked compaction task status to avoid re-compacting an interval repeatedly
-To use compaction supervisors, set the following properties in your Overlord runtime properties:
- * `druid.supervisor.compaction.enabled` to `true` so that compaction tasks can be run as supervisor tasks
- * `druid.supervisor.compaction.engine` to `msq` to specify the MSQ task engine as the compaction engine or to `native` to use the native engine. This is the default engine if the `engine` field is omitted from your compaction config
+To use compaction supervisors, update the [compaction dynamic config](../api-reference/automatic-compaction-api.md#update-cluster-level-compaction-config) and set:
-Compaction supervisors use the same syntax as auto-compaction using Coordinator duties with one key difference: you submit the auto-compaction as a a supervisor spec. In the spec, set the `type` to `autocompact` and include the auto-compaction config in the `spec`.
+* `useSupervisors` to `true` so that compaction tasks can be run as supervisor tasks
Review Comment:
All these policies seems compaction specific.
IMHO it would be better if we have
```
compaction :
{
useSupervisors:true,
engine:msq
}
```
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r2007002260
##########
docs/data-management/automatic-compaction.md:
##########
@@ -243,11 +243,12 @@ You can run automatic compaction using compaction supervisors on the Overlord ra
* Tracked compaction task status to avoid re-compacting an interval repeatedly
-To use compaction supervisors, set the following properties in your Overlord runtime properties:
- * `druid.supervisor.compaction.enabled` to `true` so that compaction tasks can be run as supervisor tasks
- * `druid.supervisor.compaction.engine` to `msq` to specify the MSQ task engine as the compaction engine or to `native` to use the native engine. This is the default engine if the `engine` field is omitted from your compaction config
+To use compaction supervisors, update the [compaction dynamic config](../api-reference/automatic-compaction-api.md#update-cluster-level-compaction-config) and set:
-Compaction supervisors use the same syntax as auto-compaction using Coordinator duties with one key difference: you submit the auto-compaction as a a supervisor spec. In the spec, set the `type` to `autocompact` and include the auto-compaction config in the `spec`.
+* `useSupervisors` to `true` so that compaction tasks can be run as supervisor tasks
Review Comment:
Oh, this is already a separate compaction API itself.
Adding another nesting would be redundant since the whole payload is for compaction only.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r1994397144
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,88 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy`|Policy to prioritize intervals for compaction|`newestSegmentFirst`|
+|`useSupervisors`|Whether compaction should be run on Overlord using supervisors instead of Coordinator duties.|false|
+|`engine`|Engine to use for running compaction tasks, native or MSQ.|Native|
+
+#### URL
+
+`POST` `/druid/coordinator/v1/config/compaction/cluster`
+
+#### Responses
+
+<Tabs>
+
+<TabItem value="8" label="200 SUCCESS">
+
+
+*Successfully updated compaction configuration*
+
+</TabItem>
+<TabItem value="9" label="404 NOT FOUND">
+
+
+*Invalid `max` value*
+
+</TabItem>
+</Tabs>
+
+---
+
+#### Sample request
+
+<Tabs>
+
+<TabItem value="10" label="cURL">
+
+
+```shell
+curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction/cluster" \
+--header 'Content-Type: application/json' \
+--data '{
+ "compactionTaskSlotRatio": 0.5,
+ "maxCompactionTaskSlots": 1500,
+ "compactionPolicy": "newestSegmentFirst",
+ "useSupervisors": true,
+ "engine": "MSQ"
Review Comment:
should this be `"msq"` (lowercase)?
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #17782:
URL: https://github.com/apache/druid/pull/17782#issuecomment-2723503174
> Is the /druid/coordinator/v1/config/compaction/cluster API added in this PR?
No, @vogievetsky , this API was added a while back but some new fields are being added to this API in this PR.
Thanks for the docs suggestions, I will update them accordingly.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on PR #17782:
URL: https://github.com/apache/druid/pull/17782#issuecomment-2749585702
Thank you for addressing my feedback. I think a separate API to fetch just the cluster config would be really great. The current API is very messy.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on PR #17782:
URL: https://github.com/apache/druid/pull/17782#issuecomment-2744146157
I tried turning off supervisor based auto-compaction by submitting:
<img width="393" alt="image" src="https://github.com/user-attachments/assets/c96d8cec-7c65-4050-930d-888a51ff1c39" />
to `/druid/coordinator/v1/config/compaction/cluster` and got
```
{
"error": "druidException",
"errorCode": "invalidInput",
"persona": "USER",
"category": "INVALID_INPUT",
"errorMessage": "MSQ Compaction engine can be used only with compaction supervisors.",
"context": {}
}
```
since I asked for `useSupervisors` to be false I feel like it should be ok to omit the engine (since it defaults to native anyway)
I would expect this API call to work to be consistent with the rest of Druid.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on PR #17782:
URL: https://github.com/apache/druid/pull/17782#issuecomment-2722839619
Do the values of `useSupervisors` and `engine` have an effect on the applicability of `compactionTaskSlotRatio` and `maxCompactionTaskSlots` ? Specifically if `useSupervisors: true` and `engine: "msq"` do `compactionTaskSlotRatio` and `maxCompactionTaskSlots` get ignored or are they equally applicable?
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r2007399094
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,95 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy.type`|Policy to choose intervals for compaction. Currently, the only supported policy in `newestSegmentFirst`.|`newestSegmentFirst`|
+|`compactionPolicy.priorityDatasource`|Datasource to prioritize for compaction. The intervals of this datasource are chosen for compaction before the intervals of any other datasource. Within this datasource, the intervals are prioritized based on the chosen compaction policy.|None|
+|`useSupervisors`|Whether compaction should be run on Overlord using supervisors instead of Coordinator duties.|false|
+|`engine`|Engine used for running compaction tasks. Possible values are `native` and `msq`. `msq` engine can be used for compaction only if `useSupervisors` is `true`.|`native`|
Review Comment:
Yes, fair point. Let me update that.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r2007401563
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,95 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy.type`|Policy to choose intervals for compaction. Currently, the only supported policy in `newestSegmentFirst`.|`newestSegmentFirst`|
+|`compactionPolicy.priorityDatasource`|Datasource to prioritize for compaction. The intervals of this datasource are chosen for compaction before the intervals of any other datasource. Within this datasource, the intervals are prioritized based on the chosen compaction policy.|None|
Review Comment:
Yeah, that makes sense.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r1995867689
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,88 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy`|Policy to prioritize intervals for compaction|`newestSegmentFirst`|
Review Comment:
I tried posting
<img width="310" alt="image" src="https://github.com/user-attachments/assets/a50d0274-62e4-46ee-9ea9-cc118023e730" />
and got `"Could not resolve subtype of [simple type, class org.apache.druid.server.compaction.CompactionCandidateSearchPolicy]: missing type id property 'type' (for POJO property 'compactionPolicy')"` so maybe it HAS to be that shape.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r1994396269
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,88 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy`|Policy to prioritize intervals for compaction|`newestSegmentFirst`|
Review Comment:
Can the description list all the possible values for this property please?
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r1995858834
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,88 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy`|Policy to prioritize intervals for compaction|`newestSegmentFirst`|
Review Comment:
Also I noticed that the return of `GET /druid/coordinator/v1/config/compaction` has a slightly different shape.
<img width="279" alt="image" src="https://github.com/user-attachments/assets/dc786d8e-a140-4db4-a8f5-8a2bfc8fae93" />
What is `priorityDatasource`? Can the same shape of object be submitted?
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz merged PR #17782:
URL: https://github.com/apache/druid/pull/17782
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "vogievetsky (via GitHub)" <gi...@apache.org>.
vogievetsky commented on PR #17782:
URL: https://github.com/apache/druid/pull/17782#issuecomment-2744973107
Yes, I have previously set engine to msq. I guess I always imagined all these APIs to take a entire object, validate it, and then set it. That was my mental model for the `/druid/coordinator/v1/config` also and I guess now I need to go and review some code. I would strongly prefer if the new API could take the entire payload as the config and not merge it with the existing payload. We can figure out what to do with older APIs that do that merge later.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Use compaction dynamic config to enable compaction supervisors (druid)
Posted by "clintropolis (via GitHub)" <gi...@apache.org>.
clintropolis commented on code in PR #17782:
URL: https://github.com/apache/druid/pull/17782#discussion_r2007079551
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,95 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy.type`|Policy to choose intervals for compaction. Currently, the only supported policy in `newestSegmentFirst`.|`newestSegmentFirst`|
+|`compactionPolicy.priorityDatasource`|Datasource to prioritize for compaction. The intervals of this datasource are chosen for compaction before the intervals of any other datasource. Within this datasource, the intervals are prioritized based on the chosen compaction policy.|None|
+|`useSupervisors`|Whether compaction should be run on Overlord using supervisors instead of Coordinator duties.|false|
+|`engine`|Engine used for running compaction tasks. Possible values are `native` and `msq`. `msq` engine can be used for compaction only if `useSupervisors` is `true`.|`native`|
Review Comment:
maybe should this clarify that this is the default if not specified in the datasource specific config?
##########
docs/api-reference/automatic-compaction-api.md:
##########
@@ -258,6 +258,95 @@ Host: http://ROUTER_IP:ROUTER_PORT
A successful request returns an HTTP `200 OK` message code and an empty response body.
+### Update cluster-level compaction config
+
+Updates cluster-level configuration for compaction tasks which applies to all datasources, unless explicitly overridden in the datasource compaction config.
+This includes the following fields:
+
+|Config|Description|Default value|
+|------|-----------|-------------|
+|`compactionTaskSlotRatio`|Ratio of number of slots taken up by compaction tasks to the number of total task slots across all workers.|0.1|
+|`maxCompactionTaskSlots`|Maximum number of task slots that can be taken up by compaction tasks.|2147483647 (i.e. total task slots)|
+|`compactionPolicy.type`|Policy to choose intervals for compaction. Currently, the only supported policy in `newestSegmentFirst`.|`newestSegmentFirst`|
+|`compactionPolicy.priorityDatasource`|Datasource to prioritize for compaction. The intervals of this datasource are chosen for compaction before the intervals of any other datasource. Within this datasource, the intervals are prioritized based on the chosen compaction policy.|None|
Review Comment:
i think maybe this should be split out and documented as a `CompactionPolicy` since it is specific to `newestSegmentFirst` in case we ever add other policies (or make this one more flexible or whatever)
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org