Martin Peřina has posted comments on this change.
Change subject: core: prevent split brain caused by fence commands
......................................................................
Patch Set 1:
(5 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
Line 1: package org.ovirt.engine.core.bll;
Line 2:
Line 3: import static java.util.Collections.singletonMap;
Line 4: import static
org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair;
Please use static import only for constants. IMHO using it for methods makes
code less readable and maintainable.
Line 5: import static
org.ovirt.engine.core.common.AuditLogType.SYSTEM_FAILED_VDS_RESTART;
Line 6: import static
org.ovirt.engine.core.common.AuditLogType.SYSTEM_VDS_RESTART;
Line 7: import static
org.ovirt.engine.core.common.AuditLogType.USER_FAILED_VDS_RESTART;
Line 8: import static
org.ovirt.engine.core.common.AuditLogType.USER_VDS_RESTART;
Line 128:
Line 129: @Override
Line 130: protected Map<String, Pair<String, String>> getExclusiveLocks() {
Line 131: return super.getExclusiveLocks();
Line 132: }
Why override this method, when you only call super method?
Line 133:
Line 134: @Override
Line 135: protected EngineLock getLock() {
Line 136: if (commandLock == null) {
Line 172: }
Line 173:
Line 174: @Override
Line 175: protected void freeLock() {
Line 176: if (getParameters().getParentCommand() !=
VdcActionType.RestartVds) {
Is it necessary? Can RestartVdsCommand contain another RestartVdsCommand?
Line 177: super.freeLock();
Line 178: }
Line 179: }
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StartVdsCommand.java
Line 1: package org.ovirt.engine.core.bll;
Line 2:
Line 3: import static java.util.Collections.singletonMap;
Line 4: import static
org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair;
Please use static import only for constants. IMHO using it for methods makes
code less readable and maintainable.
Line 5: import static
org.ovirt.engine.core.common.errors.VdcBllMessages.SAME_ACTION_ON_ENTITY_ALREADY_IN_PROGRESS;
Line 6: import static org.ovirt.engine.core.common.locks.LockingGroup.VDS_FENCE;
Line 7:
Line 8: import java.util.Map;
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVdsCommand.java
Line 1: package org.ovirt.engine.core.bll;
Line 2:
Line 3: import static java.util.Collections.singletonMap;
Line 4: import static
org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair;
Please use static import only for constants. IMHO using it for methods makes
code less readable and maintainable.
Line 5: import static
org.ovirt.engine.core.common.errors.VdcBllMessages.SAME_ACTION_ON_ENTITY_ALREADY_IN_PROGRESS;
Line 6: import static org.ovirt.engine.core.common.locks.LockingGroup.VDS_FENCE;
Line 7:
Line 8: import java.util.Map;
--
To view, visit http://gerrit.ovirt.org/21049
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaf021010188e3c3662fbf8a057da4c58f2600c02
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Martin Peřina <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[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