Skip to content

Conversation

@ajaymovva
Copy link
Contributor

@ajaymovva ajaymovva commented Nov 27, 2025

Description

Ignoring Recovery Ratelimiter for the warm indexes while download

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Summary by CodeRabbit

  • New Features

    • Added warm-index aware directory creation so remote store paths can be created with warm-index behavior.
    • Added a warm-specific remote-download wrapper that applies simplified rate limiting for warm index transfers.
  • Improvements

    • Enhanced transfer rate limiting for warm index operations to optimize resource use during remote data downloads.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

Walkthrough

Adds warm-index awareness to remote segment directory creation by introducing two new newDirectory overloads that accept an isWarmIndex flag and a warm-specific download rate-limiting wrapper in BlobStoreRepository.

Changes

Cohort / File(s) Summary
Remote Segment Store Directory Factory Enhancements
server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryFactory.java
Added two public newDirectory() overloads: one with 6 parameters (repositoryName, indexUUID, shardId, pathStrategy, indexFixedPrefix, isServerSideEncryptionEnabled) and one with 7 parameters adding isWarmIndex. newDirectory(IndexSettings, ShardPath) now forwards indexSettings.isWarmIndex() to the 7-parameter overload. When isWarmIndex is true, data directory creation applies maybeRateLimitRemoteDownloadTransfersForWarm; metadata path remains unchanged.
Blob Store Repository Rate Limiting
server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java
Added public InputStream maybeRateLimitRemoteDownloadTransfersForWarm(InputStream) which wraps downloads with the primary remote download rate limiter for warm-index transfers (omits additional recovery-rate-limiter layering).

Sequence Diagram(s)

sequenceDiagram
    participant IndexSettings
    participant DirectoryFactory as RemoteSegmentStoreDirectoryFactory
    participant BlobRepo as BlobStoreRepository
    participant RemoteStore as RemoteStore (IO)

    Note over IndexSettings,DirectoryFactory: Caller builds Directory
    IndexSettings->>DirectoryFactory: newDirectory(indexSettings, shardPath)
    DirectoryFactory->>DirectoryFactory: extract isWarmIndex
    alt isWarmIndex == true
        DirectoryFactory->>BlobRepo: maybeRateLimitRemoteDownloadTransfersForWarm(InputStream)
        BlobRepo->>RemoteStore: wrapped stream (warm-rate-limited)
    else isWarmIndex == false
        DirectoryFactory->>BlobRepo: maybeRateLimitRemoteDownloadTransfers(InputStream)
        BlobRepo->>RemoteStore: wrapped stream (standard rate-limited, may include recovery limiter)
    end
    DirectoryFactory->>DirectoryFactory: return Directory (warm-aware)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to API contract and overload resolution in RemoteSegmentStoreDirectoryFactory.
  • Verify correct propagation and uses of isWarmIndex in all call paths.
  • Review the new warm-specific rate-limiter method for concurrency and correctness relative to existing rate-limiting behavior.

Poem

🐰
I dug a warm new tunnel bright,
Two doors now open, soft and right,
Streams paced gentle, tip-toe slow,
So indices can rest and grow,
Hopping home where downloads glow ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description section only contains the title repeated verbatim and lacks substantive detail; the 'Related Issues' section is not filled in with an actual issue number, and checklist items remain unchecked. Fill in the Description section with details explaining what the change achieves, provide a specific issue number in 'Related Issues', and indicate completion status of the checklist items.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: introducing special handling to ignore recovery rate limiting for warm indexes during downloads, which aligns with the added warm-index-aware method and conditional logic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryFactory.java (1)

69-116: SSE and warm flags are correctly threaded through newDirectory overloads

The added overloads and the updated newDirectory(IndexSettings, ShardPath) correctly propagate both isServerSideEncryptionEnabled and isWarmIndex down to the core factory method. This keeps existing call sites working while enabling more precise configuration.

