You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/11/26 13:35:07 UTC

[GitHub] [solr] bszabo97 opened a new pull request, #1196: SOLR-11029 Create a v2 API equivalent for DELETENODE API

bszabo97 opened a new pull request, #1196:
URL: https://github.com/apache/solr/pull/1196

   https://issues.apache.org/jira/browse/SOLR-11029
   
   <!--
   _(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
   
   This PR implements a V2 equivalent for the `/admin/collections?action=DELETENODE` command.
   
   # Solution
   
   The solution makes use of JAX-RS annotations
   
   # Tests
   
   Because the solution uses the same methods in its core to do the actual work, I only added a test which checks the parameter conversion.
   
   # 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`.
   - [x] I have added tests for my changes.
   - [x] 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


[GitHub] [solr] gerlowskija merged pull request #1196: SOLR-11029 Create a v2 API equivalent for DELETENODE API

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija merged PR #1196:
URL: https://github.com/apache/solr/pull/1196


-- 
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] gerlowskija commented on a diff in pull request #1196: SOLR-11029 Create a v2 API equivalent for DELETENODE API

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on code in PR #1196:
URL: https://github.com/apache/solr/pull/1196#discussion_r1036281320


##########
solr/core/src/test/org/apache/solr/handler/admin/api/DeleteNodeAPITest.java:
##########
@@ -0,0 +1,103 @@
+/*
+ * 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.handler.admin.api;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.Map;
+import java.util.Optional;
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.cloud.OverseerSolrResponse;
+import org.apache.solr.cloud.api.collections.DistributedCollectionConfigSetCommandRunner;
+import org.apache.solr.common.cloud.ZkNodeProps;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+
+/** Unit tests for {@link DeleteNodeAPI} */
+public class DeleteNodeAPITest extends SolrTestCaseJ4 {

Review Comment:
   [-1] These tests look great to me, and are in line with many tests I've written for v2 work I've done up to this point.
   
   But...I have gotten some pushback recently from other committers (namely, David Smiley) about the pros and cons of using mocks for this sort of testing.  We had an extended back and forth, which is best summed up in the comment [here](https://github.com/apache/solr/pull/1053#discussion_r1016747436).
   
   The main takeaway I think is that we don't have to avoid mocks altogether, but since there's ambivalence about them in the community we should avoid them where we can.
   
   Specifically as it relates to this PR: we can validate the remote-message-creation logic without using mocks as long as we first refactor the message-creation logic, either into its own class, or into a `public static` method on DeleteNodeAPI, etc. The DELETEREPLICAPROPERTY API does this, you can look at the logic [here](https://github.com/apache/solr/pull/1053/files#diff-b4b71c67538ee9d3a8d34009f897e769879415fdb72b5decd7d63b7969dd8163R112) and the test code [here](https://github.com/apache/solr/pull/1053/files#diff-dc9ca75519c56fbe39d31e41e65506360ecba2d3488267b717c4127ae0cceef1R137) as examples.
   
   Would you be willing to make that change?



-- 
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] gerlowskija commented on pull request #1196: SOLR-11029 Create a v2 API equivalent for DELETENODE API

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija commented on PR #1196:
URL: https://github.com/apache/solr/pull/1196#issuecomment-1431697781

   Alright - thanks for the PR @bszabo97, it's perfect.  My apologies again for the huge delay with the SOLR-16531 blocker, but I'm happy to say that should be cleared away at this point.
   
   With the test changes you made back in December-ish this looks ready-to-merge to me, and it's certainly been out here for review long enough!  I've brought this up to date with the latest `main`, and `./gradlew check` is passing.  I'll merge this afternoon and then backport after a few days.  Thanks again!


-- 
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] gerlowskija commented on pull request #1196: SOLR-11029 Create a v2 API equivalent for DELETENODE API

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on PR #1196:
URL: https://github.com/apache/solr/pull/1196#issuecomment-1344414507

   Hi @bszabo97 
   
   Just wanted to give you a short update on my lack of progress on this.
   
   It is definitely still on my radar, but I've been a little distracted recently focusing on a performance regression that someone noticed in the JAX-RS framework overall: another committer noticed that the recent addition of the JAX-RS framework has slowed down Solr startup, in some cases quite significantly.  That's turned into a big blocker for the JAX-RS work overall: there's even talk of deferring the release of our JAX-RS v2 APIs until that perf regression can be mitigated.
   
   So most of my focus has shifted to that - after all, it's not much good focusing on individual JAX-RS APIs if shipping the whole framework gets delayed 😛 If you're curious, see SOLR-16531 for more details on all this.
   
   Anyway, that's all to say that I haven't gotten to this PR, but that I haven't forgotten it or let it fall off my radar.  I'm just focusing on this performance blocker, and plan to return to this when that's finished.  I appreciate all your work here and definitely haven't forgotten it!


-- 
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] bszabo97 commented on pull request #1196: SOLR-11029 Create a v2 API equivalent for DELETENODE API

Posted by GitBox <gi...@apache.org>.
bszabo97 commented on PR #1196:
URL: https://github.com/apache/solr/pull/1196#issuecomment-1361092894

   Hello @gerlowskija 
   
   Thanks for the heads up and for the great description of what should be changed in the tests. I have added a commit which changes the test and implementation according to your suggestions.
   If you think there is anything around the performance blocker in which I can help with I am more than happy to do so! 


-- 
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