SOLR-6141: fix schema update lock usage

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1667579 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2015-03-18 15:54:47 +00:00
parent 695a0f0af0
commit 7cde848e37
2 changed files with 5 additions and 7 deletions

View File

@ -421,11 +421,9 @@ public class SchemaManager {
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();
}

View File

@ -108,8 +108,8 @@ public class ZkIndexSchemaReader implements OnReconnect {
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");