Given the growing parameter list on the deepest overload, consider introducing a small parameter holder (e.g., RemoteDirectoryConfig with builder-style methods) in a future refactor to reduce the risk of boolean mis-ordering, but this is not a blocker for this change.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0a40bd and a4ffc9a.

📒 Files selected for processing (2)
  • server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryFactory.java (3 hunks)
  • server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryFactory.java (1)
server/src/main/java/org/opensearch/index/remote/RemoteStoreUtils.java (1)
  • RemoteStoreUtils (57-588)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: gradle-check
  • GitHub Check: Analyze (java)
  • GitHub Check: assemble (25, windows-latest)
  • GitHub Check: assemble (25, ubuntu-24.04-arm)
  • GitHub Check: assemble (21, ubuntu-latest)
  • GitHub Check: assemble (21, windows-latest)
  • GitHub Check: assemble (21, ubuntu-24.04-arm)
  • GitHub Check: assemble (25, ubuntu-latest)
  • GitHub Check: precommit (21, windows-2025, true)
  • GitHub Check: precommit (25, ubuntu-24.04-arm)
  • GitHub Check: precommit (21, ubuntu-24.04-arm)
  • GitHub Check: precommit (25, ubuntu-latest)
  • GitHub Check: precommit (21, windows-latest)
  • GitHub Check: precommit (25, macos-15-intel)
  • GitHub Check: precommit (21, ubuntu-latest)
  • GitHub Check: precommit (25, macos-15)
  • GitHub Check: precommit (21, macos-15-intel)
  • GitHub Check: precommit (25, windows-latest)
  • GitHub Check: precommit (21, macos-15)
  • GitHub Check: detect-breaking-change
🔇 Additional comments (2)
server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java (1)

4429-4436: Warm-path helper cleanly bypasses recovery rate limiter

The new maybeRateLimitRemoteDownloadTransfersForWarm correctly mirrors the inner part of maybeRateLimitRemoteDownloadTransfers and omits the recovery-level rate limiter, which matches the PR goal while keeping metrics and logging consistent.

server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryFactory.java (1)

137-148: Warm index data downloads now bypass recovery rate limiter—confirm scope is intentional

The RemoteDirectory for the data path now selects:

  • warm index: BlobStoreRepository::maybeRateLimitRemoteDownloadTransfersForWarm (no recovery rate limiter), and
  • non-warm index: existing maybeRateLimitRemoteDownloadTransfers (still nested with recoverySettings.recoveryRateLimiter),

while the low-priority download path continues to use maybeRateLimitLowPriorityDownloadTransfers unchanged.

This matches the PR objective for warm data downloads; please double-check that you do not also need to bypass the recovery limiter for any low-priority warm-download flows, or introduce a warm-specific low-priority variant, depending on your traffic patterns.

@github-actions
Copy link
Contributor

❌ Gradle check result for a4ffc9a: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryFactory.java (1)

108-116: New overload signature is fine; consider documenting isWarmIndex behavior

Introducing the 7‑arg overload on a @PublicApi class is a safe, backward‑compatible way to surface warm‑index behavior, and the parameter order is consistent with the previous method.

To make usage by plugins/embedders clearer, consider adding a short Javadoc to this overload explaining what isWarmIndex changes (i.e., which rate limiters or paths are affected) so downstream users don’t misuse the flag.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4ffc9a and 553bfd5.

📒 Files selected for processing (2)
  • server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryFactory.java (3 hunks)
  • server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java
