Skip to content

Commit 3b3c976

Browse files
author
Myron Scott
committed
remove improper assertion for client based on failover ordering
1 parent 25b440e commit 3b3c976

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

tc-server/src/main/java/com/tc/objectserver/api/EntityManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.tc.entity.MessageCodecSupplier;
2323
import com.tc.entity.VoltronEntityMessage;
2424
import com.tc.exception.ServerException;
25+
import com.tc.net.ClientID;
2526
import com.tc.object.EntityDescriptor;
2627
import com.tc.object.EntityID;
2728
import com.tc.object.FetchID;
@@ -30,6 +31,7 @@
3031
import java.util.Collection;
3132
import java.util.List;
3233
import java.util.Optional;
34+
import java.util.Set;
3335
import java.util.function.Predicate;
3436

3537
public interface EntityManager extends MessageCodecSupplier, PrettyPrintable {
@@ -78,7 +80,7 @@ public interface EntityManager extends MessageCodecSupplier, PrettyPrintable {
7880
*/
7981
void loadExisting(EntityID entityID, long recordedVersion, long consumerID, boolean canDelete, byte[] configuration) throws ServerException;
8082

81-
void resetReferences();
83+
Set<ClientID> resetReferences();
8284

8385
boolean canDelete(EntityID entityID);
8486

tc-server/src/main/java/com/tc/objectserver/entity/EntityManagerImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.tc.entity.VoltronEntityMessage;
2424
import com.tc.exception.ServerException;
2525
import com.tc.exception.TCShutdownServerException;
26+
import com.tc.net.ClientID;
2627
import com.tc.object.ClientInstanceID;
2728
import com.tc.object.EntityDescriptor;
2829

@@ -343,11 +344,11 @@ private EntityServerService<EntityMessage, EntityResponse> getVersionCheckedServ
343344
}
344345

345346
@Override
346-
public void resetReferences() {
347-
clientEntityStateManager.clearClientReferences();
347+
public Set<ClientID> resetReferences() {
348348
for (ManagedEntity me : entityIndex.values()) {
349349
me.resetReferences(0);
350350
}
351+
return clientEntityStateManager.clearClientReferences();
351352
}
352353

353354
@Override

tc-server/src/main/java/com/tc/objectserver/entity/ManagedEntityImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,8 +1108,6 @@ public Runnable promoteEntity() throws ConfigurationException {
11081108
// up on passives
11091109
if (canDelete) {
11101110
this.clientReferenceCount = 0;
1111-
// the entity references should have been cleared
1112-
Assert.assertTrue(clientEntityStateManager.verifyNoEntityReferences(fetchID));
11131111
} else {
11141112
Assert.assertEquals(this.clientReferenceCount, ManagedEntityImpl.UNDELETABLE_ENTITY);
11151113
}

tc-server/src/main/java/com/tc/objectserver/impl/DistributedObjectServer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ public synchronized void bootstrap() throws IOException, LocationNotCreatedExcep
738738
this.stripeIDStateManager,
739739
consistencyMgr);
740740

741-
connectServerStateToReplicatedState(monitoringShimService, state, clientEntityStateManager, l2Coordinator.getReplicatedClusterStateManager());
741+
connectServerStateToReplicatedState(monitoringShimService, state, l2Coordinator.getReplicatedClusterStateManager());
742742
// setup replication
743743
final Sink<ReplicationSendingAction> replicationSenderStage =
744744
stageManager.createStage(ServerConfigurationContext.ACTIVE_TO_PASSIVE_DRIVER_STAGE,
@@ -1105,7 +1105,7 @@ public void nodeLeft(NodeID nodeID) {
11051105
};
11061106
}
11071107

1108-
private void connectServerStateToReplicatedState(LocalMonitoringProducer monitoringShimService, StateManager mgr, ClientEntityStateManager clients, ReplicatedClusterStateManager rcs) {
1108+
private void connectServerStateToReplicatedState(LocalMonitoringProducer monitoringShimService, StateManager mgr, ReplicatedClusterStateManager rcs) {
11091109
mgr.registerForStateChangeEvents(new StateChangeListener() {
11101110
private boolean diagnosticsStarted = false;
11111111

@@ -1122,7 +1122,8 @@ public void l2StateChanged(StateChangedEvent sce) {
11221122
final Set<ClientID> existingClients = new HashSet<>(persistor.getClientStatePersistor().loadAllClientIDs());
11231123
// must do this because the replicated state when it comes to clients, may not include all the references
11241124
// to clients that were in the midst of cleaning up after disconnection.
1125-
existingClients.addAll(clients.clearClientReferences());
1125+
existingClients.addAll(entityManager.resetReferences());
1126+
;
11261127
Set<ConnectionID> existingConnections = existingClients.stream()
11271128
.map(cid->new ConnectionID(ConnectionID.NULL_JVM_ID, cid.toLong(), stripeIDStateManager.getStripeID().getName())).collect(Collectors.toSet());
11281129
getContext().getClientHandshakeManager().setStarting(existingClients);

0 commit comments

Comments
 (0)