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

Assign follower primary to nodes with remote cluster client role #59375

Merged
merged 1 commit into from Jul 14, 2020

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Jul 12, 2020

The primary shards of follower indices during the bootstrap need to be
on nodes with the remote cluster client role as those nodes reach out to
the corresponding leader shards on the remote cluster to copy Lucene
segment files and renew the retention leases. This commit introduces a
new allocation decider that ensures bootstrapping follower primaries are
allocated to nodes with the remote cluster client role.

Co-authored-by: Jason Tedor jason@tedor.me

Relates #54146
Relates #53924

Closes #58534

The primary shards of follower indices during the bootstrap need to be
on nodes with the remote cluster client role as those nodes reach out to
the corresponding leader shards on the remote cluster to copy Lucene
segment files and renew the retention leases. This commit introduces a
new allocation decider that ensures those follower primaries are
allocated to nodes with that role.

Co-authored-by: Jason Tedor <jason@tedor.me>
@dnhatn dnhatn added >bug :Distributed/CCR Issues around the Cross Cluster State Replication features v8.0.0 v7.9.0 v7.8.2 labels Jul 12, 2020
@dnhatn dnhatn requested a review from jasontedor July 12, 2020 22:19
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/CCR)

@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team label Jul 12, 2020
@dnhatn
Copy link
Member Author

dnhatn commented Jul 13, 2020

run elasticsearch-ci/2

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

return allocation.decision(Decision.YES, NAME, "shard is a replica follower and is not under the purview of this decider");
}
final RecoverySource recoverySource = shardRouting.recoverySource();
if (recoverySource == null || recoverySource.getType() != RecoverySource.Type.SNAPSHOT) {
Copy link
Member

Choose a reason for hiding this comment

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

Good catch on this!

@dnhatn
Copy link
Member Author

dnhatn commented Jul 14, 2020

@jasontedor Thank you for the proposal and review.

@dnhatn dnhatn merged commit a51dda8 into elastic:master Jul 14, 2020
@dnhatn dnhatn deleted the ccr-allocation-decider branch July 14, 2020 02:14
dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Jul 14, 2020
…stic#59375)

The primary shards of follower indices during the bootstrap need to be
on nodes with the remote cluster client role as those nodes reach out to
the corresponding leader shards on the remote cluster to copy Lucene
segment files and renew the retention leases. This commit introduces a
new allocation decider that ensures bootstrapping follower primaries are
allocated to nodes with the remote cluster client role.

Relates elastic#54146
Relates elastic#53924
Closes elastic#58534

Co-authored-by: Jason Tedor <jason@tedor.me>
dnhatn added a commit that referenced this pull request Jul 14, 2020
)

The primary shards of follower indices during the bootstrap need to be
on nodes with the remote cluster client role as those nodes reach out to
the corresponding leader shards on the remote cluster to copy Lucene
segment files and renew the retention leases. This commit introduces a
new allocation decider that ensures bootstrapping follower primaries are
allocated to nodes with the remote cluster client role.

Co-authored-by: Jason Tedor <jason@tedor.me>
albertzaharovits pushed a commit to albertzaharovits/elasticsearch that referenced this pull request Jul 14, 2020
…stic#59375)

The primary shards of follower indices during the bootstrap need to be
on nodes with the remote cluster client role as those nodes reach out to
the corresponding leader shards on the remote cluster to copy Lucene
segment files and renew the retention leases. This commit introduces a
new allocation decider that ensures bootstrapping follower primaries are
allocated to nodes with the remote cluster client role.

Co-authored-by: Jason Tedor <jason@tedor.me>
dnhatn added a commit that referenced this pull request Jul 15, 2020
)

The primary shards of follower indices during the bootstrap need to be
on nodes with the remote cluster client role as those nodes reach out to
the corresponding leader shards on the remote cluster to copy Lucene
segment files and renew the retention leases. This commit introduces a
new allocation decider that ensures bootstrapping follower primaries are
allocated to nodes with the remote cluster client role.

Backport of #59375

Co-authored-by: Jason Tedor <jason@tedor.me>
dnhatn added a commit that referenced this pull request Jul 29, 2020
CCR will stop functioning if the master node is on 7.8, but data nodes 
are before that version because the master node considers that all data
nodes do not have the remote cluster client role. This commit allows CCR
work on data nodes with legacy roles only.

Relates #54146
Relates #59375
dnhatn added a commit that referenced this pull request Aug 11, 2020
CCR will stop functioning if the master node is on 7.8, but data nodes 
are before that version because the master node considers that all data
nodes do not have the remote cluster client role. This commit allows CCR
work on data nodes with legacy roles only.

Relates #54146
Relates #59375
dnhatn added a commit that referenced this pull request Aug 11, 2020
CCR will stop functioning if the master node is on 7.8, but data nodes 
are before that version because the master node considers that all data
nodes do not have the remote cluster client role. This commit allows CCR
work on data nodes with legacy roles only.

Relates #54146
Relates #59375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/CCR Issues around the Cross Cluster State Replication features Team:Distributed Meta label for distributed team v7.8.2 v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] org.elasticsearch.xpack.ccr.FollowerFailOverIT#testFailOverOnFollower
4 participants