mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
SEARCH-243: CommitTracker is taking a long time to acquire locks
This commit is contained in:
+14
-1
@@ -102,8 +102,9 @@ public class SolrCoreLoadRegistration {
|
||||
}
|
||||
|
||||
List<Tracker> trackers = createTrackers(coreName, trackerRegistry, props, scheduler, repositoryClient, srv);
|
||||
List<Tracker> lockBeforeCommit = getLockBeforeCommit(trackers);
|
||||
|
||||
CommitTracker commitTracker = new CommitTracker(props, repositoryClient, coreName, srv, trackers);
|
||||
CommitTracker commitTracker = new CommitTracker(props, repositoryClient, coreName, srv, lockBeforeCommit);
|
||||
trackerRegistry.register(coreName, commitTracker);
|
||||
scheduler.schedule(commitTracker, coreName, props);
|
||||
log.info("The Trackers are now scheduled to run");
|
||||
@@ -164,6 +165,18 @@ public class SolrCoreLoadRegistration {
|
||||
return trackers;
|
||||
}
|
||||
|
||||
private static List<Tracker> getLockBeforeCommit(List<Tracker> trackers) {
|
||||
List<Tracker> lockBeforeCommit = new ArrayList();
|
||||
for(Tracker tracker : trackers) {
|
||||
if(tracker instanceof MetadataTracker) {
|
||||
lockBeforeCommit.add(tracker);
|
||||
}else if(tracker instanceof AclTracker) {
|
||||
lockBeforeCommit.add(tracker);
|
||||
}
|
||||
}
|
||||
return lockBeforeCommit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shuts down the trackers for a core.
|
||||
*
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class ContentTracker extends AbstractTracker implements Tracker
|
||||
InformationServer informationServer)
|
||||
{
|
||||
super(p, client, coreName, informationServer);
|
||||
contentReadBatchSize = Integer.parseInt(p.getProperty("alfresco.contentReadBatchSize", "1000"));
|
||||
contentReadBatchSize = Integer.parseInt(p.getProperty("alfresco.contentReadBatchSize", "100"));
|
||||
contentUpdateBatchSize = Integer.parseInt(p.getProperty("alfresco.contentUpdateBatchSize", "1000"));
|
||||
threadHandler = new ThreadHandler(p, coreName, "ContentTracker");
|
||||
}
|
||||
|
||||
+5
@@ -658,6 +658,11 @@ public class MetadataTracker extends AbstractTracker implements Tracker
|
||||
trackerStats.addElapsedNodeTime(docCount, endElapsed - startElapsed);
|
||||
startElapsed = endElapsed;
|
||||
docCount = 0;
|
||||
|
||||
//Release the write lock allowing the commit tracker to run.
|
||||
this.getWriteLock().release();
|
||||
//Re-acquire the write lock and keep indexing.
|
||||
this.getWriteLock().acquire();
|
||||
}
|
||||
checkShutdown();
|
||||
}
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ alfresco.transactionDocsBatchSize=500
|
||||
alfresco.nodeBatchSize=100
|
||||
alfresco.changeSetAclsBatchSize=500
|
||||
alfresco.aclBatchSize=100
|
||||
alfresco.contentReadBatchSize=1000
|
||||
alfresco.contentReadBatchSize=100
|
||||
alfresco.contentUpdateBatchSize=1000
|
||||
|
||||
# Warming
|
||||
|
||||
Reference in New Issue
Block a user