Re: [PR] SOLR-17381 SolrJ fix to fetch entire ClusterState if asked [solr]

2024-12-07 Thread via GitHub


dsmiley commented on code in PR #2853:
URL: https://github.com/apache/solr/pull/2853#discussion_r1874572327


##
solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseHttpClusterStateProvider.java:
##
@@ -128,58 +130,57 @@ public ClusterState.CollectionRef getState(String 
collection) {
   }
 
   @SuppressWarnings("unchecked")
-  private ClusterState fetchClusterState(
-  SolrClient client, String collection, Map 
clusterProperties)
+  private ClusterState fetchClusterState(SolrClient client)
   throws SolrServerException, IOException, NotACollectionException {
 SimpleOrderedMap cluster =
-submitClusterStateRequest(client, collection, 
ClusterStateRequestType.FETCH_COLLECTION);
+submitClusterStateRequest(client, null, 
ClusterStateRequestType.FETCH_CLUSTER_STATE);
 
-Map collectionsMap;
-if (collection != null) {
-  collectionsMap =
-  Collections.singletonMap(
-  collection, ((NamedList) 
cluster.get("collections")).get(collection));
-} else {
-  collectionsMap = ((NamedList) cluster.get("collections")).asMap(10);
-}
-int znodeVersion;
-Map collFromStatus = (Map) 
(collectionsMap).get(collection);
-if (collection != null && collFromStatus == null) {
-  throw new NotACollectionException(); // probably an alias
-}
-if (collection != null) { // can be null if alias
-  znodeVersion = (int) collFromStatus.get("znodeVersion");
-} else {
-  znodeVersion = -1;
-}
-
-ClusterState cs = new ClusterState(this.liveNodes, new HashMap<>());
 List liveNodesList = (List) cluster.get("live_nodes");
 if (liveNodesList != null) {
-  Set liveNodes = new HashSet<>(liveNodesList);
-  this.liveNodes = liveNodes;
+  this.liveNodes = Set.copyOf(liveNodesList);
   liveNodesTimestamp = System.nanoTime();
-  cs = new ClusterState(liveNodes, new HashMap<>());
 }
 
-for (Map.Entry e : collectionsMap.entrySet()) {
-  @SuppressWarnings("rawtypes")
-  Map m = (Map) e.getValue();
-  Long creationTimeMillisFromClusterStatus = (Long) 
m.get("creationTimeMillis");
-  Instant creationTime =
-  creationTimeMillisFromClusterStatus == null
-  ? Instant.EPOCH
-  : Instant.ofEpochMilli(creationTimeMillisFromClusterStatus);
-  cs = cs.copyWith(e.getKey(), fillPrs(znodeVersion, e, creationTime, m));
+var collectionsNl = (NamedList>) cluster.get("collections");
+
+Map collStateByName = new 
LinkedHashMap<>(collectionsNl.size());
+for (Entry> entry : collectionsNl) {
+  final var collStateMap = entry.getValue().asMap(10);
+  final int zNodeVersion = (int) collStateMap.get("znodeVersion");

Review Comment:
   fixed a critical bug in your last version.  We must use the ZK version for 
the DocCollection, not a bogus -1!



##
solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseHttpClusterStateProvider.java:
##
@@ -128,58 +130,57 @@ public ClusterState.CollectionRef getState(String 
collection) {
   }
 
   @SuppressWarnings("unchecked")
-  private ClusterState fetchClusterState(
-  SolrClient client, String collection, Map 
clusterProperties)
+  private ClusterState fetchClusterState(SolrClient client)
   throws SolrServerException, IOException, NotACollectionException {
 SimpleOrderedMap cluster =
-submitClusterStateRequest(client, collection, 
ClusterStateRequestType.FETCH_COLLECTION);
+submitClusterStateRequest(client, null, 
ClusterStateRequestType.FETCH_CLUSTER_STATE);
 
-Map collectionsMap;
-if (collection != null) {
-  collectionsMap =
-  Collections.singletonMap(
-  collection, ((NamedList) 
cluster.get("collections")).get(collection));
-} else {
-  collectionsMap = ((NamedList) cluster.get("collections")).asMap(10);
-}
-int znodeVersion;
-Map collFromStatus = (Map) 
(collectionsMap).get(collection);
-if (collection != null && collFromStatus == null) {
-  throw new NotACollectionException(); // probably an alias
-}
-if (collection != null) { // can be null if alias
-  znodeVersion = (int) collFromStatus.get("znodeVersion");
-} else {
-  znodeVersion = -1;
-}
-
-ClusterState cs = new ClusterState(this.liveNodes, new HashMap<>());
 List liveNodesList = (List) cluster.get("live_nodes");
 if (liveNodesList != null) {
-  Set liveNodes = new HashSet<>(liveNodesList);
-  this.liveNodes = liveNodes;
+  this.liveNodes = Set.copyOf(liveNodesList);
   liveNodesTimestamp = System.nanoTime();
-  cs = new ClusterState(liveNodes, new HashMap<>());
 }
 
-for (Map.Entry e : collectionsMap.entrySet()) {
-  @SuppressWarnings("rawtypes")
-  Map m = (Map) e.getValue();
-  Long creationTimeMillisFromClusterStatus = (Long) 
m.get("creationTimeMillis");
-  Instant creationTime =
-  creationTimeMillisFromClusterStatus == null
-  

Re: [PR] SOLR-17131: Optimize rows=0 since score/sort isn't necessary [solr]

2024-12-07 Thread via GitHub


github-actions[bot] commented on PR #2221:
URL: https://github.com/apache/solr/pull/2221#issuecomment-2525348954

   This PR has had no activity for 60 days and is now labeled as stale.  Any 
new activity will remove the stale label.  To attract more reviewers, please 
tag people who might be familiar with the code area and/or notify the 
d...@solr.apache.org mailing list. To exempt this PR from being marked as 
stale, make it a draft PR or add the label "exempt-stale". If left unattended, 
this PR will be closed after another 60 days of inactivity. Thank you for your 
contribution!


-- 
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-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



Re: [PR] SOLR-16810: Under certain situations Solr produces managed schema XML with duplicate fields [solr]

2024-12-07 Thread via GitHub


github-actions[bot] commented on PR #1654:
URL: https://github.com/apache/solr/pull/1654#issuecomment-2525348989

   This PR has had no activity for 60 days and is now labeled as stale.  Any 
new activity will remove the stale label.  To attract more reviewers, please 
tag people who might be familiar with the code area and/or notify the 
d...@solr.apache.org mailing list. To exempt this PR from being marked as 
stale, make it a draft PR or add the label "exempt-stale". If left unattended, 
this PR will be closed after another 60 days of inactivity. Thank you for your 
contribution!


-- 
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-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



[jira] [Updated] (SOLR-16810) Under certain situations Solr produces managed schema XML that cannot be loaded

2024-12-07 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SOLR-16810?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated SOLR-16810:
--
Labels: pull-request-available  (was: )

> Under certain situations Solr produces managed schema XML that cannot be 
> loaded
> ---
>
> Key: SOLR-16810
> URL: https://issues.apache.org/jira/browse/SOLR-16810
> Project: Solr
>  Issue Type: Bug
>  Components: Schema and Analysis
>Affects Versions: 9.2.1
>Reporter: Thiruvalluvan M. G.
>Assignee: Eric Pugh
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> While persisting the {{ManagedIndexSchema}} as XML, non-printable characters 
> in field names get escaped as {{{}#nn;{}}}, where {{nn}} is the decimal 
> representation of the non-printable character. For example, if the field name 
> has the byte {{{}0x14{}}}, it gets escaped as {{{}#20;{}}}. This in 
> indistinguishable from the literal {{#20;}} in the field name. If we have two 
> fields - one with the non-printable character and the other with the literal 
> string, two fields get generated with the same name. Loading the resulting 
> XML, naturally, causes an exception. To fix this, any occurrence of literal 
> {{#}} in the field name should be escaped, with say {{{}##{}}}.
> A second problem is that while escaping happens when generating XML, the 
> corresponding unescaping does not happen on loading it. This asymmetry should 
> be fixed as well.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



Re: [PR] SOLR-17130: edismax-matchalldocs-optimization [solr]

2024-12-07 Thread via GitHub


github-actions[bot] commented on PR #2218:
URL: https://github.com/apache/solr/pull/2218#issuecomment-2525348967

   This PR has had no activity for 60 days and is now labeled as stale.  Any 
new activity will remove the stale label.  To attract more reviewers, please 
tag people who might be familiar with the code area and/or notify the 
d...@solr.apache.org mailing list. To exempt this PR from being marked as 
stale, make it a draft PR or add the label "exempt-stale". If left unattended, 
this PR will be closed after another 60 days of inactivity. Thank you for your 
contribution!


-- 
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-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



Re: [PR] SOLR-4587: integrate lucene-monitor into solr [solr]

2024-12-07 Thread via GitHub


kotman12 commented on PR #2382:
URL: https://github.com/apache/solr/pull/2382#issuecomment-2525192744

   Hey @zzBrunoBrito .. thanks for replying. I've added some general [docs in 
this 
branch](https://github.com/kotman12/solr/tree/solr-monitor-doc/solr/modules/saved-search)
 that could help you out. I plan to add it to the refguide but I'm still 
working through some stuff.
   
   Until this is upstreamed though and solr picks up lucene 9.12 (which is in 
the works) you will have to do this hack:
   
   1. build the module and copy `build/packaging/saved-search/` into 
`solr-9.7.0/modules/` of your solr installation. Alternatively, you can use the 
one I just built to get started: 
[saved-search.zip](https://github.com/user-attachments/files/18048761/saved-search.zip).
 You might notice the strange name `aa-solr-saved-search-10.0.0-SNAPSHOT.jar` 
.. this is a temporary hack to load saved-search classes _before_ 
lucene-monitor classes. This won't be necessary once lucene 9.12 is picked up. 
   2. you can pretty much follow the instructions of "Basic Configuration" in 
the README I just linked but any time you see a classpath pointing to a _new_ 
class like `solr.SavedSearchUpdateProcessorFactory` .. you will have to replace 
the resource path with `solr.savedsearch.update.*` or  
`solr.savedsearch.cache.*` or  `solr.savedsearch.search.*` depending on the 
class. That is unless you want to build the whole solr distribution from 
scratch .. because the resource loader name mapping is in solr-core which I've 
updated in this PR but is obviously not something you'll pick up if you just 
patch in that jar.
   


-- 
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-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



Re: [PR] SOLR-16781: Fix missing change in RunExampleTool [solr]

2024-12-07 Thread via GitHub


gerlowskija commented on PR #2897:
URL: https://github.com/apache/solr/pull/2897#issuecomment-2525379104

   Gah!  Thanks for catching this @malliaridis !
   
   LGTM obviously


-- 
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-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org