[
https://issues.apache.org/jira/browse/SOLR-6141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14367347#comment-14367347
]
Steve Rowe commented on SOLR-6141:
----------------------------------
Each of the two tests successfully passed 25 iterations of beasting each with
this patch:
{code:java}
Index: solr/core/src/java/org/apache/solr/schema/SchemaManager.java
===================================================================
--- solr/core/src/java/org/apache/solr/schema/SchemaManager.java
(revision 1667433)
+++ solr/core/src/java/org/apache/solr/schema/SchemaManager.java
(working copy)
@@ -421,11 +421,9 @@
if (in instanceof ZkSolrResourceLoader.ZkByteArrayInputStream) {
int version = ((ZkSolrResourceLoader.ZkByteArrayInputStream)
in).getStat().getVersion();
log.info("managed schema loaded . version : {} ", version);
- return new ManagedIndexSchema(req.getCore().getSolrConfig(),
- req.getSchema().getResourceName() ,new InputSource(in),
- true,
- req.getSchema().getResourceName(),
- version,new Object());
+ return new ManagedIndexSchema
+ (req.getCore().getSolrConfig(), req.getSchema().getResourceName(),
new InputSource(in),
+ true, req.getSchema().getResourceName(), version,
req.getSchema().getSchemaUpdateLock());
} else {
return (ManagedIndexSchema) req.getCore().getLatestSchema();
}
Index: solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java
===================================================================
--- solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java
(revision 1667433)
+++ solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java
(working copy)
@@ -108,8 +108,8 @@
InputSource inputSource = new InputSource(new
ByteArrayInputStream(data));
String resourceName =
managedIndexSchemaFactory.getManagedSchemaResourceName();
ManagedIndexSchema newSchema = new ManagedIndexSchema
- (managedIndexSchemaFactory.getConfig(), resourceName,
inputSource,
- managedIndexSchemaFactory.isMutable(), resourceName,
stat.getVersion(), new Object());
+ (managedIndexSchemaFactory.getConfig(), resourceName,
inputSource, managedIndexSchemaFactory.isMutable(),
+ resourceName, stat.getVersion(),
oldSchema.getSchemaUpdateLock());
managedIndexSchemaFactory.setSchema(newSchema);
long stop = System.nanoTime();
log.info("Finished refreshing schema in " +
TimeUnit.MILLISECONDS.convert(stop - start, TimeUnit.NANOSECONDS) + " ms");
{code}
Committing shortly.
> Schema API: Remove fields, dynamic fields, field types and copy fields; and
> replace fields, dynamic fields and field types
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: SOLR-6141
> URL: https://issues.apache.org/jira/browse/SOLR-6141
> Project: Solr
> Issue Type: Sub-task
> Components: Schema and Analysis
> Reporter: Christoph Strobl
> Assignee: Steve Rowe
> Labels: rest_api
> Attachments: SOLR-6141.patch, SOLR-6141.patch
>
>
> It should be possible, via the bulk schema API, to remove and replace the
> following:
> # fields
> # dynamic fields
> # field types
> # copy field directives (note: replacement is not applicable to copy fields)
> Removing schema elements that are referred to elsewhere in the schema must be
> guarded against:
> # Removing a field type should be disallowed when there are fields or dynamic
> fields of that type.
> # Removing a field should be disallowed when there are copy field directives
> that use the field as source or destination.
> # Removing a dynamic field should be disallowed when it is the only possible
> match for a copy field source or destination.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]