Skip to content

feat: Reindexing supervisor web console builder workfow#19312

Open
capistrant wants to merge 4 commits into
apache:masterfrom
capistrant:reindexing-supervisor-ui-builder
Open

feat: Reindexing supervisor web console builder workfow#19312
capistrant wants to merge 4 commits into
apache:masterfrom
capistrant:reindexing-supervisor-ui-builder

Conversation

@capistrant
Copy link
Copy Markdown
Contributor

@capistrant capistrant commented Apr 14, 2026

Description

This PR enhances the compaction configuration building workflow in the web console by adding template type selection when using compaction supervisors. This allows folks to configure the new cascading reindexing supervisor template type which allows for rules based reindexing that can apply different rules for different intervals of time. Before this PR the only way to work with the new cascading reindexing spec format was via the API. The goal of this PR is to continue down the path of completing all of the pending bullets in #19092 as we try to make this new feature production worthy.

Images

image image image

Example Spec

If you want to seed your local cluster with an example spec so you can tinker with modifying via the form, you can use the following spec. Note that the underlying wikipedia data need not be ingested since this is a suspended supervisor and the form works regardless of the underlying data.

Click to expand code
{
"type": "autocompact",
"spec": {
  "type": "reindexCascade",
  "dataSource": "wikipedia",
  "taskPriority": 25,
  "inputSegmentSizeBytes": 100000000000000,
  "ruleProvider": {
    "type": "inline",
    "deletionRules": [
      {
        "id": "delete_japan",
        "description": null,
        "olderThan": "P90D",
        "deleteWhere": {
          "type": "equals",
          "column": "countryName",
          "matchValueType": "STRING",
          "matchValue": "Japan"
        },
        "virtualColumns": null
      }
    ],
    "partitioningRules": [],
    "indexSpecRules": [],
    "dataSchemaRules": [
      {
        "id": "dataSchema-1",
        "description": null,
        "olderThan": "P30D",
        "dimensionsSpec": {
          "dimensions": null
        },
        "metricsSpec": [],
        "queryGranularity": "HOUR",
        "rollup": true,
        "projections": []
      }
    ]
  },
  "taskContext": {
    "useConcurrentLocks": true,
    "maxNumTasks": 2
  },
  "skipOffsetFromLatest": null,
  "skipOffsetFromNow": null,
  "defaultSegmentGranularity": "DAY",
  "defaultPartitionsSpec": {
    "type": "range",
    "targetRowsPerSegment": 5,
    "maxRowsPerSegment": null,
    "partitionDimensions": [
      "city_and_country",
      "isRobot"
    ],
    "assumeGrouped": false
  },
  "defaultPartitioningVirtualColumns": [
    {
      "type": "expression",
      "name": "city_and_country",
      "expression": "concat(cityName, ':', countryName)",
      "outputType": "STRING"
    }
  ],
  "tuningConfig": null
},
"suspended": true
}

Release note

Adds the ability to configure a compaction supervisor using the reindexCascade template type in the web console. This contributes to more production worthy UX for the new template type.


Key changed/added classes in this PR

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.

@jtuglu1
Copy link
Copy Markdown
Contributor

jtuglu1 commented Apr 14, 2026

unrelated: have you considered using an LLM to port the web console build process to Vite? This should significantly speed up build times

@capistrant
Copy link
Copy Markdown
Contributor Author

unrelated: have you considered using an LLM to port the web console build process to Vite? This should significantly speed up build times

Had not considered it cuz I had never heard of Vite until you mentioned it 😁. I can push up some draft proposal for it but I'd also like to hear @vogievetsky thoughts on the topic

@capistrant capistrant marked this pull request as ready for review May 12, 2026 20:53
Copy link
Copy Markdown
Member

@FrankChen021 FrankChen021 left a comment

Choose a reason for hiding this comment

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

Severity Findings
P0 0
P1 0
P2 3
P3 0
Total 3

Reviewed 17 of 17 changed files.


This is an automated review by Codex GPT-5.5

dataSource,
defaultSegmentGranularity: 'DAY',
defaultPartitionsSpec: { type: 'dynamic', maxRowsPerSegment: 5000000 },
ruleProvider: { type: 'inline' },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Require at least one rule before submitting

Selecting the cascading template creates ruleProvider: { type: 'inline' }, and the top-level form treats that as satisfying the required ruleProvider field even though all rule lists are empty. The server-side cascading template later throws when no partitioning or non-partitioning rule exists, so the console can save a supervisor that cannot generate jobs. Make the custom field invalid until at least one rule list has an entry, or seed a real rule before enabling Submit.

info: <>Determines how many rows are in each segment.</>,
},
{
name: 'defaultPartitionsSpec.maxTotalRows',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Remove unsupported maxTotalRows field

Cascading reindexing is MSQ-only, and the server validation rejects dynamic partition specs that set maxTotalRows. This field exposes defaultPartitionsSpec.maxTotalRows in the cascading form, so users can configure a value that the POST endpoint rejects. Drop this field for reindexCascade dynamic defaults or prevent it from being written.

},
// defaultPartitionsSpec: dynamic
{
name: 'defaultPartitionsSpec.maxRowsPerSegment',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Allow range defaults to keep maxRowsPerSegment

The only defaultPartitionsSpec.maxRowsPerSegment field is defined for dynamic partitioning, but the range target field still treats maxRowsPerSegment as a valid alternative. If an existing valid cascading spec uses defaultPartitionsSpec: { type: 'range', maxRowsPerSegment: ... }, AutoForm.issueWithModel marks the field as defined when it should not be and disables Submit. Mirror the existing compaction form by adding a range maxRowsPerSegment field defined when targetRowsPerSegment is absent.

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