You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "pvcnt (via GitHub)" <gi...@apache.org> on 2023/09/15 09:24:05 UTC
[GitHub] [solr] pvcnt opened a new pull request, #1928: Add a ReplicaCount to keep track of replicas per type
pvcnt opened a new pull request, #1928:
URL: https://github.com/apache/solr/pull/1928
https://issues.apache.org/jira/browse/SOLR-XXXXX
<!--
_(If you are a project committer then you may remove some/all of the following template.)_
Before creating a pull request, please file an issue in the ASF Jira system for Solr:
* 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
Please provide a short description of the changes you're making with this pull request.
# Solution
Please provide a short description of the approach taken to implement your solution.
# Tests
Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.
# Checklist
Please review the following and check all that apply:
- [ ] 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.
- [ ] I have created a Jira issue and added the issue ID to my pull request title.
- [ ] 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)
- [ ] I have developed this patch against the `main` branch.
- [ ] 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] Add a ReplicaCount to keep track of replicas per type [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #1928:
URL: https://github.com/apache/solr/pull/1928#issuecomment-1747603073
Furthermore, PRs titles must start with a JIRA reference (assuming there is one); that's how they are linked. I'll change that now.
--
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-16995 Add a ReplicaCount to keep track of replicas per type [solr]
Posted by "pvcnt (via GitHub)" <gi...@apache.org>.
pvcnt commented on code in PR #1928:
URL: https://github.com/apache/solr/pull/1928#discussion_r1346955921
##########
solr/core/src/java/org/apache/solr/cloud/api/collections/Assign.java:
##########
@@ -325,20 +326,18 @@ public static List<ReplicaPosition> getNodesForNewReplicas(
ClusterState clusterState,
String collectionName,
String shard,
- int nrtReplicas,
- int tlogReplicas,
- int pullReplicas,
+ ReplicaCount numReplicas,
Object createNodeSet,
SolrCloudManager cloudManager,
CoreContainer coreContainer)
throws IOException, InterruptedException, AssignmentException {
- log.debug(
- "getNodesForNewReplicas() shard: {} , nrtReplicas : {} , tlogReplicas: {} , pullReplicas: {} , createNodeSet {}",
- shard,
- nrtReplicas,
- tlogReplicas,
- pullReplicas,
- createNodeSet);
+ if (log.isDebugEnabled()) {
+ log.debug(
+ "getNodesForNewReplicas() shard={}, {} , createNodeSet={}",
+ shard,
+ numReplicas.toDebugString(),
Review Comment:
It sounds reasonable, done.
--
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-16995 Add a ReplicaCount to keep track of replicas per type [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley merged PR #1928:
URL: https://github.com/apache/solr/pull/1928
--
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
[GitHub] [solr] janhoy commented on pull request #1928: Add a ReplicaCount to keep track of replicas per type
Posted by "janhoy (via GitHub)" <gi...@apache.org>.
janhoy commented on PR #1928:
URL: https://github.com/apache/solr/pull/1928#issuecomment-1730910504
I think this can benefit from a JIRA 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-16995 Add a ReplicaCount to keep track of replicas per type [solr]
Posted by "pvcnt (via GitHub)" <gi...@apache.org>.
pvcnt commented on code in PR #1928:
URL: https://github.com/apache/solr/pull/1928#discussion_r1346935984
##########
solr/solrj/src/java/org/apache/solr/common/cloud/ReplicaCount.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.common.cloud;
+
+import java.util.Arrays;
+import java.util.EnumMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.apache.solr.common.SolrException;
+
+/** Tracks the number of replicas per replica type. This class is mutable. */
+public final class ReplicaCount {
+ private final Map<Replica.Type, Integer> countByType;
Review Comment:
Fixed.
##########
solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementRequestImpl.java:
##########
@@ -26,29 +25,23 @@
import org.apache.solr.cluster.Replica;
import org.apache.solr.cluster.SolrCollection;
import org.apache.solr.cluster.placement.PlacementRequest;
+import org.apache.solr.common.cloud.ReplicaCount;
public class PlacementRequestImpl implements PlacementRequest {
private final SolrCollection solrCollection;
private final Set<String> shardNames;
private final Set<Node> targetNodes;
- private final EnumMap<Replica.ReplicaType, Integer> countReplicas =
- new EnumMap<>(Replica.ReplicaType.class);
+ private final ReplicaCount numReplicas;
public PlacementRequestImpl(
SolrCollection solrCollection,
Set<String> shardNames,
Set<Node> targetNodes,
- int countNrtReplicas,
- int countTlogReplicas,
- int countPullReplicas) {
+ ReplicaCount numReplicas) {
Review Comment:
Sure, fixed.
--
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
[GitHub] [solr] sigram commented on a diff in pull request #1928: Add a ReplicaCount to keep track of replicas per type
Posted by "sigram (via GitHub)" <gi...@apache.org>.
sigram commented on code in PR #1928:
URL: https://github.com/apache/solr/pull/1928#discussion_r1334258677
##########
solr/solrj/src/java/org/apache/solr/common/cloud/ReplicaCount.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.common.cloud;
+
+import java.util.Arrays;
+import java.util.EnumMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.apache.solr.common.SolrException;
+
+/** Tracks a number of replica per replica types. This class is mutable. */
Review Comment:
Wording seems odd: perhaps "the number of replicas per replica type" ?
--
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
[GitHub] [solr] pvcnt commented on pull request #1928: Add a ReplicaCount to keep track of replicas per type
Posted by "pvcnt (via GitHub)" <gi...@apache.org>.
pvcnt commented on PR #1928:
URL: https://github.com/apache/solr/pull/1928#issuecomment-1734182362
@janhoy You're right, I created one: https://issues.apache.org/jira/browse/SOLR-16995
--
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-16995 Add a ReplicaCount to keep track of replicas per type [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on code in PR #1928:
URL: https://github.com/apache/solr/pull/1928#discussion_r1346448800
##########
solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementRequestImpl.java:
##########
@@ -26,29 +25,23 @@
import org.apache.solr.cluster.Replica;
import org.apache.solr.cluster.SolrCollection;
import org.apache.solr.cluster.placement.PlacementRequest;
+import org.apache.solr.common.cloud.ReplicaCount;
public class PlacementRequestImpl implements PlacementRequest {
private final SolrCollection solrCollection;
private final Set<String> shardNames;
private final Set<Node> targetNodes;
- private final EnumMap<Replica.ReplicaType, Integer> countReplicas =
- new EnumMap<>(Replica.ReplicaType.class);
+ private final ReplicaCount numReplicas;
public PlacementRequestImpl(
SolrCollection solrCollection,
Set<String> shardNames,
Set<Node> targetNodes,
- int countNrtReplicas,
- int countTlogReplicas,
- int countPullReplicas) {
+ ReplicaCount numReplicas) {
Review Comment:
Not sure if it's worth adding an overloaded variant for backwards-compatibility, albeit marked deprecated and a comment to remove in 10?
--
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
[GitHub] [solr] pvcnt commented on a diff in pull request #1928: Add a ReplicaCount to keep track of replicas per type
Posted by "pvcnt (via GitHub)" <gi...@apache.org>.
pvcnt commented on code in PR #1928:
URL: https://github.com/apache/solr/pull/1928#discussion_r1336195729
##########
solr/solrj/src/java/org/apache/solr/common/cloud/ReplicaCount.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.common.cloud;
+
+import java.util.Arrays;
+import java.util.EnumMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.apache.solr.common.SolrException;
+
+/** Tracks a number of replica per replica types. This class is mutable. */
Review Comment:
Agreed, that's fixed now, thanks!
--
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-16995 Add a ReplicaCount to keep track of replicas per type [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on code in PR #1928:
URL: https://github.com/apache/solr/pull/1928#discussion_r1346464411
##########
solr/solrj/src/java/org/apache/solr/common/cloud/ReplicaCount.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.common.cloud;
+
+import java.util.Arrays;
+import java.util.EnumMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.apache.solr.common.SolrException;
+
+/** Tracks the number of replicas per replica type. This class is mutable. */
+public final class ReplicaCount {
+ private final Map<Replica.Type, Integer> countByType;
Review Comment:
Should be EnumMap
--
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-16995 Add a ReplicaCount to keep track of replicas per type [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on code in PR #1928:
URL: https://github.com/apache/solr/pull/1928#discussion_r1346434338
##########
solr/core/src/java/org/apache/solr/cloud/api/collections/Assign.java:
##########
@@ -325,20 +326,18 @@ public static List<ReplicaPosition> getNodesForNewReplicas(
ClusterState clusterState,
String collectionName,
String shard,
- int nrtReplicas,
- int tlogReplicas,
- int pullReplicas,
+ ReplicaCount numReplicas,
Object createNodeSet,
SolrCloudManager cloudManager,
CoreContainer coreContainer)
throws IOException, InterruptedException, AssignmentException {
- log.debug(
- "getNodesForNewReplicas() shard: {} , nrtReplicas : {} , tlogReplicas: {} , pullReplicas: {} , createNodeSet {}",
- shard,
- nrtReplicas,
- tlogReplicas,
- pullReplicas,
- createNodeSet);
+ if (log.isDebugEnabled()) {
+ log.debug(
+ "getNodesForNewReplicas() shard={}, {} , createNodeSet={}",
+ shard,
+ numReplicas.toDebugString(),
Review Comment:
Might it be reasonable for ReplicaCount.toString() to be this debug string?
--
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-16995 Add a ReplicaCount to keep track of replicas per type [solr]
Posted by "pvcnt (via GitHub)" <gi...@apache.org>.
pvcnt commented on PR #1928:
URL: https://github.com/apache/solr/pull/1928#issuecomment-1748368064
I split the changes related to `leaderEligible` into a separate PR: #1911
--
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-16995 Add a ReplicaCount to keep track of replicas per type [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #1928:
URL: https://github.com/apache/solr/pull/1928#issuecomment-1760281500
HdfsCloudIncrementalBackupTest has been flapping since 2022-08, and lately steadily increasing.
--
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