diff --git a/config/alfresco/caches.properties b/config/alfresco/caches.properties
index 89f42a117c..520c7c8d9e 100644
--- a/config/alfresco/caches.properties
+++ b/config/alfresco/caches.properties
@@ -658,7 +658,7 @@ cache.shardStateSharedCache.tx.statsEnabled=${caches.tx.statsEnabled}
cache.shardStateSharedCache.maxItems=500
cache.shardStateSharedCache.timeToLiveSeconds=1800
cache.shardStateSharedCache.maxIdleSeconds=0
-cache.shardStateSharedCache.cluster.type=fully-distributed
+cache.shardStateSharedCache.cluster.type=invalidating
cache.shardStateSharedCache.backup-count=1
cache.shardStateSharedCache.eviction-policy=LRU
cache.shardStateSharedCache.eviction-percentage=25
@@ -673,7 +673,7 @@ cache.shardToGuidSharedCache.tx.statsEnabled=${caches.tx.statsEnabled}
cache.shardToGuidSharedCache.maxItems=500
cache.shardToGuidSharedCache.timeToLiveSeconds=0
cache.shardToGuidSharedCache.maxIdleSeconds=0
-cache.shardToGuidSharedCache.cluster.type=fully-distributed
+cache.shardToGuidSharedCache.cluster.type=invalidating
cache.shardToGuidSharedCache.backup-count=1
cache.shardToGuidSharedCache.eviction-policy=LRU
cache.shardToGuidSharedCache.eviction-percentage=25
diff --git a/config/alfresco/subsystems/Search/common-search-context.xml b/config/alfresco/subsystems/Search/common-search-context.xml
index 4f91f55163..c2b1d5c974 100644
--- a/config/alfresco/subsystems/Search/common-search-context.xml
+++ b/config/alfresco/subsystems/Search/common-search-context.xml
@@ -20,56 +20,6 @@
-
-
-
-
-
-
-
- org.alfresco.repo.index.shard.ShardRegistry
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${server.transaction.mode.readOnly}
- ${server.transaction.mode.readOnly}
- ${server.transaction.mode.default}
-
-
-
-
-
-
-
-
-
-
- ${search.solrShardRegistry.purgeOnInit}
-
-
- ${search.solrShardRegistry.shardInstanceTimeoutInSeconds}
-
-
- ${search.solrShardRegistry.maxAllowedReplicaTxCountDifference}
-
diff --git a/config/alfresco/subsystems/Search/solr4/solr-search-context.xml b/config/alfresco/subsystems/Search/solr4/solr-search-context.xml
index e7201c271b..dc8b63e7a3 100644
--- a/config/alfresco/subsystems/Search/solr4/solr-search-context.xml
+++ b/config/alfresco/subsystems/Search/solr4/solr-search-context.xml
@@ -43,9 +43,6 @@
-
-
-
@@ -78,6 +75,7 @@
+
diff --git a/config/alfresco/tx-cache-context.xml b/config/alfresco/tx-cache-context.xml
index cb7ed3a24c..e059e691a6 100644
--- a/config/alfresco/tx-cache-context.xml
+++ b/config/alfresco/tx-cache-context.xml
@@ -700,7 +700,7 @@
org.alfresco.cache.shardStateTransactionalCache
-
+
@@ -716,7 +716,7 @@
org.alfresco.cache.shardToGuidTransactionalCache
-
+
diff --git a/source/java/org/alfresco/repo/index/shard/ShardRegistryImpl.java b/source/java/org/alfresco/repo/index/shard/ShardRegistryImpl.java
deleted file mode 100644
index 76ee440b7d..0000000000
--- a/source/java/org/alfresco/repo/index/shard/ShardRegistryImpl.java
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- * Copyright (C) 2005-2015 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.repo.index.shard;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Random;
-import java.util.Set;
-
-import org.alfresco.repo.cache.SimpleCache;
-import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
-import org.alfresco.service.cmr.attributes.AttributeService;
-import org.alfresco.service.cmr.attributes.AttributeService.AttributeQueryCallback;
-import org.alfresco.service.cmr.search.SearchParameters;
-import org.alfresco.service.transaction.TransactionService;
-import org.alfresco.util.GUID;
-import org.alfresco.util.Pair;
-
-import com.hazelcast.util.ConcurrentHashSet;
-
-/**
- * @author Andy
- */
-public class ShardRegistryImpl implements ShardRegistry
-{
- /**
- *
- */
- public static final String INSTANCE_STATE = "instance.state";
-
- public enum ReplicaState {ACTIVE, LAGGING, SILENT };
-
- /**
- * The best shard sould be at the top;
- * @author Andy
- *
- */
- public static class FlocComparator implements Comparator>>>
- {
- public FlocComparator()
- {
-
- }
-
- @Override
- public int compare(Pair>> left, Pair>> right)
- {
- double leftTxCount = 0;
- for(HashSet states : left.getSecond().values())
- {
- long shardMaxTxCount = 0;
- for(ShardState state : states)
- {
- shardMaxTxCount = Math.max(shardMaxTxCount, state.getLastIndexedTxId());
- }
- leftTxCount += ((double)shardMaxTxCount)/left.getFirst().getNumberOfShards();
- }
-
- double rightTxCount = 0;
- for(HashSet states : right.getSecond().values())
- {
- long shardMaxTxCount = 0;
- for(ShardState state : states)
- {
- shardMaxTxCount = Math.max(shardMaxTxCount, state.getLastIndexedTxId());
- }
- rightTxCount += ((double)shardMaxTxCount)/right.getFirst().getNumberOfShards();
- }
- return (int)(rightTxCount - leftTxCount);
- }
-
- }
-
- private static String SHARD_STATE_KEY = ".SHARD_STATE";
-
- private AttributeService attributeService;
-
- private SimpleCache shardStateCache;
-
- private SimpleCache shardToGuidCache;
-
- private ConcurrentHashSet knownFlocks = new ConcurrentHashSet();
-
- private Random random = new Random(123);
-
- private boolean purgeOnInit = false;
-
- TransactionService transactionService;
-
- private long shardInstanceTimeoutInSeconds = 300;
-
- private long maxAllowedReplicaTxCountDifference = 1000;
-
- public ShardRegistryImpl()
- {
- }
-
- public void init()
- {
- if(purgeOnInit && (transactionService != null))
- {
- transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback