SOLR-8690: add solr.disableFingerprint system property

This commit is contained in:
yonik 2016-02-22 12:41:30 -05:00
parent dfd95df2f1
commit f47e6b2200
3 changed files with 12 additions and 1 deletions

View File

@ -294,6 +294,9 @@ Other Changes
* SOLR-8711: Upgrade Carrot2 clustering dependency to 3.12.0. (Dawid Weiss)
* SOLR-8690: Make peersync fingerprinting optional with solr.disableFingerprint system
property. (yonik)
======================= 5.5.0 =======================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

View File

@ -140,7 +140,7 @@ public class PeerSync {
this.maxUpdates = nUpdates;
this.cantReachIsSuccess = cantReachIsSuccess;
this.getNoVersionsIsSuccess = getNoVersionsIsSuccess;
this.doFingerprint = doFingerprint;
this.doFingerprint = doFingerprint && !("true".equals(System.getProperty("solr.disableFingerprint")));
this.client = core.getCoreDescriptor().getCoreContainer().getUpdateShardHandler().getHttpClient();
this.onlyIfActive = onlyIfActive;

View File

@ -181,6 +181,14 @@ public class PeerSyncTest extends BaseDistributedSearchTestCase {
// client0 now has an additional add beyond our window and the fingerprint should cause this to fail
assertSync(client1, numVersions, false, shardsArr[0]);
// if we turn of fingerprinting, it should succeed
System.setProperty("solr.disableFingerprint", "true");
try {
assertSync(client1, numVersions, true, shardsArr[0]);
} finally {
System.clearProperty("solr.disableFingerprint");
}
// lets add the missing document and verify that order doesn't matter
add(client1, seenLeader, sdoc("id",Integer.toString((int)v),"_version_",v));
assertSync(client1, numVersions, true, shardsArr[0]);