mirror of https://github.com/apache/lucene.git
SOLR-4926: get latest commit from deletion policy
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1497054 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
146d2be826
commit
bd6177d473
|
@ -318,19 +318,7 @@ public class SnapPuller {
|
|||
long latestVersion = (Long) response.get(CMD_INDEX_VERSION);
|
||||
long latestGeneration = (Long) response.get(GENERATION);
|
||||
|
||||
IndexCommit commit;
|
||||
RefCounted<SolrIndexSearcher> searcherRefCounted = null;
|
||||
try {
|
||||
searcherRefCounted = core.getNewestSearcher(false);
|
||||
if (searcherRefCounted == null) {
|
||||
SolrException.log(LOG, "No open searcher found - fetch aborted");
|
||||
return false;
|
||||
}
|
||||
commit = searcherRefCounted.get().getIndexReader().getIndexCommit();
|
||||
} finally {
|
||||
if (searcherRefCounted != null)
|
||||
searcherRefCounted.decref();
|
||||
}
|
||||
IndexCommit commit = core.getDeletionPolicy().getLatestCommit();
|
||||
|
||||
if (latestVersion == 0L) {
|
||||
if (forceReplication && commit.getGeneration() != 0) {
|
||||
|
|
Loading…
Reference in New Issue