Should be called by each replica when request is ordered or replica is removed.
481591
def ordered_by_replica(self, request_key):
        
        state = self.get(request_key)
        if not state:
            return
        state.unordered_by_replicas_num -= 1
1159070
void replicationComplete() {
        reloadTasksFromModel();
        Toast.makeText(getApplicationContext(),
                R.string.replication_completed,
                Toast.LENGTH_LONG).show();
        dismissDialog(DIALOG_PROGRESS);
    }
226864
boolean tryDeleteReplica(Storable replica) throws PersistException {
        // Prevent trigger from being invoked by deleting replica.
        TriggerManager tm = mTriggerManager;
        tm.locallyDisableDelete();
        try {
            return replica.tryDelete();
        } finally {
            tm.locallyEnableDelete();
        }
    }
1323350
def cancel_spot_instance_requests(self, request_ids):
        
        params = {}
        if request_ids:
            self.build_list_params(params, request_ids, 'SpotInstanceRequestId')
        return self.get_list('CancelSpotInstanceRequests', params,
                             [('item', Instance)], verb='POST')
789455
def _process_request(self, request, client_address):
        """"""
        try:
            self.finish_request(request, client_address)
        except Exception:
            self.handle_error(request, client_address)
        finally:
            self.shutdown_request(request)
1144845
function done( error ) {
				if ( error ) {
					next( error );
					return;
				}
				if ( !request.hasOwnProperty( 'locals' ) ) {
					request.locals = {};
				}
				request.locals.monitor = metrics;
				next();
			}
1170765
def mark_as_executed(self, req: Request):
        
        state = self[req.key]
        state.executed = True
        self._clean(state)
983276
def on_view_change_complete(self):
        

        self.future_primaries_handler.set_node_state()

        if not self.replicas.all_instances_have_primary:
            raise LogicError(
                "{} Not all replicas have "
                "primaries: {}".format(self, self.replicas.primary_name_by_inst_id)
            )

        self._cancel(self._check_view_change_completed)

        for replica in self.replicas.values():
            replica.on_view_change_done()
        self.view_changer.last_completed_view_no = self.view_changer.view_no
        # Remove already ordered requests from requests list after view change
        # If view change happen when one half of nodes ordered on master
        # instance and backup but other only on master then we need to clear
        # requests list.  We do this to stop transactions ordering  on backup
        # replicas that have already been ordered on master.
        # Test for this case in plenum/test/view_change/
        # test_no_propagate_request_on_different_last_ordered_before_vc.py
        for replica in self.replicas.values():
            replica.clear_requests_and_fix_last_ordered()
        self.monitor.reset()
1369137
def update(self):
        
        ring = self._fetch()
        n_replicas = len(ring)
        replica_set = set([r[1] for r in self.replicas])
        self.ranges = []
        for n, (start, replica) in enumerate(ring):
            if replica in replica_set:
                end = ring[(n+1) % n_replicas][0] % RING_SIZE
                if start < end:
                    self.ranges.append((start, end))
                elif end < start:
                    self.ranges.append((start, RING_SIZE))
                    self.ranges.append((0, end))
                else:
                    self.ranges.append((0, RING_SIZE))
561630
def wait_for_instance_deletion(self, credentials, name, **kwargs):
        """"""
        op_name = wait_for_instance_deletion(
            credentials, self.project, self.zone, name, **kwargs)

        return op_name
771853
private void requestCacheUpdate() {
        log.debug("Cache update requested");
        if (updateRequested) {
            log.debug("Cache update, redundant request ignored.");
            return;
        }

        updateRequested = true;

        if (!updating) {
            updateCache();
        }
    }
963546
async def delete(self, request, resource=None, **kwargs):
        
        if resource:
            resources = [resource]
        else:
            data = await self.parse(request)
            if data:
                resources = list(self.collection.where(self.meta.model_pk << data))

        if not resources:
            raise RESTNotFound(reason='Resource not found')

        for resource in resources:
            resource.delete_instance()
346387
public void clearReplicaSyncRequest(int partitionId, ServiceNamespace namespace, int replicaIndex) {
        ReplicaFragmentSyncInfo syncInfo = new ReplicaFragmentSyncInfo(partitionId, namespace, replicaIndex, null);
        if (!replicaSyncRequests.remove(syncInfo)) {
            return;
        }

        if (logger.isFinestEnabled()) {
            logger.finest("Clearing sync replica request for partitionId=" + partitionId + ", replicaIndex="
                    + replicaIndex + ", namespace=" + namespace);
        }
        releaseReplicaSyncPermits(1);
        replicaSyncTimeoutScheduler.cancelIfExists(syncInfo, null);
    }
326749
private void removeFromReplicaLayer(final Node followedReplica) {
		final Node prev = NeoUtils.getPrevSingleNode(followedReplica,
				SocialGraphRelationshipType.GRAPHITY);
		final Node next = NeoUtils.getNextSingleNode(followedReplica,
				SocialGraphRelationshipType.GRAPHITY);

		// bridge the user replica in the replica layer
		prev.getSingleRelationship(SocialGraphRelationshipType.GRAPHITY,
				Direction.OUTGOING).delete();
		if (next != null) {
			next.getSingleRelationship(SocialGraphRelationshipType.GRAPHITY,
					Direction.INCOMING).delete();
			prev.createRelationshipTo(next,
					SocialGraphRelationshipType.GRAPHITY);
		}

		// remove the followship
		followedReplica.getSingleRelationship(
				SocialGraphRelationshipType.FOLLOW, Direction.INCOMING)
				.delete();

		// remove the replica node itself
		followedReplica.getSingleRelationship(
				SocialGraphRelationshipType.REPLICA, Direction.OUTGOING)
				.delete();
		followedReplica.delete();
	}
969716
void userSnapshotRequestExistenceCheck(boolean deleteExistingRequest) throws Exception {
        if (deleteExistingRequest) {
            m_zk.delete(VoltZK.user_snapshot_request, -1, null, null);
        }
        if (m_zk.exists(VoltZK.user_snapshot_request, m_userSnapshotRequestExistenceWatcher) != null) {
            processUserSnapshotRequestEvent(new WatchedEvent(
                    EventType.NodeCreated,
                    KeeperState.SyncConnected,
                    VoltZK.user_snapshot_request));
        }
    }
527056
public void setReplicasToRemove(java.util.Collection<String> replicasToRemove) {
        if (replicasToRemove == null) {
            this.replicasToRemove = null;
            return;
        }

        this.replicasToRemove = new com.amazonaws.internal.SdkInternalList<String>(replicasToRemove);
    }
515242
def process_remove_action(processors, action, argument):
    """"""
    for processor in processors:
        processor(action, argument)
    db.session.commit()