mirror of
https://github.com/apache/lucene.git
synced 2025-02-09 11:35:14 +00:00
SOLR-7587: Move the call to seed version buckets to before buffering updates during core construction
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1682016 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
60298db833
commit
544bb51afe
@ -363,6 +363,11 @@ Bug Fixes
|
|||||||
* SOLR-7585: Fix NoSuchElementException in LFUCache resulting from heavy writes
|
* SOLR-7585: Fix NoSuchElementException in LFUCache resulting from heavy writes
|
||||||
making concurrent put() calls. (Maciej Zasada via Shawn Heisey)
|
making concurrent put() calls. (Maciej Zasada via Shawn Heisey)
|
||||||
|
|
||||||
|
* SOLR-7587: Seeding bucket versions from index when the firstSearcher event fires has a race condition
|
||||||
|
that leads to an infinite wait on VersionInfo's ReentrantReadWriteLock because the read-lock acquired
|
||||||
|
during a commit cannot be upgraded to a write-lock needed to block updates; solution is to move the
|
||||||
|
call out of the firstSearcher event path and into the SolrCore constructor. (Timothy Potter)
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
@ -841,6 +841,9 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// seed version buckets with max from index during core initialization ... requires a searcher!
|
||||||
|
seedVersionBucketsWithMaxFromIndex();
|
||||||
|
|
||||||
bufferUpdatesIfConstructing(coreDescriptor);
|
bufferUpdatesIfConstructing(coreDescriptor);
|
||||||
|
|
||||||
// For debugging
|
// For debugging
|
||||||
@ -849,16 +852,20 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
|||||||
|
|
||||||
this.ruleExpiryLock = new ReentrantLock();
|
this.ruleExpiryLock = new ReentrantLock();
|
||||||
registerConfListener();
|
registerConfListener();
|
||||||
|
}
|
||||||
|
|
||||||
// seed version buckets with max from index during core initialization
|
private void seedVersionBucketsWithMaxFromIndex() {
|
||||||
if (this.updateHandler != null && this.updateHandler.getUpdateLog() != null) {
|
UpdateHandler uh = getUpdateHandler();
|
||||||
|
if (uh != null && uh.getUpdateLog() != null) {
|
||||||
RefCounted<SolrIndexSearcher> newestSearcher = getRealtimeSearcher();
|
RefCounted<SolrIndexSearcher> newestSearcher = getRealtimeSearcher();
|
||||||
if (newestSearcher != null) {
|
if (newestSearcher != null) {
|
||||||
try {
|
try {
|
||||||
this.updateHandler.getUpdateLog().onFirstSearcher(newestSearcher.get());
|
uh.getUpdateLog().onFirstSearcher(newestSearcher.get());
|
||||||
} finally {
|
} finally {
|
||||||
newestSearcher.decref();
|
newestSearcher.decref();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.warn("No searcher available! Cannot seed version buckets with max from index.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user