Skip to content

Restore default shard_path_type to FIXED for snapshot repositories#20940

Merged
gbbafna merged 2 commits into
opensearch-project:mainfrom
mango766:fix/restore-shard-path-type-default-to-fixed
Mar 27, 2026
Merged

Restore default shard_path_type to FIXED for snapshot repositories#20940
gbbafna merged 2 commits into
opensearch-project:mainfrom
mango766:fix/restore-shard-path-type-default-to-fixed

Conversation

@mango766
Copy link
Copy Markdown
Contributor

Description

Restores the default value of shard_path_type in BlobStoreRepository from HASHED_PREFIX back to FIXED.

PR #18163 changed this default, which causes snapshot shard blobs to be uploaded outside the configured base_path in storage services like S3/MinIO. This is a breaking change for anyone upgrading from 2.x to 3.x — incremental backups fail because the new path layout is incompatible with existing repositories. The change also went in without a changelog entry.

The fix aligns the repository setting default with the existing IndexId.DEFAULT_SHARD_PATH_TYPE constant, which is already FIXED. Users who want HASHED_PREFIX can still set it explicitly when registering their repository.

Related Issues

Resolves #20643

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.

PR opensearch-project#18163 changed the default shard_path_type from FIXED to HASHED_PREFIX,
which causes snapshot blobs to be uploaded outside the configured base_path.
This is a breaking change for users upgrading from 2.x to 3.x, as it breaks
incremental backups and places files outside the expected repository path.

Restoring the default to FIXED to match the 2.x behavior and the existing
IndexId.DEFAULT_SHARD_PATH_TYPE constant.

Signed-off-by: mango766 <mango766@users.noreply.github.com>
Signed-off-by: easonysliu <easonysliu@tencent.com>
@mango766 mango766 requested a review from a team as a code owner March 20, 2026 10:14
@github-actions github-actions Bot added bug Something isn't working Storage:Snapshots labels Mar 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Breaking Change

Changing the default shard_path_type from HASHED_PREFIX back to FIXED is a breaking change for users who upgraded to 3.x and already created repositories with the HASHED_PREFIX default. Those users will now have a mismatch between existing snapshot data (stored under hashed paths) and the new default, potentially causing incremental backup failures. Consider whether a migration path or warning is needed for users already on 3.x with HASHED_PREFIX repositories.

public static final Setting<PathType> SHARD_PATH_TYPE = new Setting<>(
    "shard_path_type",
    PathType.FIXED.toString(),
    PathType::parseString
);

@github-actions
Copy link
Copy Markdown
Contributor

✅ Gradle check result for ea78a17: SUCCESS

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.25%. Comparing base (14faf38) to head (9eef727).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #20940      +/-   ##
============================================
+ Coverage     73.16%   73.25%   +0.08%     
- Complexity    72545    72623      +78     
============================================
  Files          5848     5848              
  Lines        331982   331982              
  Branches      47949    47949              
============================================
+ Hits         242892   243187     +295     
+ Misses        69561    69278     -283     
+ Partials      19529    19517      -12     

☔ 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.

Signed-off-by: Gaurav Bafna <85113518+gbbafna@users.noreply.github.com>
@github-project-automation github-project-automation Bot moved this to 👀 In review in Storage Project Board Mar 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@github-actions
Copy link
Copy Markdown
Contributor

✅ Gradle check result for 9eef727: SUCCESS

@gbbafna gbbafna merged commit 8ffa576 into opensearch-project:main Mar 27, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Storage Project Board Mar 27, 2026
gagandhakrey pushed a commit to gagandhakrey/OpenSearch that referenced this pull request Apr 1, 2026
…pensearch-project#20940)

PR opensearch-project#18163 changed the default shard_path_type from FIXED to HASHED_PREFIX,
which causes snapshot blobs to be uploaded outside the configured base_path.
This is a breaking change for users upgrading from 2.x to 3.x, as it breaks
incremental backups and places files outside the expected repository path.

Restoring the default to FIXED to match the 2.x behavior and the existing
IndexId.DEFAULT_SHARD_PATH_TYPE constant.

Signed-off-by: mango766 <mango766@users.noreply.github.com>
Co-authored-by: easonysliu <easonysliu@tencent.com>
Signed-off-by: Gagan Dhakrey <gagandhakrey@Gagans-MacBook-Pro.local>
aparajita31pandey pushed a commit to aparajita31pandey/OpenSearch that referenced this pull request Apr 18, 2026
…pensearch-project#20940)

PR opensearch-project#18163 changed the default shard_path_type from FIXED to HASHED_PREFIX,
which causes snapshot blobs to be uploaded outside the configured base_path.
This is a breaking change for users upgrading from 2.x to 3.x, as it breaks
incremental backups and places files outside the expected repository path.

Restoring the default to FIXED to match the 2.x behavior and the existing
IndexId.DEFAULT_SHARD_PATH_TYPE constant.

Signed-off-by: mango766 <mango766@users.noreply.github.com>
Co-authored-by: easonysliu <easonysliu@tencent.com>
Signed-off-by: Aparajita Pandey <aparajita31pandey@gmail.com>
pradeep-L pushed a commit to pradeep-L/OpenSearch that referenced this pull request Apr 21, 2026
…pensearch-project#20940)

PR opensearch-project#18163 changed the default shard_path_type from FIXED to HASHED_PREFIX,
which causes snapshot blobs to be uploaded outside the configured base_path.
This is a breaking change for users upgrading from 2.x to 3.x, as it breaks
incremental backups and places files outside the expected repository path.

Restoring the default to FIXED to match the 2.x behavior and the existing
IndexId.DEFAULT_SHARD_PATH_TYPE constant.

Signed-off-by: mango766 <mango766@users.noreply.github.com>
Co-authored-by: easonysliu <easonysliu@tencent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Storage:Snapshots

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[BUG] Default value of parameter shard_path_type changed in 3.x

2 participants