Jan Høydahl created SOLR-18144:
----------------------------------

             Summary: Regression in Schema Designer and .system collection
                 Key: SOLR-18144
                 URL: https://issues.apache.org/jira/browse/SOLR-18144
             Project: Solr
          Issue Type: Bug
          Components: Schema Designer
    Affects Versions: 9.10.1, 9.10, 9.9
            Reporter: Jan Høydahl


When using Schema designer in solr 9.9 or 9.10, it complains with an error 
message "Collection not found: .system". We first thought it was related to 
SOLR-15832 but it turns out to be a new bug. Here is an analysis by Claude Code 
which I believe is accurate.
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.



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