Bug 1115127 - Live deletion of a snapshot (live merge) fails to find constructor for RemoveSnapshotSingleDiskLiveCommand
Summary: Live deletion of a snapshot (live merge) fails to find constructor for Remove...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.5
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 3.5.0
Assignee: Ravi Nori
QA Contact: Ori Gofen
URL:
Whiteboard: storage
Depends On: 1102881
Blocks: 1073943
TreeView+ depends on / blocked
 
Reported: 2014-07-01 15:42 UTC by Federico Simoncelli
Modified: 2016-05-26 01:48 UTC (History)
10 users (show)

Fixed In Version: ovirt-3.5.0-beta1.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-17 12:22:01 UTC
oVirt Team: Storage
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1124445 0 unspecified CLOSED [vdsm] Live deletion of a snapshot (live merge) fails with exceptions since vdsm can't locate base volume 2021-02-22 00:41:40 UTC
oVirt gerrit 29477 0 master MERGED engine : Update CoCo to use CommandContext Never
oVirt gerrit 29501 0 master MERGED engine : Save CommandContext in ContextCache Never
oVirt gerrit 29533 0 master MERGED engine : Live Merge fails to find cotr for RemoveSnapshotSingleDiskLiveCommand Never
oVirt gerrit 29565 0 master MERGED engine : Generate CommandContext on engine restart Never
oVirt gerrit 29829 0 ovirt-engine-3.5 MERGED engine : Update CoCo to use CommandContext Never
oVirt gerrit 29830 0 ovirt-engine-3.5 MERGED engine : Save CommandContext in ContextCache Never
oVirt gerrit 30535 0 ovirt-engine-3.5 MERGED engine : Generate CommandContext on engine restart Never

Internal Links: 1124445

Description Federico Simoncelli 2014-07-01 15:42:51 UTC
Description of problem:
Live deletion of a snapshot (live merge) fails to find constructor for RemoveSnapshotSingleDiskLiveCommand:

2014-07-01 17:26:07,384 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (http-/0.0.0.0:8080-3) [7ed688d2] Cant find constructor for type org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand with parameter types: [class org.ovirt.engine.core.common.action.RemoveSnapshotSingleDiskParameters]
2014-07-01 17:26:07,385 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (http-/0.0.0.0:8080-3) [7ed688d2] An exception has occured while trying to create a command object for command RemoveSnapshotSingleDiskLive: java.lang.RuntimeException: could not find matching constructor for Command class class org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand
        at org.ovirt.engine.core.bll.CommandsFactory.findCommandConstructor(CommandsFactory.java:197) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandsFactory.createCommand(CommandsFactory.java:61) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandsFactory.createCommand(CommandsFactory.java:53) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandExecutor.executeAsyncCommand(CommandExecutor.java:109) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.executeAsyncCommand(CommandCoordinatorImpl.java:76) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.TaskManagerUtil.executeAsyncCommand(TaskManagerUtil.java:167) [bll.jar:]
        at org.ovirt.engine.core.bll.RemoveSnapshotCommand.removeImages(RemoveSnapshotCommand.java:171) [bll.jar:]
        at org.ovirt.engine.core.bll.RemoveSnapshotCommand.executeCommand(RemoveSnapshotCommand.java:123) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1135) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1253) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1844) [bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:210) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInRequired(TransactionSupport.java:149) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:118) [utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:1274) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:343) [bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runAction(Backend.java:430) [bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:411) [bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runAction(Backend.java:369) [bll.jar:]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_60]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_60]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_60]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_60]


Version-Release number of selected component (if applicable):
ovirt-engine-3.5 - git hash: 0b16ed7

How reproducible:
100%

Steps to Reproduce:
1. Try to delete a snapshot while the VM is running (I had 2 snapshots and I tried to remove the internal one)

Actual results:
Operation fails with the above stacktrace, snapshot is removed from db but not from storage.

Expected results:
Operation should successfully run RemoveSnapshotSingleDiskLiveCommand.

Comment 1 Federico Simoncelli 2014-07-01 15:53:49 UTC
It seems that also another command is affected:

