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

Makes index creation more friendly #19450

Merged
merged 4 commits into from
Jul 15, 2016
Merged

Conversation

abeyad
Copy link

@abeyad abeyad commented Jul 15, 2016

This PR contains two major features, described in their respective PRs below:

  1. Index Creation does not cause the cluster health to temporarily go RED (rather it just goes to YELLOW). This greatly helps administrators of Elasticsearch clusters who get alerted whenever the cluster health goes RED.
  2. Because index creation causes the cluster health to go YELLOW instead of RED, this PR also enables waiting for a certain number of shard copies to be started before returning from the index creation operation.

This PR encompasses two other PRs:

  1. Index creation does not cause the cluster health to go RED #18737
  2. Index creation waits for write consistency shards #18985

Closes #9126

Ali Beyad added 4 commits July 11, 2016 15:30
Previously, index creation would momentarily cause the cluster health to
go RED, because the primaries were still being assigned and activated.
This commit ensures that when an index is created or an index is being
recovered during cluster recovery and it does not have any active
allocation ids, then the cluster health status will not go RED, but
instead be YELLOW.

Relates #9126
If the allocation decision for a primary shard was NO, this should
cause the cluster health for the shard to go RED, even if the shard
belongs to a newly created index or is part of cluster recovery.

Relates #9126
Before returning, index creation now waits for the configured number
of shard copies to be started. In the past, a client would create an
index and then potentially have to check the cluster health to wait
to execute write operations. With the cluster health semantics changing
so that index creation does not cause the cluster health to go RED,
this change enables waiting for the desired number of active shards
to be active before returning from index creation.

Relates #9126
@abeyad abeyad merged commit 687e2e1 into master Jul 15, 2016
@abeyad abeyad deleted the feature/friendly-index-creation branch July 15, 2016 16:11
@nik9000
Copy link
Member

nik9000 commented Jul 15, 2016

Very awesome!

abeyad pushed a commit to abeyad/elasticsearch that referenced this pull request Jul 15, 2016
integration tests, as they are no longer needed with
index creation now waiting for shards to be started before
returning from the index creation call (by default, it waits
for the primary of each shard to be started before returning,
which is what ensureYellow() was ensuring anyway).

Closes elastic#19452
Relates elastic#19450
abeyad pushed a commit that referenced this pull request Jul 15, 2016
integration tests, as they are no longer needed with
index creation now waiting for shards to be started before
returning from the index creation call (by default, it waits
for the primary of each shard to be started before returning,
which is what ensureYellow() was ensuring anyway).

Closes #19452
Relates #19450
abeyad pushed a commit to abeyad/elasticsearch that referenced this pull request Jul 15, 2016
creation in the REST tests, as we no longer need it due
to index creation now waiting for active shard copies
before returning (by default, it waits for the primary of
each shard, which is the same as ensuring yellow health).

Relates elastic#19450
abeyad pushed a commit that referenced this pull request Jul 15, 2016
creation in the REST tests, as we no longer need it due
to index creation now waiting for active shard copies
before returning (by default, it waits for the primary of
each shard, which is the same as ensuring yellow health).

Relates #19450
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants