SEARCH-2887 Disable FINGERPRINT and Document Cache by default

Cherry pick from eb4ab98
This commit is contained in:
Angel Borroy
2021-05-18 15:57:10 +02:00
parent 2c960cc3aa
commit c27b1aa14b
5 changed files with 36 additions and 7 deletions

View File

@@ -114,9 +114,11 @@ def getSolrcoreConfig(sharding, shardId, shardCount, shardRange):
print("SolrConfig for Shard: ", shardId, " : ", solrcoreConfig) print("SolrConfig for Shard: ", shardId, " : ", solrcoreConfig)
return solrcoreConfig return solrcoreConfig
def getSolrcoreReplacements(sharding, communication): def getSolrcoreReplacements(sharding, communication, fingerprint):
"""Returns a dict of replacements to make in the solrcore.properties file.""" """Returns a dict of replacements to make in the solrcore.properties file."""
solrcoreReplacements = {} solrcoreReplacements = {}
if fingerprint == 'true':
solrcoreReplacements['alfresco.fingerprint=false'] = 'alfresco.fingerprint=true'
if sharding != None: if sharding != None:
solrcoreReplacements['shard.method=DB_ID'] = 'shard.method={}'.format(sharding) solrcoreReplacements['shard.method=DB_ID'] = 'shard.method={}'.format(sharding)
if communication == 'mtls': if communication == 'mtls':
@@ -250,6 +252,7 @@ if __name__ == '__main__':
parser.add_argument('-sc', '--shardCount', type=int, help='Total number of shards to create (default 2)') parser.add_argument('-sc', '--shardCount', type=int, help='Total number of shards to create (default 2)')
parser.add_argument('-sr', '--shardRange', type=int, help='Total number of nodes per shard with DB_ID_RANGE sharding (default 800)') parser.add_argument('-sr', '--shardRange', type=int, help='Total number of nodes per shard with DB_ID_RANGE sharding (default 800)')
parser.add_argument('-ct', '--disableCascadeTracking', action='store_true', help='Cascade Tracking Disabled') parser.add_argument('-ct', '--disableCascadeTracking', action='store_true', help='Cascade Tracking Disabled')
parser.add_argument('-ef', '--enableFingerprint', action='store_true', help='Enable Fingerprint feature')
parser.add_argument('-sl', '--searchLogLevel', default='WARN', help='The log level for search (default WARN)', parser.add_argument('-sl', '--searchLogLevel', default='WARN', help='The log level for search (default WARN)',
choices=['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR']) choices=['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR'])
parser.add_argument('-o', '--output', default='.', help='The path of the directory to output to') parser.add_argument('-o', '--output', default='.', help='The path of the directory to output to')
@@ -306,7 +309,7 @@ if __name__ == '__main__':
dcYaml['services'][serviceName] = makeSearchNode(args.output, serviceName, externalPort, params, args.communication, dcYaml['services'][serviceName] = makeSearchNode(args.output, serviceName, externalPort, params, args.communication,
extraEnvironmentVars=getExtraEnvironmentVars(serviceName, replicationType), extraEnvironmentVars=getExtraEnvironmentVars(serviceName, replicationType),
solrcoreConfig=getSolrcoreConfig(args.sharding, shardId, args.shardCount, args.shardRange), solrcoreConfig=getSolrcoreConfig(args.sharding, shardId, args.shardCount, args.shardRange),
solrcoreReplacements=getSolrcoreReplacements(args.sharding, args.communication)) solrcoreReplacements=getSolrcoreReplacements(args.sharding, args.communication, str(args.enableFingerprint).lower()))
# Point Alfresco at whichever Solr node came last in the list. # Point Alfresco at whichever Solr node came last in the list.
solrHost = serviceName solrHost = serviceName

View File

@@ -24,7 +24,7 @@
* #L% * #L%
*/ */
package org.alfresco.test.search.functional.searchServices.search; package org.alfresco.test.search.functional.searchServices.search.fingerprint;
import static jersey.repackaged.com.google.common.collect.Sets.newHashSet; import static jersey.repackaged.com.google.common.collect.Sets.newHashSet;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
@@ -161,7 +161,7 @@ public class FingerPrintTest extends AbstractE2EFunctionalTest
SearchResponse response = query(fingerprintQuery); SearchResponse response = query(fingerprintQuery);
int count = response.getEntries().size(); int count = response.getEntries().size();
assertTrue(count > 1); assertTrue(count >= 1);
Set<String> expectedNames = newHashSet(); Set<String> expectedNames = newHashSet();
expectedNames.add(fileTaco.getName()); expectedNames.add(fileTaco.getName());

View File

@@ -0,0 +1,16 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="SearchSuite" verbose="6" preserve-order="true">
<listeners>
<listener class-name="org.alfresco.utility.report.log.LogsListener"/>
<listener class-name="org.alfresco.utility.report.HtmlReportListener"/>
</listeners>
<test name="E2E-Fingerprint-SearchServices">
<packages>
<package name="org.alfresco.test.search.functional.searchServices.search.fingerprint" />
</packages>
</test>
</suite>

View File

@@ -18,6 +18,7 @@
<package name="org.alfresco.test.search.functional.searchServices.*"> <package name="org.alfresco.test.search.functional.searchServices.*">
<exclude name="org.alfresco.test.search.functional.searchServices.cmis"/> <exclude name="org.alfresco.test.search.functional.searchServices.cmis"/>
<exclude name="org.alfresco.test.search.functional.searchServices.search.rm"/> <exclude name="org.alfresco.test.search.functional.searchServices.search.rm"/>
<exclude name="org.alfresco.test.search.functional.searchServices.search.fingerprint"/>
</package> </package>
</packages> </packages>
<!-- Despite this class is included in Search Services package, needs to be excluded in order to be executed as the last one --> <!-- Despite this class is included in Search Services package, needs to be excluded in order to be executed as the last one -->

View File

@@ -103,8 +103,9 @@ solr.filterCache.size=256
solr.filterCache.initialSize=128 solr.filterCache.initialSize=128
solr.queryResultCache.size=1024 solr.queryResultCache.size=1024
solr.queryResultCache.initialSize=1024 solr.queryResultCache.initialSize=1024
solr.documentCache.size=1024 # Document cache is useless, so it can be disabled
solr.documentCache.initialSize=1024 solr.documentCache.size=0
solr.documentCache.initialSize=0
solr.queryResultMaxDocsCached=2048 solr.queryResultMaxDocsCached=2048
solr.authorityCache.size=128 solr.authorityCache.size=128
@@ -155,11 +156,19 @@ solr.deniedCache.autowarmCount=0
solr.readerCache.autowarmCount=0 solr.readerCache.autowarmCount=0
solr.ownerCache.autowarmCount=0 solr.ownerCache.autowarmCount=0
solr.queryResultCache.autowarmCount=4 solr.queryResultCache.autowarmCount=4
solr.documentCache.autowarmCount=512 # Document cache is useless, so it can be disabled
solr.documentCache.autowarmCount=0
solr.queryResultWindowSize=512 solr.queryResultWindowSize=512
# Document Fingerprint
# This can be used to find similar content in general or biased towards containment by using the FINGERPRINT keyword in FTS
# This feature is disabled by default in order to save Solr Core storage space.
alfresco.fingerprint=false
# #
# TODO # TODO
# #