Martin Peřina has posted comments on this change. Change subject: core: Skip hard fencing if host has connectivity.. ......................................................................
Patch Set 5: (4 comments) http://gerrit.ovirt.org/#/c/31304/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java: Line 236: log.infoFormat("ResourceManager::vdsNotResponding entered for Host {0}, {1}", Line 237: vds.getId(), Line 238: vds.getHostName()); Line 239: Line 240: boolean shouldExecRealFencing = isBelowConnectivityBrokenThreshold(vds); I would prefer isConnectivityBrokenThresholdReached() name and negation here Line 241: Line 242: if (executeSshSoftFencing) { Line 243: VdcReturnValueBase retVal = Line 244: Backend.getInstance().runInternalAction(VdcActionType.SshSoftFencing, Line 266: }); Line 267: } Line 268: private boolean isBelowConnectivityBrokenThreshold(VDS vds) { Line 269: VDSGroup cluster = DbFacade.getInstance().getVdsGroupDao().get(vds.getVdsGroupId()); Line 270: double percents=0; Please change to: double percents = 0; Line 271: boolean result = true; Line 272: if (cluster.getFencingPolicy().isSkipFencingIfConnectivityBroken()) { Line 273: List<VDS> hosts = DbFacade.getInstance().getVdsDao().getAllForVdsGroup(cluster.getId()); Line 274: double hostsNumber = hosts.size(); Line 282: double hostsWithBrokenConnectivityNumber = hostsWithBrokenConnectivity.size(); Line 283: percents = (hostsWithBrokenConnectivityNumber/hostsNumber)*100.0; Line 284: result = (percents < cluster.getFencingPolicy().getHostsWithBrokenConnectivityThreshold()); Line 285: } Line 286: if (! result) { Please remove space: if (!result) { Line 287: logAlert(vds, percents); Line 288: } Line 289: return result; Line 290: } Line 288: } Line 289: return result; Line 290: } Line 291: Line 292: private void logAlert(VDS host, Double percents) { Why new method when the code is called only once? Line 293: AuditLogableBase auditLogable = new AuditLogableBase(); Line 294: auditLogable.addCustomValue("Percents", percents.toString()); Line 295: auditLogable.setVdsId(host.getId()); Line 296: AuditLogDirector.log(auditLogable, AuditLogType.VDS_ALERT_FENCE_OPERATION_SKIPPED_BROKEN_CONNECTIVITY); -- To view, visit http://gerrit.ovirt.org/31304 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff1b4108da76286907773575c101c73aaacbca41 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <[email protected]> Gerrit-Reviewer: Eli Mesika <[email protected]> Gerrit-Reviewer: Martin Peřina <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
