You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "psalagnac (via GitHub)" <gi...@apache.org> on 2023/11/17 14:44:44 UTC
[PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
psalagnac opened a new pull request, #2084:
URL: https://github.com/apache/solr/pull/2084
https://issues.apache.org/jira/browse/SOLR-17077
<!--
_(If you are a project committer then you may remove some/all of the following template.)_
* https://issues.apache.org/jira/projects/SOLR
For something minor (i.e. that wouldn't be worth putting in release notes), you can skip JIRA.
To create a Jira issue, you will need to create an account there first.
The title of the PR should reference the Jira issue number in the form:
* SOLR-####: <short description of problem or changes>
SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
# Description
When we invoke `REJOINELECTION` command on a replica, the replica must first leave its current election position by deleting the sequential ephemeral node in Zookeeper. This is done by invoking `cancelElection()` method on the election context.
This issue is `cancelElection()` method is invoked twice. Once in `ZkController` and once in `retryElection()` in the leader elector. Consequently we try to delete the Zookeeper leader election node twice. The second attempt always fails since the node was already removed by the first attempt.
# Solution
Remove the call to `cancelElection()` from ZkController. Also remove the creation of a new election context here, since a new one will be created in `retryElection()`.
Second commit on the pull request is to remove useless parameters `shardId` and `electionNode` from the `REJOINELECTION` command, that are not used anymore.
# Tests
No test added.
I made sure all leader election tests still pass.
# Checklist
Please review the following and check all that apply:
- [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
- [x] I have created a Jira issue and added the issue ID to my pull request title.
- [x] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
- [x] I have developed this patch against the `main` branch.
- [x] I have run `./gradlew check`.
- [ ] I have added tests for my changes.
- [ ] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "psalagnac (via GitHub)" <gi...@apache.org>.
psalagnac commented on PR #2084:
URL: https://github.com/apache/solr/pull/2084#issuecomment-1843427630
Yes, just main is fine.
I want to follow-up on this work with other cleanups in leader election code. I don't think it is worth to backport them to 9x.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "mtchorz (via GitHub)" <gi...@apache.org>.
mtchorz commented on PR #2084:
URL: https://github.com/apache/solr/pull/2084#issuecomment-2331690979
@psalagnac @dsmiley are there any chances that the changes could be back ported to next 9.x version? We are facing similar issues with solr 9.5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "psalagnac (via GitHub)" <gi...@apache.org>.
psalagnac commented on code in PR #2084:
URL: https://github.com/apache/solr/pull/2084#discussion_r1414031688
##########
solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/RejoinLeaderElectionPayload.java:
##########
@@ -26,13 +26,9 @@ public class RejoinLeaderElectionPayload implements ReflectMapWriter {
// ones are meant to be required without that being specified on the v1 API or elsewhere
@JsonProperty public String collection;
- @JsonProperty public String shard;
Review Comment:
Thanks for pointing this @dsmiley.
I did a test locally and it seems to me any additional property in the Json payload here is simply ignored. Since this change is only removing some properties, I don't think we can have backwards-compatibility issues.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #2084:
URL: https://github.com/apache/solr/pull/2084#issuecomment-2336999104
It's a minor bug. Do you think it's has worse consequences than as-reported?
Any way, it's not going to make 9.7 (will be released probably Monday) but I'll backport after your response so it makes whatever release happens next.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on PR #2084:
URL: https://github.com/apache/solr/pull/2084#issuecomment-2331945449
> I don't see any reason this could not be ported. @dsmiley I'm not sure of the process here. Is a new Jira required?
If a backport isn't a major effort then generally we don't have new JIRA's. You can just backport it (and update the CHANGES.txt!)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "psalagnac (via GitHub)" <gi...@apache.org>.
psalagnac commented on PR #2084:
URL: https://github.com/apache/solr/pull/2084#issuecomment-1840992838
Thanks.
I added an entry in "Improvements", but not sure whether it should go to bug "Bug Fixes". Maybe the code should have been like the from the beginning.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley merged PR #2084:
URL: https://github.com/apache/solr/pull/2084
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #2084:
URL: https://github.com/apache/solr/pull/2084#issuecomment-1841766856
By entering this CHANGES.txt into the 10.0 release section, it means you believe it should not be back ported to 9x. Is that what you meant or was that accidental? I'll move it and backport if you wish.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "mtchorz (via GitHub)" <gi...@apache.org>.
mtchorz commented on PR #2084:
URL: https://github.com/apache/solr/pull/2084#issuecomment-2336604285
Are there any chances that this will fix will be released as a part of next, 9.7 release? Or we will need to wait for next one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #2084:
URL: https://github.com/apache/solr/pull/2084#issuecomment-1840901629
@psalagnac can you add a CHANGES.txt entry please? In "Other" or "Improvements" depending on your point of view. Try to both be brief and communicate the scope/impact -- kind of hard sometimes ;-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "psalagnac (via GitHub)" <gi...@apache.org>.
psalagnac commented on code in PR #2084:
URL: https://github.com/apache/solr/pull/2084#discussion_r1414031688
##########
solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/RejoinLeaderElectionPayload.java:
##########
@@ -26,13 +26,9 @@ public class RejoinLeaderElectionPayload implements ReflectMapWriter {
// ones are meant to be required without that being specified on the v1 API or elsewhere
@JsonProperty public String collection;
- @JsonProperty public String shard;
Review Comment:
Thanks for pointing this @dsmiley.
I did a test locally and it seems to me any additional property in the Json payload here is simply ignored. Since this change is only removing some properties, I don't think we can have backwards-compatibility issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on code in PR #2084:
URL: https://github.com/apache/solr/pull/2084#discussion_r1399267463
##########
solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/RejoinLeaderElectionPayload.java:
##########
@@ -26,13 +26,9 @@ public class RejoinLeaderElectionPayload implements ReflectMapWriter {
// ones are meant to be required without that being specified on the v1 API or elsewhere
@JsonProperty public String collection;
- @JsonProperty public String shard;
Review Comment:
Is this backwards-compatible? I'm not super familiar with this, but from what I can see, there are some inputs that are no longer needed. It seems they weren't really used before (yes?). What would happen if a client supplies it?
CC @gerlowskija you might know if this produces a failure or not
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-17077: Don't cancel twice when rejoining shard leader election [solr]
Posted by "psalagnac (via GitHub)" <gi...@apache.org>.
psalagnac commented on PR #2084:
URL: https://github.com/apache/solr/pull/2084#issuecomment-2331705727
I don't see any reason this could not be ported.
@dsmiley I'm not sure of the process here. Is a new Jira required?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org