Skip to content
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

Adding number of routing shards to index settings before passing into… #14446

Closed
wants to merge 1 commit into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Jun 19, 2024

… GetSettingsResponse

Description

Adds number_of_routing_shards into indexSettings before passing into GetSettingsResponse. Alternative solution to PR-4443.

Related Issues

Resolves #14199

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.

@github-actions github-actions bot added bug Something isn't working good first issue Good for newcomers Indexing Indexing, Bulk Indexing and anything related to indexing labels Jun 19, 2024
Copy link
Contributor

❌ Gradle check result for 950f0ad: 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
Contributor

❌ Gradle check result for 82a9f3c: 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
Contributor

❌ Gradle check result for ede87d5: 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
Contributor

❌ Gradle check result for fa27c83: 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
Contributor

❌ Gradle check result for 42f9754: 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
Contributor

❌ Gradle check result for dcfe9d7: 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
Contributor

❌ Gradle check result for 6e32fb5: 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
Collaborator

@Bukhtawar Bukhtawar left a comment

Choose a reason for hiding this comment

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

Do you intent to backport to 2.x, if yes please handle BWC

Copy link
Contributor

❌ Gradle check result for 013105b: 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
Contributor

❌ Gradle check result for 1b12a69: 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
Contributor

❌ Gradle check result for 240d42d: 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
Contributor

❌ Gradle check result for 1f865f4: 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?

@ghost
Copy link
Author

ghost commented Jun 21, 2024

@gaobinlong Mentioning you here since I closed the previous PR in favor on this approach.

Sorry this is my first contribution so I'm having a bit a trouble tracking down failed tests. I see that org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT.test {p0=indices.get_settings/10_basic/Get /_settings}. I think this seems like some mixed version test? Do you know how I could go about trying to fix this test?

Copy link
Contributor

❌ Gradle check result for d63ffbd: 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
Contributor

❌ Gradle check result for 3cc3aac: 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?

@ghost
Copy link
Author

ghost commented Jun 21, 2024

Do you intent to backport to 2.x, if yes please handle BWC

Sorry, new to contributing here! How would I handle the backwards compatibility for this? @Bukhtawar

Copy link
Contributor

❌ Gradle check result for 8029d7d: 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
Contributor

❌ Gradle check result for 3a85274: 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
Contributor

❌ Gradle check result for 54d4952: 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
Contributor

❌ Gradle check result for 24a4ecb: 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
Contributor

✅ Gradle check result for c14ce22: SUCCESS

Copy link
Contributor

✅ Gradle check result for 02bd802: SUCCESS

@gaobinlong
Copy link
Collaborator

I have a concern that we always return the setting index.number_of_routing_shards when calling get index settings API, that setting is not commonly used(may only useful when splitting index), should we only show the setting when it was set explicitly? What do you think about this? @Bukhtawar @r1walz @reta @andrross

@reta
Copy link
Collaborator

reta commented Jun 26, 2024

I have a concern that we always return the setting index.number_of_routing_shards when calling get index settings API, that setting is not commonly used(may only useful when splitting index), should we only show the setting when it was set explicitly? What do you think about this? @Bukhtawar @r1walz @reta @andrross

Thanks @gaobinlong , I think this is very valid concern. This settings is only useful during the Resize API calls (and could be created temporarily for the index in question), it is not a regular index setting per se.

@r1walz
Copy link
Contributor

r1walz commented Jun 26, 2024

I have a concern that we always return the setting index.number_of_routing_shards when calling get index settings API, that setting is not commonly used(may only useful when splitting index), should we only show the setting when it was set explicitly? What do you think about this? @Bukhtawar @r1walz @reta @andrross

It sounds like a better idea to only return the setting when explicitly set by the user. I think we can make this distinction by pushing the setting into the IndexMetadata#settings variable when it is provided by the user (passed into request while creating index or copied from sourceMetadata in case of resize action, etc). All settings pushed into IndexMetadata#settings are visible in the response of GET {index}/_settings call unless filtered.

Side Note: while looking into the issue, I found that INDEX_NUMBER_OF_ROUTING_SHARDS_SETTING is only IndexScope settings while it should also be a Final settings as well because routing number of shards is also used during routing of docs in OperationRouting, it should not change after index creation

return Math.floorMod(hash, indexMetadata.getRoutingNumShards()) / indexMetadata.getRoutingFactor();

IndexScope settings can be updated when index is closed. Although, it's value is never read from the settings itself during operation routing. But, it created yet another discrepancy between these two variables representing same information (eg: in _cluster/state call).

@ghost
Copy link
Author

ghost commented Jul 1, 2024

I have a concern that we always return the setting index.number_of_routing_shards when calling get index settings API, that setting is not commonly used(may only useful when splitting index), should we only show the setting when it was set explicitly? What do you think about this? @Bukhtawar @r1walz @reta @andrross

It sounds like a better idea to only return the setting when explicitly set by the user. I think we can make this distinction by pushing the setting into the IndexMetadata#settings variable when it is provided by the user (passed into request while creating index or copied from sourceMetadata in case of resize action, etc). All settings pushed into IndexMetadata#settings are visible in the response of GET {index}/_settings call unless filtered.

Side Note: while looking into the issue, I found that INDEX_NUMBER_OF_ROUTING_SHARDS_SETTING is only IndexScope settings while it should also be a Final settings as well because routing number of shards is also used during routing of docs in OperationRouting, it should not change after index creation

return Math.floorMod(hash, indexMetadata.getRoutingNumShards()) / indexMetadata.getRoutingFactor();

IndexScope settings can be updated when index is closed. Although, it's value is never read from the settings itself during operation routing. But, it created yet another discrepancy between these two variables representing same information (eg: in _cluster/state call).

Hello! If I understand what you're saying correctly, I think what you're suggesting is similar to the approach that I initially implemented . I think the issue is that there seems to be a deliberate removal of the number_of_routing_shards in IndexMetadata on creation.

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added stalled Issues that have stalled and removed stalled Issues that have stalled labels Jul 31, 2024
@ghost ghost closed this Aug 27, 2024
@ghost ghost deleted the bug-14199-fix-2 branch August 27, 2024 01:09
@michlitz
Copy link

michlitz commented Sep 4, 2024

@gaobinlong, it looks like this PR was closed due to @PeacefulTortoise deleting their GitHub account. How close was this to being merged, and can someone from the AWS side pick this up if it's near resolved?

@gaobinlong
Copy link
Collaborator

@gaobinlong, it looks like this PR was closed due to @PeacefulTortoise deleting their GitHub account. How close was this to being merged, and can someone from the AWS side pick this up if it's near resolved?

This PR is not close to be merged, I'll take a look later.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers Indexing Indexing, Bulk Indexing and anything related to indexing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] GET {index}/_settings does not list number_of_routing_shards as setting
5 participants