Skip to content

Add endpoint for rotating multiple index sets - #26802

Open
moesterheld wants to merge 7 commits into
masterfrom
feature/bulk-rotate
Open

Add endpoint for rotating multiple index sets#26802
moesterheld wants to merge 7 commits into
masterfrom
feature/bulk-rotate

Conversation

@moesterheld

Copy link
Copy Markdown
Contributor

Description

Adds bulk action for rotating mulitple index sets.

Motivation and Context

needed for incompatible indices handling on OpenSearch upgrade page

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Copilot AI left a comment

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.

Pull request overview

Adds a bulk deflector cycling endpoint to rotate multiple index sets in one request, primarily to support upgrade flows (e.g., OpenSearch incompatible indices handling) while reusing the existing bulk-operation infrastructure.

Changes:

  • Add POST /system/deflector/bulk_cycle endpoint executing per-index-set cycling with aggregated BulkOperationResponse.
  • Refactor single-index-set cycle to share the same inner execution path used by the bulk executor.
  • Add cluster proxy (/cluster/deflector/bulk_cycle) and a Retrofit remote interface method, plus a dedicated unit test for the new bulk behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
graylog2-server/src/test/java/org/graylog2/rest/resources/system/DeflectorResourceTest.java Adds unit tests covering success/failure aggregation, empty request rejection, and permission failures for bulkCycle.
graylog2-server/src/main/java/org/graylog2/shared/rest/resources/system/RemoteDeflectorResource.java Introduces Retrofit client method for the new bulk-cycle endpoint (needs Retrofit @Body annotation fix).
graylog2-server/src/main/java/org/graylog2/rest/resources/system/DeflectorResource.java Adds the bulk-cycle REST endpoint backed by SequentialBulkExecutor and shared cycleInner.
graylog2-server/src/main/java/org/graylog2/rest/resources/cluster/ClusterDeflectorResource.java Adds cluster-level proxy endpoint for bulk cycling (currently does not return the bulk result).
Comments suppressed due to low confidence (1)

graylog2-server/src/main/java/org/graylog2/rest/resources/cluster/ClusterDeflectorResource.java:81

  • Method name bulkcycle violates Java lowerCamelCase conventions and is inconsistent with cycle(...)/cycleIndexSet(...) in the same class. Rename to bulkCycle for readability (endpoint path is unaffected).
    public void bulkcycle(@Parameter(name = "Entities to cycle", required = true) final BulkOperationRequest bulkOperationRequest) throws IOException {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@moesterheld
moesterheld marked this pull request as ready for review July 28, 2026 12:48
@moesterheld moesterheld linked an issue Jul 28, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add endpoint for cycling multiple deflector indices

3 participants