Skip to content

Allow MSQ engine only for compaction supervisors#17033

Merged
kfaraz merged 8 commits intoapache:masterfrom
gargvishesh:msq-compaction-only-on-overlord
Sep 24, 2024
Merged

Allow MSQ engine only for compaction supervisors#17033
kfaraz merged 8 commits intoapache:masterfrom
gargvishesh:msq-compaction-only-on-overlord

Conversation

@gargvishesh
Copy link
Copy Markdown
Contributor

Description

#16768 added the functionality to run compaction as a supervisor on the overlord. This PR builds on top of that to restrict MSQ engine to compaction in the supervisor-mode only. With these changes, users can no longer add MSQ engine as part of datasource compaction config, or as the default cluster-level compaction engine, on the Coordinator.

The PR also adds an Overlord runtime property druid.supervisor.compaction.defaultEngine=<msq/native> to specify the default engine for compaction supervisors.

Since these updates require major changes to existing MSQ compaction integration tests, this PR disables MSQ-specific compaction integration tests -- they will be taken up in a follow-up PR.

Key changed/added classes in this PR
  • CompactionSupervisor
  • CompactionSupervisorSpec
  • CoordinatorCompactionConfigsResource
  • OverlordCompactionScheduler

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.

@gargvishesh gargvishesh changed the title Allow MSQ engine for compaction only when run as a supervisor on the overlord Allow MSQ engine only for compaction supervisors Sep 11, 2024
@cryptoe cryptoe added this to the 31.0.0 milestone Sep 11, 2024
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, left some minor suggestions.

Comment on lines +88 to +91
throw InvalidInput.exception(
"Compaction supervisor spec is invalid. Reason[%s].",
supervisorSpec.getValidationResult().getReason()
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not throw an exception here. We can either add new fields to AutoCompactionSnapshot or add a new class that is returned by this method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced an additional field in AutoCompactionSnapshot


@Test
public void testInvalidSpecThrowsException()
public void testSupervisorWithInvalidSpecThrowsExceptionForStatus()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test might have to change a little as we shouldn't throw an exception while getting state/status even if the spec is invalid.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@gargvishesh gargvishesh requested a review from kfaraz September 23, 2024 12:27
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, @gargvishesh !

@kfaraz kfaraz merged commit f576e29 into apache:master Sep 24, 2024
kfaraz pushed a commit to kfaraz/druid that referenced this pull request Sep 24, 2024
apache#16768 added the functionality to run compaction as a supervisor on the overlord.
This patch builds on top of that to restrict MSQ engine to compaction in the supervisor-mode only.
With these changes, users can no longer add MSQ engine as part of datasource compaction config,
or as the default cluster-level compaction engine, on the Coordinator. 

The patch also adds an Overlord runtime property `druid.supervisor.compaction.engine=<msq/native>`
to specify the default engine for compaction supervisors.

Since these updates require major changes to existing MSQ compaction integration tests,
this patch disables MSQ-specific compaction integration tests -- they will be taken up in a follow-up PR.

Key changed/added classes in this patch:
* CompactionSupervisor
* CompactionSupervisorSpec
* CoordinatorCompactionConfigsResource
* OverlordCompactionScheduler
kfaraz added a commit that referenced this pull request Sep 25, 2024
…17143)

#16768 added the functionality to run compaction as a supervisor on the overlord.
This patch builds on top of that to restrict MSQ engine to compaction in the supervisor-mode only.
With these changes, users can no longer add MSQ engine as part of datasource compaction config,
or as the default cluster-level compaction engine, on the Coordinator. 

The patch also adds an Overlord runtime property `druid.supervisor.compaction.engine=<msq/native>`
to specify the default engine for compaction supervisors.

Since these updates require major changes to existing MSQ compaction integration tests,
this patch disables MSQ-specific compaction integration tests -- they will be taken up in a follow-up PR.

Key changed/added classes in this patch:
* CompactionSupervisor
* CompactionSupervisorSpec
* CoordinatorCompactionConfigsResource
* OverlordCompactionScheduler

Co-authored-by: Vishesh Garg <gargvishesh@gmail.com>
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.

3 participants