Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new compaction config and status APIs served by the Overlord #17834

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

kfaraz
Copy link
Contributor

@kfaraz kfaraz commented Mar 26, 2025

Changes

  • Add new Overlord APIs to which allow reading and updating compaction status and configs
  • If useSupervisors is true, the new APIs serve compaction supervisor-based information
    using the CompactionScheduleror the SupervisorManager
  • If useSupervisors is false, the new APIs serve compaction config info using CoordinatorConfigManager
  • Move some logic from CoordinatorCompactionConfigsResource to CoordinatorConfigManager
  • Use CoordinatorConfigManager in OverlordCompactionResource to manipulate compaction configs
  • Add CompactionSupervisorManager to act as a wrapper over SupervisorManager and allow
    manipulation of compaction supervisor specs
  • Fix initialization bug in OverlordCompactionScheduler introduced in Use compaction dynamic config to enable compaction supervisors #17782

Cluster config payload

{
    "compactionTaskSlotRatio": 0.5,
    "maxCompactionTaskSlots": 1500,
    "compactionPolicy": {
        "type": "newestSegmentFirst",
        "priorityDatasource": "wikipedia"
    },
    "useSupervisors": true,
    "engine": "msq"
}

Release note

Add the following new Overlord APIs:

Method Path
/druid/indexer/v1/compaction
Description Required Permission
GET /config/cluster Get the cluster-level compaction config Read configs
POST /config/cluster Update the cluster-level compaction config Write configs
GET /config/datasources Get the compaction configs for all datasources Read datasource
GET /config/datasources/{dataSource} Get the compaction config of a single datasource Read datasource
POST /config/datasources/{dataSource} Update the compaction config of a single datasource Write datasource
GET /status/datasources Get the compaction status of all datasources Read datasource
GET /status/datasources/{dataSource} Get the compaction status of a single datasource Read datasource
POST /status/datasources/{dataSource} Update the compaction status of a single datasource Write datasource

This PR has:

  • been self-reviewed.
  • 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
  • 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 is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@kfaraz kfaraz requested a review from vogievetsky March 26, 2025 08:50
@kfaraz kfaraz added this to the 33.0.0 milestone Mar 26, 2025
@kfaraz kfaraz changed the title Add API to get cluster compaction config Add new compaction config and status APIs served by the Overlord Mar 30, 2025
@Test
public void testSetCompactionTaskLimit()
{
final DruidCompactionConfig defaultConfig
resource.setCompactionTaskLimit(0.1, 100, mockHttpServletRequest);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [CoordinatorCompactionConfigsResource.setCompactionTaskLimit](1) should be avoided because it has been deprecated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant