SOLR-7587: First attempt at fixing the dead-lock; moved call to UpdateLog.onFirstSearcher to end of the SolrCore constructor as it only needs to run once per core initialization

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1681486 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy Potter 2015-05-24 16:43:03 +00:00
parent 88b5ea4935
commit b0a8ce42f5
3 changed files with 14 additions and 6 deletions

View File

@ -849,6 +849,18 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
this.ruleExpiryLock = new ReentrantLock();
registerConfListener();
// seed version buckets with max from index during core initialization
if (this.updateHandler != null && this.updateHandler.getUpdateLog() != null) {
RefCounted<SolrIndexSearcher> newestSearcher = getRealtimeSearcher();
if (newestSearcher != null) {
try {
this.updateHandler.getUpdateLog().onFirstSearcher(newestSearcher.get());
} finally {
newestSearcher.decref();
}
}
}
}
/** Set UpdateLog to buffer updates if the slice is in construction. */
@ -1806,10 +1818,6 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
}
if (currSearcher == null) {
if (updateHandler != null && updateHandler.getUpdateLog() != null) {
updateHandler.getUpdateLog().onFirstSearcher(newSearcher);
}
future = searcherExecutor.submit(new Callable() {
@Override
public Object call() throws Exception {

View File

@ -1578,7 +1578,7 @@ public class UpdateLog implements PluginInfoInitialized {
long maxVersion = Math.max(maxVersionFromIndex, maxVersionFromRecent);
if (maxVersion == 0L) {
maxVersion = versions.getNewClock();
log.warn("Could not find max version in index or recent updates, using new clock {}", maxVersion);
log.info("Could not find max version in index or recent updates, using new clock {}", maxVersion);
}
// seed all version buckets with the highest value from recent and index

View File

@ -235,7 +235,7 @@ public class VersionInfo {
maxVersionInIndex = NumericUtils.getMaxLong(versionTerms);
log.info("Found MAX value {} from Terms for {} in index", maxVersionInIndex, versionFieldName);
} else {
log.warn("No terms found for {}, cannot seed version bucket highest value from index", versionFieldName);
log.info("No terms found for {}, cannot seed version bucket highest value from index", versionFieldName);
}
} else {
ValueSource vs = versionField.getType().getValueSource(versionField, null);