Skip to content

Make requests_per_second configurable to throttle reindexing #120207

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

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

lukewhiting
Copy link
Contributor

This pull request primarily focuses on introducing a new setting for reindexing data streams and adding corresponding tests. The changes include adding a new setting for the maximum number of reindex requests per second, modifying the reindex method to incorporate this setting, and creating a new test class to verify the functionality.

Key changes include:

New Setting Addition:

  • Added a new setting REINDEX_MAX_REQUESTS_PER_SECOND_SETTING to control the maximum number of reindex requests per second in ReindexDataStreamIndexTransportAction.

Code Modifications:

  • Updated the reindex method in ReindexDataStreamIndexTransportAction to use the new REINDEX_MAX_REQUESTS_PER_SECOND_SETTING for reindex requests.
  • Imported the new setting in MigratePlugin and added it to the list of plugin settings. [1] [2]

Test Enhancements:

  • Removed existing tests for generateDestIndexName from ReindexDatastreamIndexTransportActionIT and added them to a new test class ReindexDataStreamIndexTransportActionTests. [1] [2] as they are unit tests not ITs.
  • Added a new test in ReindexDataStreamIndexTransportActionTests to verify that the reindex method's reindex requests includes the rate limit setting.

@lukewhiting lukewhiting added :Data Management/Data streams Data streams and their lifecycles auto-backport Automatically create backport pull requests when merged v9.0.0 v8.18.0 labels Jan 15, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Jan 15, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine
Copy link
Collaborator

Hi @lukewhiting, I've created a changelog YAML for you.

Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@parkertimmins parkertimmins left a comment

Choose a reason for hiding this comment

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

Nice tests! LGTM

@lukewhiting lukewhiting enabled auto-merge (squash) January 16, 2025 15:28
@lukewhiting lukewhiting merged commit 7ac2500 into elastic:main Jan 16, 2025
16 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

elasticsearchmachine pushed a commit that referenced this pull request Jan 16, 2025
#120300)

* Make requests_per_second configurable to throttle reindexing

* Update docs/changelog/120207.yaml

* Add restrictions to prevent zero or negative rate limit

Also allow -1 as infinite

* PR Changes - Switch to cluster settings for rate limit retrieval
@lukewhiting lukewhiting deleted the es-10505-make-rps-configurable branch January 17, 2025 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Data Management/Data streams Data streams and their lifecycles >enhancement Team:Data Management Meta label for data/management team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants