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] When used the curl command to call the opensearch interface /_rollover to perform index rotation, the index did not rotate according to the rotation conditions of the passed parameters #12124

Open
liuwz02 opened this issue Feb 1, 2024 · 3 comments
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing

Comments

@liuwz02
Copy link

liuwz02 commented Feb 1, 2024

Describe the bug

When I used the curl command to call the opensearch interface to perform index rotation, the index did not rotate according to the rotation conditions of the passed parameters. Here is my request:

curl -X POST "https://opensearch-master-headless.paas-middleware:9200/testindex/_rollover" -ku xxx:yyy -H 'Content-Type: application/json' -d '
{
  "conditions": {
    "max_docs": 1000
  },
  "settings": {
    "index.number_of_shards": 2,
    "index.number_of_replicas": 0
  }
}'

At the same time, I used the Java client to call the index rotation API, and the index did not rotate according to the rotation strategy.The code is as follows:

RolloverRequest request = new RolloverRequest("testindex", null);
request.addMaxIndexDocsCondition(1000);
request.getCreateIndexRequest().settings(Settings.builder()
        .put("index.number_of_shards", 2)
        .put("index.number_of_replicas", 0));
RolloverResponse rolloverResponse = client.indices().rollover(request, RequestOptions.DEFAULT);

Related component

Other

To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

When any one or more rotation policies are passed in, including index size, number of documents, and maximum indexing time, the index rotates according to the policies.

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@liuwz02 liuwz02 added bug Something isn't working untriaged labels Feb 1, 2024
@github-actions github-actions bot added the Other label Feb 1, 2024
@peternied peternied added Indexing Indexing, Bulk Indexing and anything related to indexing and removed untriaged Other labels Mar 6, 2024
@peternied
Copy link
Member

[Triage - attendees 1 2 3 4 5]
@liuwz02 Thanks for filing this issue, we would gladly review a pull request for this feature.

@rwali-aws
Copy link

[Triage - attendees 1 2 3]

Removing the ClusterManager label as the issue is related to Indexing

@prayascoriolis
Copy link

prayascoriolis commented Oct 18, 2024

@liuwz02 have you checked for these conditions in which an index doesn't do rollover ? https://opensearch.org/docs/latest/im-plugin/ism/error-prevention/index/#rollover

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing
Projects
None yet
Development

No branches or pull requests

4 participants