-
Notifications
You must be signed in to change notification settings - Fork 814
SOLR-18144: Create .system collection at runtime if missing #4188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: branch_9x
Are you sure you want to change the base?
Changes from 1 commit
6136c56
758576e
970d888
d74cafa
938aa11
6d9462c
59a612f
f063a32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -474,13 +474,28 @@ protected void validateTypeChange(String configSet, SchemaField field, FieldType | |||||||||||
|
|
||||||||||||
| void deleteStoredSampleDocs(String configSet) { | ||||||||||||
| try { | ||||||||||||
| ensureSystemCollectionExists(); | ||||||||||||
| cloudClient().deleteByQuery(BLOB_STORE_ID, "id:" + configSet + "_sample/*", 10); | ||||||||||||
| } catch (IOException | SolrServerException | SolrException exc) { | ||||||||||||
| final String excStr = exc.toString(); | ||||||||||||
| log.warn("Failed to delete sample docs from blob store for {} due to: {}", configSet, excStr); | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| private void ensureSystemCollectionExists() throws IOException, SolrServerException { | ||||||||||||
| if (!zkStateReader().getClusterState().hasCollection(BLOB_STORE_ID)) { | ||||||||||||
| log.info("Creating {} collection for blob storage", BLOB_STORE_ID); | ||||||||||||
| CollectionAdminRequest.createCollection(BLOB_STORE_ID, null, 1, 1).process(cloudClient()); | ||||||||||||
|
||||||||||||
| CollectionAdminRequest.createCollection(BLOB_STORE_ID, null, 1, 1).process(cloudClient()); | |
| int liveNodes = zkStateReader().getClusterState().getLiveNodes().size(); | |
| int replicationFactor = Math.max(1, Math.min(3, liveNodes)); | |
| CollectionAdminRequest.createCollection(BLOB_STORE_ID, null, 1, replicationFactor) | |
| .process(cloudClient()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean... okay.. I guess I think of the .system as just supporting the schema designer and does it need "all that", but on the other okay...
epugh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
epugh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Copilot
AI
Mar 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds runtime creation of .system, but the existing schema designer tests always pre-create the blob store collection in @BeforeClass, so the new behavior isn't exercised. Consider updating/adding a test that starts without .system and asserts that storeSampleDocs (and/or other blob interactions) creates it successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteStoredSampleDocsnow auto-creates.systembefore attempting a delete. If.systemis missing, deletion is effectively a no-op, but this will instead create a new system collection during cleanup flows (e.g.,SchemaDesignerAPI.cleanupTemp). Consider skippingensureSystemCollectionExists()here and treating missing collection/blob as nothing to delete (similar togetStoredSampleDocs).