🧰 Additional context used
🧬 Code graph analysis (1)
server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryFactory.java (1)
server/src/main/java/org/opensearch/index/remote/RemoteStoreUtils.java (1)
  • RemoteStoreUtils (57-588)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: gradle-check
  • GitHub Check: assemble (25, windows-latest)
  • GitHub Check: assemble (21, windows-latest)
  • GitHub Check: assemble (25, ubuntu-24.04-arm)
  • GitHub Check: assemble (21, ubuntu-24.04-arm)
  • GitHub Check: assemble (21, ubuntu-latest)
  • GitHub Check: assemble (25, ubuntu-latest)
  • GitHub Check: detect-breaking-change
  • GitHub Check: precommit (21, macos-15)
  • GitHub Check: precommit (21, windows-2025, true)
  • GitHub Check: precommit (25, ubuntu-24.04-arm)
  • GitHub Check: precommit (25, windows-latest)
  • GitHub Check: precommit (21, windows-latest)
  • GitHub Check: precommit (25, macos-15-intel)
  • GitHub Check: precommit (25, macos-15)
  • GitHub Check: precommit (21, ubuntu-24.04-arm)
  • GitHub Check: precommit (21, ubuntu-latest)
  • GitHub Check: precommit (25, ubuntu-latest)
  • GitHub Check: precommit (21, macos-15-intel)
  • GitHub Check: Analyze (java)
🔇 Additional comments (3)
server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryFactory.java (3)

69-79: Correct wiring of warm index and SSE flags; verify metadata availability

The additional parameters propagated from IndexSettings (isServerSideEncryptionEnabledIndex(indexSettings.getIndexMetadata()) and indexSettings.isWarmIndex()) look correct and align with the intent of making this factory warm‑aware.

Only concern: this assumes indexSettings.getIndexMetadata() is always non‑null on this path. If there are any internal/test callers that construct IndexSettings without metadata, this would now throw an NPE where previously it did not.

If you’re not fully sure about that invariant, consider either:

  • guarding with a null‑check and defaulting SSE to false, or
  • documenting the requirement that IndexSettings must carry IndexMetadata when using remote store directories.

97-106: Backward‑compatible delegation from 6‑arg to 7‑arg overload looks good

The existing 6‑parameter overload now simply delegates to the new 7‑parameter version with isWarmIndex=false, which preserves previous behavior for all existing callers.


137-148: Warm‑specific download rate limiter selection matches PR intent; add coverage

Conditionally selecting maybeRateLimitRemoteDownloadTransfersForWarm for warm indices and falling back to maybeRateLimitRemoteDownloadTransfers otherwise is a minimal, targeted change and keeps upload & low‑priority download behavior intact. This aligns with the stated goal of treating warm‑index downloads differently without impacting other tiers.

Given this is performance/throughput‑sensitive behavior, it would be good to have at least one test (unit or integration) that:

  • constructs a warm and a non‑warm index, and
  • asserts that the appropriate download rate‑limiting callback is wired into RemoteDirectory for each case.

Copy link
Contributor

@gbbafna gbbafna left a comment

Choose a reason for hiding this comment

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

Changes looks good to me .

@gbbafna gbbafna changed the title Ignoring Recovery Ratelimiter for the warm indexes while download Ignore Recovery Rate limiter for the warm indexes while download Nov 27, 2025
@github-actions
Copy link
Contributor

✅ Gradle check result for 553bfd5: SUCCESS

@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.26%. Comparing base (97d3864) to head (553bfd5).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...ndex/store/RemoteSegmentStoreDirectoryFactory.java 50.00% 2 Missing and 1 partial ⚠️
...ch/repositories/blobstore/BlobStoreRepository.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #20109      +/-   ##
============================================
- Coverage     73.33%   73.26%   -0.07%     
+ Complexity    71679    71651      -28     
============================================
  Files          5790     5786       -4     
  Lines        327549   327631      +82     
  Branches      47181    47207      +26     
============================================
- Hits         240217   240055     -162     
- Misses        68080    68306     +226     
- Partials      19252    19270      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gbbafna gbbafna merged commit 3734978 into opensearch-project:main Nov 27, 2025
38 of 40 checks passed
kkewwei pushed a commit to kkewwei/OpenSearch that referenced this pull request Nov 28, 2025
rgsriram pushed a commit to rgsriram/OpenSearch that referenced this pull request Dec 5, 2025
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.

2 participants