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

rollover `max_docs` uses doc count from both primary and replica/s #24217

Closed
jpcarey opened this issue Apr 20, 2017 · 4 comments

Comments

Projects
None yet
5 participants
@jpcarey
Copy link
Member

commented Apr 20, 2017

Elasticsearch version: 5.3.0

The rollover max_docs value uses the doc count from both primary and replica/s. It should be based upon the primary only, since the replica count can be changed.

(start two nodes, to allow the default 1 replica to allocate)

PUT /logs-000001 
{
  "aliases": {
    "logs_write": {}
  }
}
PUT logs_write/test/1
{
  "blah": "foo"
}
POST /logs_write/_rollover?dry_run
{
  "conditions": {
    "max_docs":  2
  }
}
# response
{
  "old_index": "logs-000001",
  "new_index": "logs-000002",
  "rolled_over": false,
  "dry_run": true,
  "acknowledged": false,
  "shards_acknowledged": false,
  "conditions": {
    "[max_docs: 2]": true
  }
}

change the replica count to 0:

PUT /logs-000001/_settings
{
  "index": {
    "number_of_replicas": 0
  }
}
# response
{
  "old_index": "logs-000001",
  "new_index": "logs-000002",
  "rolled_over": false,
  "dry_run": true,
  "acknowledged": false,
  "shards_acknowledged": false,
  "conditions": {
    "[max_docs: 2]": false
  }
}
@eticzon

This comment has been minimized.

Copy link

commented Apr 25, 2017

Hi @jpcarey, @clintongormley! I'd like to adopt this issue, if that's OK. It's my first time contributing to the project so if you guys are OK with me picking this up, I'll sign the CLA. Thanks!

@clintongormley

This comment has been minimized.

Copy link
Member

commented Apr 25, 2017

@eticzon great

Thanks for showing interest in contributing to Elasticsearch.

Here's a guide to how to go about it: https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md

@julemik

This comment has been minimized.

Copy link

commented May 8, 2017

Appreciate it Eticzon. I too am experiencing the issue. Doubled my max_docs for temporary solution.

fred84 added a commit to fred84/elasticsearch that referenced this issue May 28, 2017

@fred84

This comment has been minimized.

Copy link
Contributor

commented May 28, 2017

@eticzon would you mind if I will handle this issue?

@jpcarey @clintongormley I fixed rollover condition (fred84@0dc2ec3) with integration test successfully passing, but I'm currently struggling with passing full "gradle check"

bleskes added a commit that referenced this issue Jun 13, 2017

Rollover max docs should only count primaries (#24977)
max_doc condition for index rollover should use document count only from primary shards 

Fixes #24217

bleskes added a commit that referenced this issue Jun 13, 2017

Rollover max docs should only count primaries (#24977)
max_doc condition for index rollover should use document count only from primary shards 

Fixes #24217

bleskes added a commit that referenced this issue Jun 13, 2017

Rollover max docs should only count primaries (#24977)
max_doc condition for index rollover should use document count only from primary shards 

Fixes #24217

bleskes added a commit that referenced this issue Jun 13, 2017

Rollover max docs should only count primaries (#24977)
max_doc condition for index rollover should use document count only from primary shards 

Fixes #24217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.