@Override public void run() { removeParentRepairSession(parentRepairSession); } }, MoreExecutors.directExecutor());
@Override public void run() { removeParentRepairSession(parentRepairSession); } }, MoreExecutors.sameThreadExecutor());
@Override public void run() { removeParentRepairSession(parentRepairSession); } }, MoreExecutors.directExecutor());
@Override public void run() { removeParentRepairSession(parentRepairSession); } }, MoreExecutors.directExecutor());
private void failRepair(UUID parentRepairSession, String errorMsg) { removeParentRepairSession(parentRepairSession); throw new RuntimeException(errorMsg); }
private void failRepair(UUID parentRepairSession, String errorMsg) { removeParentRepairSession(parentRepairSession); throw new RuntimeException(errorMsg); }
private void failRepair(UUID parentRepairSession, String errorMsg) { removeParentRepairSession(parentRepairSession); throw new RuntimeException(errorMsg); }
/** * Something has happened to a remote node - if that node is a coordinator, we mark the parent repair session id as failed. * * The fail marker is kept in the map for 24h to make sure that if the coordinator does not agree * that the repair failed, we need to fail the entire repair session * * @param ep endpoint to be convicted * @param phi the value of phi with with ep was convicted */ public void convict(InetAddress ep, double phi) { // We want a higher confidence in the failure detection than usual because failing a repair wrongly has a high cost. if (phi < 2 * DatabaseDescriptor.getPhiConvictThreshold() || parentRepairSessions.isEmpty()) return; Set<UUID> toRemove = new HashSet<>(); for (Map.Entry<UUID, ParentRepairSession> repairSessionEntry : parentRepairSessions.entrySet()) { if (repairSessionEntry.getValue().coordinator.equals(ep)) { toRemove.add(repairSessionEntry.getKey()); } } if (!toRemove.isEmpty()) { logger.debug("Removing {} in parent repair sessions", toRemove); for (UUID id : toRemove) removeParentRepairSession(id); } }
/** * Something has happened to a remote node - if that node is a coordinator, we mark the parent repair session id as failed. * * The fail marker is kept in the map for 24h to make sure that if the coordinator does not agree * that the repair failed, we need to fail the entire repair session * * @param ep endpoint to be convicted * @param phi the value of phi with with ep was convicted */ public void convict(InetAddress ep, double phi) { // We want a higher confidence in the failure detection than usual because failing a repair wrongly has a high cost. if (phi < 2 * DatabaseDescriptor.getPhiConvictThreshold() || parentRepairSessions.isEmpty()) return; Set<UUID> toRemove = new HashSet<>(); for (Map.Entry<UUID, ParentRepairSession> repairSessionEntry : parentRepairSessions.entrySet()) { if (repairSessionEntry.getValue().coordinator.equals(ep)) { toRemove.add(repairSessionEntry.getKey()); } } if (!toRemove.isEmpty()) { logger.debug("Removing {} in parent repair sessions", toRemove); for (UUID id : toRemove) removeParentRepairSession(id); } }
/** * Something has happened to a remote node - if that node is a coordinator, we mark the parent repair session id as failed. * * The fail marker is kept in the map for 24h to make sure that if the coordinator does not agree * that the repair failed, we need to fail the entire repair session * * @param ep endpoint to be convicted * @param phi the value of phi with with ep was convicted */ public void convict(InetAddress ep, double phi) { // We want a higher confidence in the failure detection than usual because failing a repair wrongly has a high cost. if (phi < 2 * DatabaseDescriptor.getPhiConvictThreshold() || parentRepairSessions.isEmpty()) return; Set<UUID> toRemove = new HashSet<>(); for (Map.Entry<UUID, ParentRepairSession> repairSessionEntry : parentRepairSessions.entrySet()) { if (repairSessionEntry.getValue().coordinator.equals(ep)) { toRemove.add(repairSessionEntry.getKey()); } } if (!toRemove.isEmpty()) { logger.debug("Removing {} in parent repair sessions", toRemove); for (UUID id : toRemove) removeParentRepairSession(id); } }
removeParentRepairSession(parentRepairSession); return Futures.immediateFuture(Collections.emptyList());
removeParentRepairSession(parentRepairSession); return Futures.immediateFuture(Collections.emptyList());
/** * Run final process of repair. * This removes all resources held by parent repair session, after performing anti compaction if necessary. * * @param parentSession Parent session ID * @param neighbors Repair participants (not including self) * @throws InterruptedException * @throws ExecutionException */ public synchronized ListenableFuture<?> finishParentSession(UUID parentSession, Set<InetAddress> neighbors, boolean doAntiCompaction) throws InterruptedException, ExecutionException { // We want to remove parent repair session whether we succeeded or not, so send AnticompactionRequest anyway. // Each replica node determines if anticompaction is needed. List<ListenableFuture<?>> tasks = new ArrayList<>(neighbors.size() + 1); for (InetAddress neighbor : neighbors) { AnticompactionTask task = new AnticompactionTask(parentSession, neighbor, doAntiCompaction); tasks.add(task); task.run(); // 'run' is just sending message } if (doAntiCompaction) { tasks.add(doAntiCompaction(parentSession)); } else { removeParentRepairSession(parentSession); } return Futures.successfulAsList(tasks); }
removeParentRepairSession(parentRepairSession); return Futures.immediateFuture(Collections.emptyList());
logger.debug("cleaning up repair"); CleanupMessage cleanup = (CleanupMessage) message.payload; ActiveRepairService.instance.removeParentRepairSession(cleanup.parentRepairSession); MessagingService.instance().sendReply(new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE), id, message.from); break; ActiveRepairService.instance.removeParentRepairSession(desc.parentSessionId); throw new RuntimeException(e);
logger.debug("cleaning up repair"); CleanupMessage cleanup = (CleanupMessage) message.payload; ActiveRepairService.instance.removeParentRepairSession(cleanup.parentRepairSession); MessagingService.instance().sendReply(new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE), id, message.from); break; ActiveRepairService.instance.removeParentRepairSession(desc.parentSessionId); throw new RuntimeException(e);
logger.debug("cleaning up repair"); CleanupMessage cleanup = (CleanupMessage) message.payload; ActiveRepairService.instance.removeParentRepairSession(cleanup.parentRepairSession); MessagingService.instance().sendReply(new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE), id, message.from); break; ActiveRepairService.instance.removeParentRepairSession(desc.parentSessionId); throw new RuntimeException(e);
logger.debug("cleaning up repair"); CleanupMessage cleanup = (CleanupMessage) message.payload; ActiveRepairService.instance.removeParentRepairSession(cleanup.parentRepairSession); MessagingService.instance().sendReply(new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE), id, message.from); break; ActiveRepairService.instance.removeParentRepairSession(desc.parentSessionId); throw new RuntimeException(e);