2014-07-01 17:52:10,080 INFO  [org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand] (DefaultQuartzScheduler_Worker-59) [191ea7e5] Executing Live Merge command step MERGE
2014-07-01 17:52:10,101 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (DefaultQuartzScheduler_Worker-59) [191ea7e5] Cant find constructor for type org.ovirt.engine.core.bll.MergeCommand with parameter types: [class org.ovirt.engine.core.common.action.MergeParameters]
2014-07-01 17:52:10,102 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (DefaultQuartzScheduler_Worker-59) [191ea7e5] An exception has occured while trying to create a command object for command Merge: java.lang.RuntimeException: could not find matching constructor for Command class class org.ovirt.engine.core.bll.MergeCommand
        at org.ovirt.engine.core.bll.CommandsFactory.findCommandConstructor(CommandsFactory.java:197) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandsFactory.createCommand(CommandsFactory.java:61) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandsFactory.createCommand(CommandsFactory.java:53) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandExecutor.executeAsyncCommand(CommandExecutor.java:109) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.executeAsyncCommand(CommandCoordinatorImpl.java:76) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.TaskManagerUtil.executeAsyncCommand(TaskManagerUtil.java:167) [bll.jar:]
        at org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.proceedCommandExecution(RemoveSnapshotSingleDiskLiveCommand.java:145) [bll.jar:]
        at org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommandCallback.doPolling(RemoveSnapshotSingleDiskLiveCommandCallback.java:18) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandExecutor.invokeCallbackMethods(CommandExecutor.java:75) [bll.jar:]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_60]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_60]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_60]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_60]
        at org.ovirt.engine.core.utils.timer.JobWrapper.execute(JobWrapper.java:60) [scheduler.jar:]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz.jar:]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz.jar:]

Comment 2 Greg Padgett 2014-07-01 16:06:40 UTC
Ravi, can you take a look?  Seems that CommandExecutor isn't looking for constructors with the CommandContext parameters, which affects all the internal Live Merge commands.

Comment 3 Ravi Nori 2014-07-01 21:47:00 UTC
Can be resolved by adding constructors with out CommandContext

public RemoveSnapshotSingleDiskLiveCommand(T parameters) {
..
}

Comment 4 Greg Padgett 2014-07-01 21:57:36 UTC
(In reply to Ravi Nori from comment #3)
> Can be resolved by adding constructors with out CommandContext
> 
> public RemoveSnapshotSingleDiskLiveCommand(T parameters) {
> ..
> }

Thanks Ravi.  I was under the impression that internal commands, such as those affected here, only needed a single constructor accepting parameters and the context ([1], section 3).  If that's not true for CommandExecutor-style commands I think that's fine, we just need to be sure to establish a convention.  We also will want to ensure we don't need to support any of the context modifications ([1], section 1).

[1] http://lists.ovirt.org/pipermail/devel/2014-June/007869.html

Comment 5 Ravi Nori 2014-07-01 22:09:30 UTC
CommandCoordinator has to be modified to persist and use command context to look up constructors, but command context is not serializable. I am working on it.

Comment 6 Yair Zaslavsky 2014-07-02 12:19:19 UTC
(In reply to Greg Padgett from comment #4)
> (In reply to Ravi Nori from comment #3)
> > Can be resolved by adding constructors with out CommandContext
> > 
> > public RemoveSnapshotSingleDiskLiveCommand(T parameters) {
> > ..
> > }
> 
> Thanks Ravi.  I was under the impression that internal commands, such as
> those affected here, only needed a single constructor accepting parameters
> and the context ([1], section 3).  If that's not true for
> CommandExecutor-style commands I think that's fine, we just need to be sure
> to establish a convention.  We also will want to ensure we don't need to
> support any of the context modifications ([1], section 1).
> 
> [1] http://lists.ovirt.org/pipermail/devel/2014-June/007869.html

That depends how you're invoking the command.

Comment 7 Yair Zaslavsky 2014-07-02 12:22:38 UTC
What I meant in my last comment -
Currently we cannot limit invoking internal commands to only the case where context is passed. Therefore, there might be cases where you will need a ctor without context.

Comment 10 Sandro Bonazzola 2014-10-17 12:22:01 UTC
oVirt 3.5 has been released and should include the fix for this issue.


Note You need to log in before you can comment on or make changes to this bug.