[ 
https://issues.apache.org/jira/browse/SOLR-15832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18062449#comment-18062449
 ] 

Jan Høydahl commented on SOLR-15832:
------------------------------------

This is not a regression of the original bug in this JIRA, it is a distinct new 
regression. Claude's analysis:
h2. Root Cause

The regression was introduced by commit 82c50e4291e (SOLR-16503: Use 
Http2SolrClient in SolrClientCache, SchemaDesigner, cherry-picked to branch_9x 
on Feb 10, 2025).
h3. What Changed

SchemaDesignerConfigSetHelper was migrated from using raw HTTP via 
CloudLegacySolrClient.getHttpClient() to using GenericSolrRequest + 
CloudSolrClient.

Before (CloudLegacySolrClient.getHttpClient().execute(httpPost)):
 - Bypassed CloudSolrClient's ZooKeeper collection validation entirely
 - The raw HTTP POST arrived at the Solr servlet (HttpSolrCall)
 - HttpSolrCall.autoCreateSystemColl() detected: POST + .system not in ZK → 
auto-created the collection
 - getStoredSampleDocs used raw HTTP GET; HTTP 404 was explicitly handled as 
"not found is OK"

After (request.process(cloudClient, BLOB_STORE_ID)):
 - CloudSolrClient performs a ZooKeeper lookup before sending any HTTP request
 - If .system doesn't exist in ZK → immediately throws 
SolrException("Collection not found: .system")
 - HttpSolrCall.autoCreateSystemColl() is never reached → .system is never 
auto-created
 - getStoredSampleDocs now only catches SolrServerException, not SolrException 
— so "Collection not found" propagates up

h3. Fix Options
 # Best for branch_9x: Before any blob operation in 
SchemaDesignerConfigSetHelper, check if .system exists and explicitly create it 
(CollectionAdminRequest.createCollection(SYSTEM_COLL, null, 1, 1)). Also fix 
getStoredSampleDocs to catch SolrException for the "not found" case (like the 
old HTTP 404 handling).
 # Also fix getStoredSampleDocs: Add SolrException to the catch block and 
return Collections.emptyList() when the collection doesn't exist — matching the 
old behavior where HTTP 404 was silently treated as "no documents stored.
 # Long-term/main: The main branch already has the proper fix — commit 
242c1fc4e8a (SOLR-17852) migrated Schema Designer entirely to the FileStore 
API, eliminating .system / BlobStore dependency. This backport would be more 
work but more correct.

The most targeted fix would be to ensure .system is created lazily in 
SchemaDesignerConfigSetHelper before blob reads/writes, and to also fix 
getStoredSampleDocs to handle the "collection not found" case gracefully.

> Schema Designer publish shouldn't fail if .system collection doesn't exist
> --------------------------------------------------------------------------
>
>                 Key: SOLR-15832
>                 URL: https://issues.apache.org/jira/browse/SOLR-15832
>             Project: Solr
>          Issue Type: Bug
>          Components: Schema Designer
>    Affects Versions: 8.10, 8.11, 8.10.1
>            Reporter: Timothy Potter
>            Assignee: Timothy Potter
>            Priority: Major
>             Fix For: 9.0, 8.11.1
>
>         Attachments: Screenshot 2026-03-02 at 2.59.41 PM.png, Screenshot 
> 2026-03-02 at 2.59.56 PM.png, Screenshot 2026-03-03 at 2.40.35 PM.png, 
> Screenshot 2026-03-03 at 2.40.42 PM.png
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> While testing Schema Designer against the cloud example, I encountered this 
> error while re-publishing the gettingstarted configset (without indexing any 
> sample docs):
> {code}
> 2021-12-03 17:20:13.663 ERROR (qtp29183965-99) [   ] o.a.s.a.AnnotatedApi 
> Error executing command   => org.apache.solr.common.SolrException: Collection 
> not found: .system
>       at 
> org.apache.solr.client.solrj.impl.BaseCloudSolrClient.requestWithRetryOnStaleState(BaseCloudSolrClient.java:901)
> org.apache.solr.common.SolrException: Collection not found: .system
>       at 
> org.apache.solr.client.solrj.impl.BaseCloudSolrClient.requestWithRetryOnStaleState(BaseCloudSolrClient.java:901)
>  ~[?:?]
>       at 
> org.apache.solr.client.solrj.impl.BaseCloudSolrClient.request(BaseCloudSolrClient.java:866)
>  ~[?:?]
>       at 
> org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:214) ~[?:?]
>       at 
> org.apache.solr.client.solrj.SolrClient.deleteByQuery(SolrClient.java:940) 
> ~[?:?]
>       at 
> org.apache.solr.handler.designer.SchemaDesignerConfigSetHelper.deleteStoredSampleDocs(SchemaDesignerConfigSetHelper.java:466)
>  ~[?:?]
>       at 
> org.apache.solr.handler.designer.SchemaDesignerAPI.cleanupTemp(SchemaDesignerAPI.java:1171)
>  ~[?:?]
>       at 
> org.apache.solr.handler.designer.SchemaDesignerAPI.publish(SchemaDesignerAPI.java:517)
>  ~[?:?]
>       at org.apache.solr.api.AnnotatedApi$Cmd.invoke(AnnotatedApi.java:299) 
> ~[?:?]
>       at org.apache.solr.api.AnnotatedApi.call(AnnotatedApi.java:175) ~[?:?]
>       at org.apache.solr.api.V2HttpCall.handleAdmin(V2HttpCall.java:340) 
> ~[?:?]
>       at 
> org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:800)
>  ~[?:?]
>       at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:545) 
> ~[?:?]
>       at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:427)
>  ~[?:?]
>       at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:357)
>  ~[?:?]
> {code}
> The publish operation should not fail due to problems cleaning up ...



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to