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

[BUG] GET {index}/_settings does not list number_of_routing_shards as setting #14199

Open
r1walz opened this issue Jun 11, 2024 · 4 comments · May be fixed by #14446
Open

[BUG] GET {index}/_settings does not list number_of_routing_shards as setting #14199

r1walz opened this issue Jun 11, 2024 · 4 comments · May be fixed by #14446
Assignees
Labels
bug Something isn't working good first issue Good for newcomers Indexing Indexing, Bulk Indexing and anything related to indexing

Comments

@r1walz
Copy link
Member

r1walz commented Jun 11, 2024

Describe the bug

Number of routing shards is a user definable setting which is used during splitting of shard to determine valid splits and number of splits possible. The setting itself is persisted in the IndexMetadata.

Although, we can get the value from _cluster/state under the index's metadata as routing_num_shards field, but, it isn't listed while calling GET {index}/_settings. Naturally, users expect it to be present in the output of GET {index}/_settings.

Related component

Indexing

To Reproduce

Click to see detailed steps:

Checkout 4c25257 from opensearch:main.

# create index
http PUT :9200/sample-idx 'settings:={"number_of_replicas":1, "number_of_shards": 1, "number_of_routing_shards": 512}'
HTTP/1.1 200 OK
X-OpenSearch-Version: OpenSearch/3.0.0-SNAPSHOT (opensearch)
content-encoding: gzip
content-length: 77
content-type: application/json; charset=UTF-8

{
    "acknowledged": true,
    "index": "sample-idx",
    "shards_acknowledged": true
}

# get index settings
http :9200/sample-idx/_settings
HTTP/1.1 200 OK
X-OpenSearch-Version: OpenSearch/3.0.0-SNAPSHOT (opensearch)
content-encoding: gzip
content-length: 203
content-type: application/json; charset=UTF-8

{
    "sample-idx": {
        "settings": {
            "index": {
                "creation_date": "1718143398625",
                "number_of_replicas": "1",
                "number_of_shards": "1",
                "provided_name": "sample-idx",  <-- not listed in {index}/_settings
                "replication": {
                    "type": "DOCUMENT"
                },
                "uuid": "KOvdS229RXS7FeQ2ltLJ6g",
                "version": {
                    "created": "137217827"
                }
            }
        }
    }
}

# get cluster state
  http :9200/_cluster/state
HTTP/1.1 200 OK
X-OpenSearch-Version: OpenSearch/3.0.0-SNAPSHOT (opensearch)
content-encoding: gzip
content-length: 876
content-type: application/json; charset=UTF-8

{
    "blocks": {},
    "cluster_manager_node": "fBwVW6GOQUCG4ZtiV2kJqw",
    "cluster_name": "runTask",
    "cluster_uuid": "N14cN9NDSOqNuiwuq7uQNQ",
    "master_node": "fBwVW6GOQUCG4ZtiV2kJqw",
    "metadata": {
        "cluster_coordination": {
... snip ...
        "indices": {
            "sample-idx": {
                "aliases": [],
                "aliases_version": 1,
                "in_sync_allocations": {
                    "0": [
                        "ONEQ3Wc2RAOtb6h4c74Nag"
                    ]
                },
                "mapping_version": 1,
                "mappings": {},
                "primary_terms": {
                    "0": 1
                },
                "rollover_info": {},
                "routing_num_shards": 512,  <-- visible here
... snip ...

Expected behavior

User should not delve into the _cluster/state to figure out routing_num_shards information. Instead index.routing_number_of_shards should be listed in the {index}/_settings response.

Additional Details

Plugins

N/A

Screenshots

N/A

Host/Environment (please complete the following information):

  • OS: MacOS Sonoma

Additional context

N/A

@r1walz r1walz added bug Something isn't working untriaged labels Jun 11, 2024
@github-actions github-actions bot added the Indexing Indexing, Bulk Indexing and anything related to indexing label Jun 11, 2024
@r1walz r1walz added the good first issue Good for newcomers label Jun 11, 2024
@andrross
Copy link
Member

[Triage - attendees 1 2 3 4]

Thanks for filing.

@PeacefulTortoise
Copy link

Hello, do you mind if I take a stab at this issue?

@r1walz r1walz assigned r1walz and PeacefulTortoise and unassigned r1walz Jun 18, 2024
@r1walz
Copy link
Member Author

r1walz commented Jun 18, 2024

Go ahead! @PeacefulTortoise. I don't see anyone working on it. I've assigned to you.

@PeacefulTortoise
Copy link

I've put up an initial PR! I'm not sure if that line of code that I removed was intentionally put there or not. Could you let me know if this fix looks good?

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
3 participants