Michael Kublin has posted comments on this change.
Change subject: core: fix redundant storage server conn in db
......................................................................
Patch Set 3: I would prefer that you didn't submit this
(7 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DisconnectStorageServerConnectionCommand.java
Line 18: super(parameters);
Line 19: }
Line 20:
Line 21: @Override
Line 22: protected void executeCommand() {
Old bug, when runVds is failed, exception is thrown
Line 23: setSucceeded(disconnectStorage());
Line 24: }
Line 25:
Line 26: @Override
Line 38:
Line 39: return returnValue;
Line 40: }
Line 41:
Line 42: protected boolean disconnectStorage() {
we have runVdsCommand method
Line 43: return Backend.getInstance()
Line 44: .getResourceManager()
Line 45: .RunVdsCommand(
Line 46: VDSCommandType.DisconnectStorageServer,
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommand.java
Line 3: import org.apache.commons.lang.StringUtils;
Line 4: import org.ovirt.engine.core.bll.InternalCommandAttribute;
Line 5: import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
Line 6: import
org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase;
Line 7:
Also question, why we need a new command? Why not to remove connections usually
when a disconnect is performed?
Line 8: @NonTransactiveCommandAttribute
Line 9: @InternalCommandAttribute
Line 10: public class RemoveStorageServerConnectionCommand<T extends
StorageServerConnectionParametersBase> extends
DisconnectStorageServerConnectionCommand {
Line 11:
Line 5: import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
Line 6: import
org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase;
Line 7:
Line 8: @NonTransactiveCommandAttribute
Line 9: @InternalCommandAttribute
Command is internal ?
Line 10: public class RemoveStorageServerConnectionCommand<T extends
StorageServerConnectionParametersBase> extends
DisconnectStorageServerConnectionCommand {
Line 11:
Line 12: public RemoveStorageServerConnectionCommand(T parameters) {
Line 13: super(parameters);
Line 6: import
org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase;
Line 7:
Line 8: @NonTransactiveCommandAttribute
Line 9: @InternalCommandAttribute
Line 10: public class RemoveStorageServerConnectionCommand<T extends
StorageServerConnectionParametersBase> extends
DisconnectStorageServerConnectionCommand {
We don't need T extends ...., StorageServerConnectionParametersBase can be
good enought
Line 11:
Line 12: public RemoveStorageServerConnectionCommand(T parameters) {
Line 13: super(parameters);
Line 14: }
Line 14: }
Line 15:
Line 16: @Override
Line 17: protected void executeCommand() {
Line 18: //disconnect the connection from vdsm
this is wrong exception will be thrown, no reason for boolean
Line 19: boolean isStorageDisconnectSucceeded = disconnectStorage();
Line 20:
Line 21: if(isStorageDisconnectSucceeded) {
Line 22: String connectionId = getConnection().getid();
Line 19: boolean isStorageDisconnectSucceeded = disconnectStorage();
Line 20:
Line 21: if(isStorageDisconnectSucceeded) {
Line 22: String connectionId = getConnection().getid();
Line 23: if(StringUtils.isNotEmpty(connectionId)) {
how this can be? disconnect successes but id is empty?
Line 24: //remove the connection record from db
Line 25:
getDbFacade().getStorageServerConnectionDao().remove(connectionId);
Line 26: setSucceeded(true);
Line 27: }
--
To view, visit http://gerrit.ovirt.org/11936
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iea5468371514bd2c7bc043a6c5520e2864a09fe8
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches