[Engine-devel] Serial Execution of Async Tasks

Hi guys, As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow. Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... -Allon

----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message ----- From: "Eli Mesika" <emesika@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Friday, August 10, 2012 3:40:48 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks ----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram +1 I am also interested to get a flow how a task is created (i.e - replacement of ConcreateCreateTask) - but this will be handled in what Eli has asked for. In addition, you have two titles of "Successful Execution". At "compensate" - see how revertTasks currently behaves. Also read - http://wiki.ovirt.org/wiki/Main_Page/features/RunningCommandsOnEndActionFail... This is the work I did for CloneVmFromSnapshot - not saying it's perfect - but you should have an infrastructure/pattern to rollback not just via spmRevertTask but also using an engine command. Yair
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Yair Zaslavsky" <yzaslavs@redhat.com> To: "Eli Mesika" <emesika@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Allon Mureinik" <amureini@redhat.com> Sent: Friday, August 10, 2012 10:48:16 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message ----- From: "Eli Mesika" <emesika@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Friday, August 10, 2012 3:40:48 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram
+1 I am also interested to get a flow how a task is created (i.e - replacement of ConcreateCreateTask) - but this will be handled in what Eli has asked for.
In addition, you have two titles of "Successful Execution". Fixed.
At "compensate" - see how revertTasks currently behaves. Also read - http://wiki.ovirt.org/wiki/Main_Page/features/RunningCommandsOnEndActionFail...
This is the work I did for CloneVmFromSnapshot - not saying it's perfect - but you should have an infrastructure/pattern to rollback not just via spmRevertTask but also using an engine command. This is what the endWithFailure does - or am I missing your point?
Yair
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 10/08/12 03:40, Eli Mesika wrote:
----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram
+1, it would help understanding the flow. - It looks like you chose not re-use/extend the ExecutionHandler (the entity used for building the tasks view exposed to the users). It might be a good idea to keep the separation between the engine Jobs and the underlying vdsm tasks, but I want to make sure you are familiar with this mechanism and ruled it out with a reason. If this is the case please share why you decided not to use it. - how does this design survives a jboss restart? Can you please a section in the wiki to explain that. -successful execution - * "CommandBase iterates over its SPMAsyncTaskHandlers" - when? * If the second task is an HSM command (vs. SPM command), I think you should explain in the design how to handle such flows as well. * Why do we need before task? can you give a concrete example of what would you do in such a method. - I see you added SPMAsyncTaskHandler, any reason not to use SPMAsyncTasK to manage it own life-cycle? - In the life-cycle managed by the SPMAsyncTaskHandler there is a step 'createTask - how to create the async task' can you please elaborate what are the options. Livnat
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

Hi guys, Thanks for all your comments! The correct response for many these points is to update the wiki. I'm enclosing here the quick-and-dirty replies just to keep this thread alive, and will update the wiki shortly. See inline. ----- Original Message -----
From: "Livnat Peer" <lpeer@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Sunday, August 12, 2012 9:39:23 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 10/08/12 03:40, Eli Mesika wrote:
----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram
Good idea, I'll see if I can jimmy something up.
+1, it would help understanding the flow.
- It looks like you chose not re-use/extend the ExecutionHandler (the entity used for building the tasks view exposed to the users). It might be a good idea to keep the separation between the engine Jobs and the underlying vdsm tasks, but I want to make sure you are familiar with this mechanism and ruled it out with a reason. If this is the case please share why you decided not to use it. As you said Jobs and Steps are pure engine entities - they can contain no VDSM tasks, one VDSM task, or plausibly, in the future, several tasks. Even /today/, AsyncTasks and Jobs/Steps are two different kinds of animals - I don't see any added value in mixing them together.
- how does this design survives a jboss restart? Can you please a section in the wiki to explain that.
Basically, the way as a Command does today - the task is saved with the executionIndex, and continues when the command is woken up. I'll clarify this point in the wiki.
-successful execution - * "CommandBase iterates over its SPMAsyncTaskHandlers" - when?
This is the new suggested format of executeCommand(). I'll clarify this too.
* If the second task is an HSM command (vs. SPM command), I think you should explain in the design how to handle such flows as well. HSM commands do not create AsyncTasks, as they do today - I will clarify this.
* Why do we need before task? can you give a concrete example of what would you do in such a method. Basically, /today/, command look like this: executeCommand() { doStuffInTheDB(); runVdsCommand(someCommand); }
endSuccessfully() { doMoreStuffInTheDB(); } endWithFailure() { doMoreStuffForFailureInTheDB(); } In the new design, the entire doStuffInTheDB() should be moved to a breforeTask of the (only) SPMAsyncTaskHandler.
- I see you added SPMAsyncTaskHandler, any reason not to use SPMAsyncTasK to manage it own life-cycle?
Conserving today's design - The SPMAsyncTaskHandler is the place to add additional, non-SPM, logic around the SPM task execution, like CommandBase allows today.
- In the life-cycle managed by the SPMAsyncTaskHandler there is a step 'createTask - how to create the async task' can you please elaborate what are the options.
new [any type of async task]
Livnat
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

How should we handle the auditLogMessages? Basically when a command ends it print an audit log. When we will start to use multiple tasks I assume user might get a bulk of audit logs which are actually related to the same action (when we fail for example the process will be create and delete). It might be a bit confusing for the user not to know which action is related to the operation Maybe we will need to use the correlation id of the Execution handler as Eli suggested or maybe add new states at CommandActionState? On 08/14/2012 02:10 PM, Allon Mureinik wrote:
Hi guys,
Thanks for all your comments! The correct response for many these points is to update the wiki. I'm enclosing here the quick-and-dirty replies just to keep this thread alive, and will update the wiki shortly.
See inline.
----- Original Message -----
From: "Livnat Peer" <lpeer@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Sunday, August 12, 2012 9:39:23 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 10/08/12 03:40, Eli Mesika wrote:
----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram
Good idea, I'll see if I can jimmy something up.
+1, it would help understanding the flow.
- It looks like you chose not re-use/extend the ExecutionHandler (the entity used for building the tasks view exposed to the users). It might be a good idea to keep the separation between the engine Jobs and the underlying vdsm tasks, but I want to make sure you are familiar with this mechanism and ruled it out with a reason. If this is the case please share why you decided not to use it. As you said Jobs and Steps are pure engine entities - they can contain no VDSM tasks, one VDSM task, or plausibly, in the future, several tasks. Even /today/, AsyncTasks and Jobs/Steps are two different kinds of animals - I don't see any added value in mixing them together.
- how does this design survives a jboss restart? Can you please a section in the wiki to explain that.
Basically, the way as a Command does today - the task is saved with the executionIndex, and continues when the command is woken up. I'll clarify this point in the wiki.
-successful execution - * "CommandBase iterates over its SPMAsyncTaskHandlers" - when?
This is the new suggested format of executeCommand(). I'll clarify this too.
* If the second task is an HSM command (vs. SPM command), I think you should explain in the design how to handle such flows as well. HSM commands do not create AsyncTasks, as they do today - I will clarify this.
* Why do we need before task? can you give a concrete example of what would you do in such a method. Basically, /today/, command look like this: executeCommand() { doStuffInTheDB(); runVdsCommand(someCommand); }
endSuccessfully() { doMoreStuffInTheDB(); }
endWithFailure() { doMoreStuffForFailureInTheDB(); }
In the new design, the entire doStuffInTheDB() should be moved to a breforeTask of the (only) SPMAsyncTaskHandler.
- I see you added SPMAsyncTaskHandler, any reason not to use SPMAsyncTasK to manage it own life-cycle?
Conserving today's design - The SPMAsyncTaskHandler is the place to add additional, non-SPM, logic around the SPM task execution, like CommandBase allows today.
- In the life-cycle managed by the SPMAsyncTaskHandler there is a step 'createTask - how to create the async task' can you please elaborate what are the options.
new [any type of async task]
Livnat
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 08/14/2012 02:35 PM, Maor Lipchuk wrote:
How should we handle the auditLogMessages? Basically when a command ends it print an audit log.
When we will start to use multiple tasks I assume user might get a bulk of audit logs which are actually related to the same action (when we fail for example the process will be create and delete). It might be a bit confusing for the user not to know which action is related to the operation
I thought audit log gets written regardless of the transaction, so audit log appears "as they happen"?
Maybe we will need to use the correlation id of the Execution handler as Eli suggested or maybe add new states at CommandActionState?
On 08/14/2012 02:10 PM, Allon Mureinik wrote:
Hi guys,
Thanks for all your comments! The correct response for many these points is to update the wiki. I'm enclosing here the quick-and-dirty replies just to keep this thread alive, and will update the wiki shortly.
See inline.
----- Original Message -----
From: "Livnat Peer" <lpeer@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Sunday, August 12, 2012 9:39:23 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 10/08/12 03:40, Eli Mesika wrote:
----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram
Good idea, I'll see if I can jimmy something up.
+1, it would help understanding the flow.
- It looks like you chose not re-use/extend the ExecutionHandler (the entity used for building the tasks view exposed to the users). It might be a good idea to keep the separation between the engine Jobs and the underlying vdsm tasks, but I want to make sure you are familiar with this mechanism and ruled it out with a reason. If this is the case please share why you decided not to use it. As you said Jobs and Steps are pure engine entities - they can contain no VDSM tasks, one VDSM task, or plausibly, in the future, several tasks. Even /today/, AsyncTasks and Jobs/Steps are two different kinds of animals - I don't see any added value in mixing them together.
- how does this design survives a jboss restart? Can you please a section in the wiki to explain that.
Basically, the way as a Command does today - the task is saved with the executionIndex, and continues when the command is woken up. I'll clarify this point in the wiki.
-successful execution - * "CommandBase iterates over its SPMAsyncTaskHandlers" - when?
This is the new suggested format of executeCommand(). I'll clarify this too.
* If the second task is an HSM command (vs. SPM command), I think you should explain in the design how to handle such flows as well. HSM commands do not create AsyncTasks, as they do today - I will clarify this.
* Why do we need before task? can you give a concrete example of what would you do in such a method. Basically, /today/, command look like this: executeCommand() { doStuffInTheDB(); runVdsCommand(someCommand); }
endSuccessfully() { doMoreStuffInTheDB(); }
endWithFailure() { doMoreStuffForFailureInTheDB(); }
In the new design, the entire doStuffInTheDB() should be moved to a breforeTask of the (only) SPMAsyncTaskHandler.
- I see you added SPMAsyncTaskHandler, any reason not to use SPMAsyncTasK to manage it own life-cycle?
Conserving today's design - The SPMAsyncTaskHandler is the place to add additional, non-SPM, logic around the SPM task execution, like CommandBase allows today.
- In the life-cycle managed by the SPMAsyncTaskHandler there is a step 'createTask - how to create the async task' can you please elaborate what are the options.
new [any type of async task]
Livnat
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 08/14/2012 02:35 PM, Maor Lipchuk wrote:
How should we handle the auditLogMessages? Basically when a command ends it print an audit log.
When we will start to use multiple tasks I assume user might get a bulk of audit logs which are actually related to the same action (when we fail for example the process will be create and delete). It might be a bit confusing for the user not to know which action is related to the operation
I thought audit log gets written regardless of the transaction, so audit log appears "as they happen"? That is correct, The issue that I was referring to, is that now, with multiple tasks execution, we will get many audit logs which related to the same
On 08/14/2012 05:23 PM, Itamar Heim wrote: transaction but each one will be printed at a different time. I think that it might be confusing for the user to relate each audit log to the operation that was started. For example : User run an action that executes some tasks of create volumes, then the engine encounter a problem, and decide to rollback the operation and delete the volumes, in that case the engine will execute a delete task for the volumes, so user might see that delete of the volume (for example a snapshot) was initiated. Since those are asynchronous tasks, audit log will be printed in a different period of time and a user might not be aware what is the relation of those specific delete.
Maybe we will need to use the correlation id of the Execution handler as Eli suggested or maybe add new states at CommandActionState?
On 08/14/2012 02:10 PM, Allon Mureinik wrote:
Hi guys,
Thanks for all your comments! The correct response for many these points is to update the wiki. I'm enclosing here the quick-and-dirty replies just to keep this thread alive, and will update the wiki shortly.
See inline.
----- Original Message -----
From: "Livnat Peer" <lpeer@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Sunday, August 12, 2012 9:39:23 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 10/08/12 03:40, Eli Mesika wrote:
----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram
Good idea, I'll see if I can jimmy something up.
+1, it would help understanding the flow.
- It looks like you chose not re-use/extend the ExecutionHandler (the entity used for building the tasks view exposed to the users). It might be a good idea to keep the separation between the engine Jobs and the underlying vdsm tasks, but I want to make sure you are familiar with this mechanism and ruled it out with a reason. If this is the case please share why you decided not to use it. As you said Jobs and Steps are pure engine entities - they can contain no VDSM tasks, one VDSM task, or plausibly, in the future, several tasks. Even /today/, AsyncTasks and Jobs/Steps are two different kinds of animals - I don't see any added value in mixing them together.
- how does this design survives a jboss restart? Can you please a section in the wiki to explain that.
Basically, the way as a Command does today - the task is saved with the executionIndex, and continues when the command is woken up. I'll clarify this point in the wiki.
-successful execution - * "CommandBase iterates over its SPMAsyncTaskHandlers" - when?
This is the new suggested format of executeCommand(). I'll clarify this too.
* If the second task is an HSM command (vs. SPM command), I think you should explain in the design how to handle such flows as well. HSM commands do not create AsyncTasks, as they do today - I will clarify this.
* Why do we need before task? can you give a concrete example of what would you do in such a method. Basically, /today/, command look like this: executeCommand() { doStuffInTheDB(); runVdsCommand(someCommand); }
endSuccessfully() { doMoreStuffInTheDB(); }
endWithFailure() { doMoreStuffForFailureInTheDB(); }
In the new design, the entire doStuffInTheDB() should be moved to a breforeTask of the (only) SPMAsyncTaskHandler.
- I see you added SPMAsyncTaskHandler, any reason not to use SPMAsyncTasK to manage it own life-cycle?
Conserving today's design - The SPMAsyncTaskHandler is the place to add additional, non-SPM, logic around the SPM task execution, like CommandBase allows today.
- In the life-cycle managed by the SPMAsyncTaskHandler there is a step 'createTask - how to create the async task' can you please elaborate what are the options.
new [any type of async task]
Livnat
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 08/16/2012 03:21 PM, Maor Lipchuk wrote:
On 08/14/2012 02:35 PM, Maor Lipchuk wrote:
How should we handle the auditLogMessages? Basically when a command ends it print an audit log.
When we will start to use multiple tasks I assume user might get a bulk of audit logs which are actually related to the same action (when we fail for example the process will be create and delete). It might be a bit confusing for the user not to know which action is related to the operation
I thought audit log gets written regardless of the transaction, so audit log appears "as they happen"? That is correct, The issue that I was referring to, is that now, with multiple tasks execution, we will get many audit logs which related to the same
On 08/14/2012 05:23 PM, Itamar Heim wrote: transaction but each one will be printed at a different time.
I think that it might be confusing for the user to relate each audit log to the operation that was started.
For example : User run an action that executes some tasks of create volumes, then the engine encounter a problem, and decide to rollback the operation and delete the volumes, in that case the engine will execute a delete task for the volumes, so user might see that delete of the volume (for example a snapshot) was initiated. Since those are asynchronous tasks, audit log will be printed in a different period of time and a user might not be aware what is the relation of those specific delete.
async doesn't mean we don't print an audit log when we start it, and when we end it. so user would get the starting audit log when the task failed in your example. of course this may happen 2 hours after they started the task. as long as we can correlate the audit log to be part of the same "job", i don't see the issue.
Maybe we will need to use the correlation id of the Execution handler as Eli suggested or maybe add new states at CommandActionState?
On 08/14/2012 02:10 PM, Allon Mureinik wrote:
Hi guys,
Thanks for all your comments! The correct response for many these points is to update the wiki. I'm enclosing here the quick-and-dirty replies just to keep this thread alive, and will update the wiki shortly.
See inline.
----- Original Message -----
From: "Livnat Peer" <lpeer@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Sunday, August 12, 2012 9:39:23 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 10/08/12 03:40, Eli Mesika wrote:
----- Original Message ----- > From: "Allon Mureinik" <amureini@redhat.com> > To: "engine-devel" <engine-devel@ovirt.org> > Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" > <ykaplan@redhat.com>, "Federico Simoncelli" > <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> > Sent: Thursday, August 9, 2012 6:41:09 PM > Subject: [Engine-devel] Serial Execution of Async Tasks > > Hi guys, > > As you may know the engine currently has the ability to fire an > SPM > task, and be asynchronously be "woken-up" when it ends. > This is great, but we found the for the Live Storage Migration > feature we need something a bit complex - the ability to have a > series of async tasks in a single control flow. > > Here's my initial design for this, your comments and criticism > would > be welcome: > http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram
Good idea, I'll see if I can jimmy something up.
+1, it would help understanding the flow.
- It looks like you chose not re-use/extend the ExecutionHandler (the entity used for building the tasks view exposed to the users). It might be a good idea to keep the separation between the engine Jobs and the underlying vdsm tasks, but I want to make sure you are familiar with this mechanism and ruled it out with a reason. If this is the case please share why you decided not to use it. As you said Jobs and Steps are pure engine entities - they can contain no VDSM tasks, one VDSM task, or plausibly, in the future, several tasks. Even /today/, AsyncTasks and Jobs/Steps are two different kinds of animals - I don't see any added value in mixing them together.
- how does this design survives a jboss restart? Can you please a section in the wiki to explain that.
Basically, the way as a Command does today - the task is saved with the executionIndex, and continues when the command is woken up. I'll clarify this point in the wiki.
-successful execution - * "CommandBase iterates over its SPMAsyncTaskHandlers" - when?
This is the new suggested format of executeCommand(). I'll clarify this too.
* If the second task is an HSM command (vs. SPM command), I think you should explain in the design how to handle such flows as well. HSM commands do not create AsyncTasks, as they do today - I will clarify this.
* Why do we need before task? can you give a concrete example of what would you do in such a method. Basically, /today/, command look like this: executeCommand() { doStuffInTheDB(); runVdsCommand(someCommand); }
endSuccessfully() { doMoreStuffInTheDB(); }
endWithFailure() { doMoreStuffForFailureInTheDB(); }
In the new design, the entire doStuffInTheDB() should be moved to a breforeTask of the (only) SPMAsyncTaskHandler.
- I see you added SPMAsyncTaskHandler, any reason not to use SPMAsyncTasK to manage it own life-cycle?
Conserving today's design - The SPMAsyncTaskHandler is the place to add additional, non-SPM, logic around the SPM task execution, like CommandBase allows today.
- In the life-cycle managed by the SPMAsyncTaskHandler there is a step 'createTask - how to create the async task' can you please elaborate what are the options.
new [any type of async task]
Livnat
> > > -Allon > _______________________________________________ > Engine-devel mailing list > Engine-devel@ovirt.org > http://lists.ovirt.org/mailman/listinfo/engine-devel > _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 08/16/2012 06:51 PM, Itamar Heim wrote:
On 08/16/2012 03:21 PM, Maor Lipchuk wrote:
On 08/14/2012 02:35 PM, Maor Lipchuk wrote:
How should we handle the auditLogMessages? Basically when a command ends it print an audit log.
When we will start to use multiple tasks I assume user might get a bulk of audit logs which are actually related to the same action (when we fail for example the process will be create and delete). It might be a bit confusing for the user not to know which action is related to the operation
I thought audit log gets written regardless of the transaction, so audit log appears "as they happen"? That is correct, The issue that I was referring to, is that now, with multiple tasks execution, we will get many audit logs which related to the same
On 08/14/2012 05:23 PM, Itamar Heim wrote: transaction but each one will be printed at a different time.
I think that it might be confusing for the user to relate each audit log to the operation that was started.
For example : User run an action that executes some tasks of create volumes, then the engine encounter a problem, and decide to rollback the operation and delete the volumes, in that case the engine will execute a delete task for the volumes, so user might see that delete of the volume (for example a snapshot) was initiated. Since those are asynchronous tasks, audit log will be printed in a different period of time and a user might not be aware what is the relation of those specific delete.
async doesn't mean we don't print an audit log when we start it, and when we end it. so user would get the starting audit log when the task failed in your example. of course this may happen 2 hours after they started the task. as long as we can correlate the audit log to be part of the same "job", i don't see the issue. yes, but if I understood correctly, we don't want to correlate the multiple tasks with the execution handler (which AFAIK handle the correlation id).
I assume this issue can be addressed in a future phase, but maybe it is an issue that might worth to think about.
Maybe we will need to use the correlation id of the Execution handler as Eli suggested or maybe add new states at CommandActionState?
On 08/14/2012 02:10 PM, Allon Mureinik wrote:
Hi guys,
Thanks for all your comments! The correct response for many these points is to update the wiki. I'm enclosing here the quick-and-dirty replies just to keep this thread alive, and will update the wiki shortly.
See inline.
----- Original Message -----
From: "Livnat Peer" <lpeer@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Sunday, August 12, 2012 9:39:23 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 10/08/12 03:40, Eli Mesika wrote: > > > ----- Original Message ----- >> From: "Allon Mureinik" <amureini@redhat.com> >> To: "engine-devel" <engine-devel@ovirt.org> >> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" >> <ykaplan@redhat.com>, "Federico Simoncelli" >> <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> >> Sent: Thursday, August 9, 2012 6:41:09 PM >> Subject: [Engine-devel] Serial Execution of Async Tasks >> >> Hi guys, >> >> As you may know the engine currently has the ability to fire an >> SPM >> task, and be asynchronously be "woken-up" when it ends. >> This is great, but we found the for the Live Storage Migration >> feature we need something a bit complex - the ability to have a >> series of async tasks in a single control flow. >> >> Here's my initial design for this, your comments and criticism >> would >> be welcome: >> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >> >> > > Apart from the short explanation & flow , since this is a detailed > design , I would add > 1) Class diagram > 2) Flow diagram Good idea, I'll see if I can jimmy something up.
>
+1, it would help understanding the flow.
- It looks like you chose not re-use/extend the ExecutionHandler (the entity used for building the tasks view exposed to the users). It might be a good idea to keep the separation between the engine Jobs and the underlying vdsm tasks, but I want to make sure you are familiar with this mechanism and ruled it out with a reason. If this is the case please share why you decided not to use it. As you said Jobs and Steps are pure engine entities - they can contain no VDSM tasks, one VDSM task, or plausibly, in the future, several tasks. Even /today/, AsyncTasks and Jobs/Steps are two different kinds of animals - I don't see any added value in mixing them together.
- how does this design survives a jboss restart? Can you please a section in the wiki to explain that.
Basically, the way as a Command does today - the task is saved with the executionIndex, and continues when the command is woken up. I'll clarify this point in the wiki.
-successful execution - * "CommandBase iterates over its SPMAsyncTaskHandlers" - when?
This is the new suggested format of executeCommand(). I'll clarify this too.
* If the second task is an HSM command (vs. SPM command), I think you should explain in the design how to handle such flows as well. HSM commands do not create AsyncTasks, as they do today - I will clarify this.
* Why do we need before task? can you give a concrete example of what would you do in such a method. Basically, /today/, command look like this: executeCommand() { doStuffInTheDB(); runVdsCommand(someCommand); }
endSuccessfully() { doMoreStuffInTheDB(); }
endWithFailure() { doMoreStuffForFailureInTheDB(); }
In the new design, the entire doStuffInTheDB() should be moved to a breforeTask of the (only) SPMAsyncTaskHandler.
- I see you added SPMAsyncTaskHandler, any reason not to use SPMAsyncTasK to manage it own life-cycle?
Conserving today's design - The SPMAsyncTaskHandler is the place to add additional, non-SPM, logic around the SPM task execution, like CommandBase allows today.
- In the life-cycle managed by the SPMAsyncTaskHandler there is a step 'createTask - how to create the async task' can you please elaborate what are the options.
new [any type of async task]
Livnat
>> >> >> -Allon >> _______________________________________________ >> Engine-devel mailing list >> Engine-devel@ovirt.org >> http://lists.ovirt.org/mailman/listinfo/engine-devel >> > _______________________________________________ > Engine-devel mailing list > Engine-devel@ovirt.org > http://lists.ovirt.org/mailman/listinfo/engine-devel >
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Maor Lipchuk" <mlipchuk@redhat.com> To: "Itamar Heim" <iheim@redhat.com> Cc: "Allon Mureinik" <amureini@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 16, 2012 8:27:33 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 08/16/2012 06:51 PM, Itamar Heim wrote:
On 08/16/2012 03:21 PM, Maor Lipchuk wrote:
On 08/14/2012 02:35 PM, Maor Lipchuk wrote:
How should we handle the auditLogMessages? Basically when a command ends it print an audit log.
When we will start to use multiple tasks I assume user might get a bulk of audit logs which are actually related to the same action (when we fail for example the process will be create and delete). It might be a bit confusing for the user not to know which action is related to the operation
I thought audit log gets written regardless of the transaction, so audit log appears "as they happen"? That is correct, The issue that I was referring to, is that now, with multiple tasks execution, we will get many audit logs which related to the same
On 08/14/2012 05:23 PM, Itamar Heim wrote: transaction but each one will be printed at a different time.
I think that it might be confusing for the user to relate each audit log to the operation that was started.
For example : User run an action that executes some tasks of create volumes, then the engine encounter a problem, and decide to rollback the operation and delete the volumes, in that case the engine will execute a delete task for the volumes, so user might see that delete of the volume (for example a snapshot) was initiated. Since those are asynchronous tasks, audit log will be printed in a different period of time and a user might not be aware what is the relation of those specific delete.
async doesn't mean we don't print an audit log when we start it, and when we end it. so user would get the starting audit log when the task failed in your example. of course this may happen 2 hours after they started the task. as long as we can correlate the audit log to be part of the same "job", i don't see the issue. yes, but if I understood correctly, we don't want to correlate the multiple tasks with the execution handler (which AFAIK handle the correlation id). I actually didn't mention this, but I don't see why not. What's I'd probably like to have is a log with "Correlation ID xyzabc, step #3 starting/executing/ending" Does this make any sense?
I assume this issue can be addressed in a future phase, but maybe it is an issue that might worth to think about.
Maybe we will need to use the correlation id of the Execution handler as Eli suggested or maybe add new states at CommandActionState?
On 08/14/2012 02:10 PM, Allon Mureinik wrote:
Hi guys,
Thanks for all your comments! The correct response for many these points is to update the wiki. I'm enclosing here the quick-and-dirty replies just to keep this thread alive, and will update the wiki shortly.
See inline.
----- Original Message ----- > From: "Livnat Peer" <lpeer@redhat.com> > To: "Allon Mureinik" <amureini@redhat.com> > Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" > <laravot@redhat.com>, "Federico Simoncelli" > <fsimonce@redhat.com>, "engine-devel" > <engine-devel@ovirt.org>, > "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela > Kaplan" <ykaplan@redhat.com> > Sent: Sunday, August 12, 2012 9:39:23 AM > Subject: Re: [Engine-devel] Serial Execution of Async Tasks > > On 10/08/12 03:40, Eli Mesika wrote: >> >> >> ----- Original Message ----- >>> From: "Allon Mureinik" <amureini@redhat.com> >>> To: "engine-devel" <engine-devel@ovirt.org> >>> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela >>> Kaplan" >>> <ykaplan@redhat.com>, "Federico Simoncelli" >>> <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> >>> Sent: Thursday, August 9, 2012 6:41:09 PM >>> Subject: [Engine-devel] Serial Execution of Async Tasks >>> >>> Hi guys, >>> >>> As you may know the engine currently has the ability to fire >>> an >>> SPM >>> task, and be asynchronously be "woken-up" when it ends. >>> This is great, but we found the for the Live Storage >>> Migration >>> feature we need something a bit complex - the ability to >>> have a >>> series of async tasks in a single control flow. >>> >>> Here's my initial design for this, your comments and >>> criticism >>> would >>> be welcome: >>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>> >>> >> >> Apart from the short explanation & flow , since this is a >> detailed >> design , I would add >> 1) Class diagram >> 2) Flow diagram Good idea, I'll see if I can jimmy something up.
>> > > +1, it would help understanding the flow. > > - It looks like you chose not re-use/extend the > ExecutionHandler (the > entity used for building the tasks view exposed to the users). > It might be a good idea to keep the separation between the > engine > Jobs > and the underlying vdsm tasks, but I want to make sure you are > familiar > with this mechanism and ruled it out with a reason. If this is > the > case > please share why you decided not to use it. As you said Jobs and Steps are pure engine entities - they can contain no VDSM tasks, one VDSM task, or plausibly, in the future, several tasks. Even /today/, AsyncTasks and Jobs/Steps are two different kinds of animals - I don't see any added value in mixing them together.
> > > - how does this design survives a jboss restart? Can you > please a > section in the wiki to explain that. Basically, the way as a Command does today - the task is saved with the executionIndex, and continues when the command is woken up. I'll clarify this point in the wiki.
> > -successful execution - > * "CommandBase iterates over its SPMAsyncTaskHandlers" - when? This is the new suggested format of executeCommand(). I'll clarify this too.
> * If the second task is an HSM command (vs. SPM command), I > think you > should explain in the design how to handle such flows as well. HSM commands do not create AsyncTasks, as they do today - I will clarify this.
> * Why do we need before task? can you give a concrete example > of what > would you do in such a method. Basically, /today/, command look like this: executeCommand() { doStuffInTheDB(); runVdsCommand(someCommand); }
endSuccessfully() { doMoreStuffInTheDB(); }
endWithFailure() { doMoreStuffForFailureInTheDB(); }
In the new design, the entire doStuffInTheDB() should be moved to a breforeTask of the (only) SPMAsyncTaskHandler.
> > - I see you added SPMAsyncTaskHandler, any reason not to use > SPMAsyncTasK to manage it own life-cycle? Conserving today's design - The SPMAsyncTaskHandler is the place to add additional, non-SPM, logic around the SPM task execution, like CommandBase allows today.
> > - In the life-cycle managed by the SPMAsyncTaskHandler there > is a > step > 'createTask - how to create the async task' can you please > elaborate > what are the options. new [any type of async task] > > > > > > Livnat > >>> >>> >>> -Allon >>> _______________________________________________ >>> Engine-devel mailing list >>> Engine-devel@ovirt.org >>> http://lists.ovirt.org/mailman/listinfo/engine-devel >>> >> _______________________________________________ >> Engine-devel mailing list >> Engine-devel@ovirt.org >> http://lists.ovirt.org/mailman/listinfo/engine-devel >> > > _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 08/22/2012 12:21 PM, Allon Mureinik wrote:
----- Original Message -----
From: "Maor Lipchuk" <mlipchuk@redhat.com> To: "Itamar Heim" <iheim@redhat.com> Cc: "Allon Mureinik" <amureini@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 16, 2012 8:27:33 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 08/16/2012 06:51 PM, Itamar Heim wrote:
On 08/16/2012 03:21 PM, Maor Lipchuk wrote:
On 08/14/2012 02:35 PM, Maor Lipchuk wrote:
How should we handle the auditLogMessages? Basically when a command ends it print an audit log.
When we will start to use multiple tasks I assume user might get a bulk of audit logs which are actually related to the same action (when we fail for example the process will be create and delete). It might be a bit confusing for the user not to know which action is related to the operation
I thought audit log gets written regardless of the transaction, so audit log appears "as they happen"? That is correct, The issue that I was referring to, is that now, with multiple tasks execution, we will get many audit logs which related to the same
On 08/14/2012 05:23 PM, Itamar Heim wrote: transaction but each one will be printed at a different time.
I think that it might be confusing for the user to relate each audit log to the operation that was started.
For example : User run an action that executes some tasks of create volumes, then the engine encounter a problem, and decide to rollback the operation and delete the volumes, in that case the engine will execute a delete task for the volumes, so user might see that delete of the volume (for example a snapshot) was initiated. Since those are asynchronous tasks, audit log will be printed in a different period of time and a user might not be aware what is the relation of those specific delete.
async doesn't mean we don't print an audit log when we start it, and when we end it. so user would get the starting audit log when the task failed in your example. of course this may happen 2 hours after they started the task. as long as we can correlate the audit log to be part of the same "job", i don't see the issue. yes, but if I understood correctly, we don't want to correlate the multiple tasks with the execution handler (which AFAIK handle the correlation id). I actually didn't mention this, but I don't see why not. What's I'd probably like to have is a log with "Correlation ID xyzabc, step #3 starting/executing/ending" Does this make any sense?
I think it is important to decide if correlation ID is also a "job id", or since correlation id can be controlled by user, for multiple steps over several commands (and maybe allowing clients to do multiple actions as a single transaction) we want a more formal "job id".
I assume this issue can be addressed in a future phase, but maybe it is an issue that might worth to think about.
Maybe we will need to use the correlation id of the Execution handler as Eli suggested or maybe add new states at CommandActionState?
On 08/14/2012 02:10 PM, Allon Mureinik wrote: > Hi guys, > > Thanks for all your comments! > The correct response for many these points is to update the > wiki. > I'm enclosing here the quick-and-dirty replies just to keep > this > thread alive, and will update the wiki shortly. > > See inline. > > ----- Original Message ----- >> From: "Livnat Peer" <lpeer@redhat.com> >> To: "Allon Mureinik" <amureini@redhat.com> >> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" >> <laravot@redhat.com>, "Federico Simoncelli" >> <fsimonce@redhat.com>, "engine-devel" >> <engine-devel@ovirt.org>, >> "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela >> Kaplan" <ykaplan@redhat.com> >> Sent: Sunday, August 12, 2012 9:39:23 AM >> Subject: Re: [Engine-devel] Serial Execution of Async Tasks >> >> On 10/08/12 03:40, Eli Mesika wrote: >>> >>> >>> ----- Original Message ----- >>>> From: "Allon Mureinik" <amureini@redhat.com> >>>> To: "engine-devel" <engine-devel@ovirt.org> >>>> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela >>>> Kaplan" >>>> <ykaplan@redhat.com>, "Federico Simoncelli" >>>> <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> >>>> Sent: Thursday, August 9, 2012 6:41:09 PM >>>> Subject: [Engine-devel] Serial Execution of Async Tasks >>>> >>>> Hi guys, >>>> >>>> As you may know the engine currently has the ability to fire >>>> an >>>> SPM >>>> task, and be asynchronously be "woken-up" when it ends. >>>> This is great, but we found the for the Live Storage >>>> Migration >>>> feature we need something a bit complex - the ability to >>>> have a >>>> series of async tasks in a single control flow. >>>> >>>> Here's my initial design for this, your comments and >>>> criticism >>>> would >>>> be welcome: >>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>>> >>>> >>> >>> Apart from the short explanation & flow , since this is a >>> detailed >>> design , I would add >>> 1) Class diagram >>> 2) Flow diagram > Good idea, I'll see if I can jimmy something up. > >>> >> >> +1, it would help understanding the flow. >> >> - It looks like you chose not re-use/extend the >> ExecutionHandler (the >> entity used for building the tasks view exposed to the users). >> It might be a good idea to keep the separation between the >> engine >> Jobs >> and the underlying vdsm tasks, but I want to make sure you are >> familiar >> with this mechanism and ruled it out with a reason. If this is >> the >> case >> please share why you decided not to use it. > As you said Jobs and Steps are pure engine entities - they can > contain no VDSM tasks, one VDSM task, or plausibly, in the > future, > several tasks. > Even /today/, AsyncTasks and Jobs/Steps are two different kinds > of > animals - I don't see any added value in mixing them together. > >> >> >> - how does this design survives a jboss restart? Can you >> please a >> section in the wiki to explain that. > Basically, the way as a Command does today - the task is saved > with > the executionIndex, and continues when the command is woken up. > I'll clarify this point in the wiki. > >> >> -successful execution - >> * "CommandBase iterates over its SPMAsyncTaskHandlers" - when? > This is the new suggested format of executeCommand(). I'll > clarify > this too. > >> * If the second task is an HSM command (vs. SPM command), I >> think you >> should explain in the design how to handle such flows as well. > HSM commands do not create AsyncTasks, as they do today - I > will > clarify this. > >> * Why do we need before task? can you give a concrete example >> of what >> would you do in such a method. > Basically, /today/, command look like this: > executeCommand() { > doStuffInTheDB(); > runVdsCommand(someCommand); > } > > endSuccessfully() { > doMoreStuffInTheDB(); > } > > endWithFailure() { > doMoreStuffForFailureInTheDB(); > } > > In the new design, the entire doStuffInTheDB() should be moved > to a > breforeTask of the (only) SPMAsyncTaskHandler. > >> >> - I see you added SPMAsyncTaskHandler, any reason not to use >> SPMAsyncTasK to manage it own life-cycle? > Conserving today's design - The SPMAsyncTaskHandler is the > place to > add additional, non-SPM, logic around the SPM task execution, > like > CommandBase allows today. > >> >> - In the life-cycle managed by the SPMAsyncTaskHandler there >> is a >> step >> 'createTask - how to create the async task' can you please >> elaborate >> what are the options. > new [any type of async task] >> >> >> >> >> >> Livnat >> >>>> >>>> >>>> -Allon >>>> _______________________________________________ >>>> Engine-devel mailing list >>>> Engine-devel@ovirt.org >>>> http://lists.ovirt.org/mailman/listinfo/engine-devel >>>> >>> _______________________________________________ >>> Engine-devel mailing list >>> Engine-devel@ovirt.org >>> http://lists.ovirt.org/mailman/listinfo/engine-devel >>> >> >> > _______________________________________________ > Engine-devel mailing list > Engine-devel@ovirt.org > http://lists.ovirt.org/mailman/listinfo/engine-devel >
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 08/22/2012 12:21 PM, Allon Mureinik wrote:
----- Original Message -----
From: "Maor Lipchuk" <mlipchuk@redhat.com> To: "Itamar Heim" <iheim@redhat.com> Cc: "Allon Mureinik" <amureini@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 16, 2012 8:27:33 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 08/16/2012 06:51 PM, Itamar Heim wrote:
On 08/16/2012 03:21 PM, Maor Lipchuk wrote:
On 08/14/2012 02:35 PM, Maor Lipchuk wrote:
How should we handle the auditLogMessages? Basically when a command ends it print an audit log.
When we will start to use multiple tasks I assume user might get a bulk of audit logs which are actually related to the same action (when we fail for example the process will be create and delete). It might be a bit confusing for the user not to know which action is related to the operation
I thought audit log gets written regardless of the transaction, so audit log appears "as they happen"? That is correct, The issue that I was referring to, is that now, with multiple tasks execution, we will get many audit logs which related to the same
On 08/14/2012 05:23 PM, Itamar Heim wrote: transaction but each one will be printed at a different time.
I think that it might be confusing for the user to relate each audit log to the operation that was started.
For example : User run an action that executes some tasks of create volumes, then the engine encounter a problem, and decide to rollback the operation and delete the volumes, in that case the engine will execute a delete task for the volumes, so user might see that delete of the volume (for example a snapshot) was initiated. Since those are asynchronous tasks, audit log will be printed in a different period of time and a user might not be aware what is the relation of those specific delete.
async doesn't mean we don't print an audit log when we start it, and when we end it. so user would get the starting audit log when the task failed in your example. of course this may happen 2 hours after they started the task. as long as we can correlate the audit log to be part of the same "job", i don't see the issue. yes, but if I understood correctly, we don't want to correlate the multiple tasks with the execution handler (which AFAIK handle the correlation id). I actually didn't mention this, but I don't see why not. What's I'd probably like to have is a log with "Correlation ID xyzabc, step #3 starting/executing/ending" Does this make any sense?
Sound's great to me.
I assume this issue can be addressed in a future phase, but maybe it is an issue that might worth to think about.
Maybe we will need to use the correlation id of the Execution handler as Eli suggested or maybe add new states at CommandActionState?
On 08/14/2012 02:10 PM, Allon Mureinik wrote: > Hi guys, > > Thanks for all your comments! > The correct response for many these points is to update the > wiki. > I'm enclosing here the quick-and-dirty replies just to keep > this > thread alive, and will update the wiki shortly. > > See inline. > > ----- Original Message ----- >> From: "Livnat Peer" <lpeer@redhat.com> >> To: "Allon Mureinik" <amureini@redhat.com> >> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" >> <laravot@redhat.com>, "Federico Simoncelli" >> <fsimonce@redhat.com>, "engine-devel" >> <engine-devel@ovirt.org>, >> "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela >> Kaplan" <ykaplan@redhat.com> >> Sent: Sunday, August 12, 2012 9:39:23 AM >> Subject: Re: [Engine-devel] Serial Execution of Async Tasks >> >> On 10/08/12 03:40, Eli Mesika wrote: >>> >>> >>> ----- Original Message ----- >>>> From: "Allon Mureinik" <amureini@redhat.com> >>>> To: "engine-devel" <engine-devel@ovirt.org> >>>> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela >>>> Kaplan" >>>> <ykaplan@redhat.com>, "Federico Simoncelli" >>>> <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> >>>> Sent: Thursday, August 9, 2012 6:41:09 PM >>>> Subject: [Engine-devel] Serial Execution of Async Tasks >>>> >>>> Hi guys, >>>> >>>> As you may know the engine currently has the ability to fire >>>> an >>>> SPM >>>> task, and be asynchronously be "woken-up" when it ends. >>>> This is great, but we found the for the Live Storage >>>> Migration >>>> feature we need something a bit complex - the ability to >>>> have a >>>> series of async tasks in a single control flow. >>>> >>>> Here's my initial design for this, your comments and >>>> criticism >>>> would >>>> be welcome: >>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>>> >>>> >>> >>> Apart from the short explanation & flow , since this is a >>> detailed >>> design , I would add >>> 1) Class diagram >>> 2) Flow diagram > Good idea, I'll see if I can jimmy something up. > >>> >> >> +1, it would help understanding the flow. >> >> - It looks like you chose not re-use/extend the >> ExecutionHandler (the >> entity used for building the tasks view exposed to the users). >> It might be a good idea to keep the separation between the >> engine >> Jobs >> and the underlying vdsm tasks, but I want to make sure you are >> familiar >> with this mechanism and ruled it out with a reason. If this is >> the >> case >> please share why you decided not to use it. > As you said Jobs and Steps are pure engine entities - they can > contain no VDSM tasks, one VDSM task, or plausibly, in the > future, > several tasks. > Even /today/, AsyncTasks and Jobs/Steps are two different kinds > of > animals - I don't see any added value in mixing them together. > >> >> >> - how does this design survives a jboss restart? Can you >> please a >> section in the wiki to explain that. > Basically, the way as a Command does today - the task is saved > with > the executionIndex, and continues when the command is woken up. > I'll clarify this point in the wiki. > >> >> -successful execution - >> * "CommandBase iterates over its SPMAsyncTaskHandlers" - when? > This is the new suggested format of executeCommand(). I'll > clarify > this too. > >> * If the second task is an HSM command (vs. SPM command), I >> think you >> should explain in the design how to handle such flows as well. > HSM commands do not create AsyncTasks, as they do today - I > will > clarify this. > >> * Why do we need before task? can you give a concrete example >> of what >> would you do in such a method. > Basically, /today/, command look like this: > executeCommand() { > doStuffInTheDB(); > runVdsCommand(someCommand); > } > > endSuccessfully() { > doMoreStuffInTheDB(); > } > > endWithFailure() { > doMoreStuffForFailureInTheDB(); > } > > In the new design, the entire doStuffInTheDB() should be moved > to a > breforeTask of the (only) SPMAsyncTaskHandler. > >> >> - I see you added SPMAsyncTaskHandler, any reason not to use >> SPMAsyncTasK to manage it own life-cycle? > Conserving today's design - The SPMAsyncTaskHandler is the > place to > add additional, non-SPM, logic around the SPM task execution, > like > CommandBase allows today. > >> >> - In the life-cycle managed by the SPMAsyncTaskHandler there >> is a >> step >> 'createTask - how to create the async task' can you please >> elaborate >> what are the options. > new [any type of async task] >> >> >> >> >> >> Livnat >> >>>> >>>> >>>> -Allon >>>> _______________________________________________ >>>> Engine-devel mailing list >>>> Engine-devel@ovirt.org >>>> http://lists.ovirt.org/mailman/listinfo/engine-devel >>>> >>> _______________________________________________ >>> Engine-devel mailing list >>> Engine-devel@ovirt.org >>> http://lists.ovirt.org/mailman/listinfo/engine-devel >>> >> >> > _______________________________________________ > Engine-devel mailing list > Engine-devel@ovirt.org > http://lists.ovirt.org/mailman/listinfo/engine-devel >
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

>>>> Hi guys, >>>> >>>> As you may know the engine currently has the ability to fire >>>> an >>>> SPM >>>> task, and be asynchronously be "woken-up" when it ends. >>>> This is great, but we found the for the Live Storage >>>> Migration >>>> feature we need something a bit complex - the ability to >>>> have a >>>> series of async tasks in a single control flow. >>>> >>>> Here's my initial design for this, your comments and >>>> criticism >>>> would >>>> be welcome: >>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >> -successful execution - >> * "CommandBase iterates over its SPMAsyncTaskHandlers" - when? > This is the new suggested format of executeCommand(). I'll > clarify > this too. > >> * If the second task is an HSM command (vs. SPM command), I >> think you >> should explain in the design how to handle such flows as well. > HSM commands do not create AsyncTasks, as they do today - I > will > clarify this. > >> * Why do we need before task? can you give a concrete example >> of what >> would you do in such a method. > Basically, /today/, command look like this: > executeCommand() { > doStuffInTheDB(); > runVdsCommand(someCommand); > } > > endSuccessfully() { > doMoreStuffInTheDB(); > } > > endWithFailure() { > doMoreStuffForFailureInTheDB(); > } > > In the new design, the entire doStuffInTheDB() should be moved > to a > breforeTask of the (only) SPMAsyncTaskHandler. > >> >> - I see you added SPMAsyncTaskHandler, any reason not to use >> SPMAsyncTasK to manage it own life-cycle? > Conserving today's design - The SPMAsyncTaskHandler is the > place to > add additional, non-SPM, logic around the SPM task execution, > like > CommandBase allows today. > >> >> - In the life-cycle managed by the SPMAsyncTaskHandler there >> is a >> step >> 'createTask - how to create the async task' can you please >> elaborate >> what are the options. > new [any type of async task]
(I cleaned thread a little.) The following design and it is implementation http://gerrit.ovirt.org/#/c/7956/ is bad. I don't see any reason for creating a new SPMAsyncTaskHandler and especially in the way as it's done in patch. The reason are following: 1. Performance , increased memory footprint, created CYCLIC REFERENCE. 2. Readability and robust of code: the code which is written as cyclic references is unreadable and difficult for debug. 3. Why I need a generic implementation and changes all over whole project because of series of async commands, for me it is a private case?

----- Original Message -----
From: "Michael Kublin" <mkublin@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Maor Lipchuk" <mlipchuk@redhat.com>, "engine-devel" <engine-devel@ovirt.org> Sent: Sunday, September 23, 2012 12:41:05 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
>>>>> Hi guys, >>>>> >>>>> As you may know the engine currently has the ability to >>>>> fire >>>>> an >>>>> SPM >>>>> task, and be asynchronously be "woken-up" when it ends. >>>>> This is great, but we found the for the Live Storage >>>>> Migration >>>>> feature we need something a bit complex - the ability to >>>>> have a >>>>> series of async tasks in a single control flow. >>>>> >>>>> Here's my initial design for this, your comments and >>>>> criticism >>>>> would >>>>> be welcome: >>>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>> -successful execution - >>> * "CommandBase iterates over its SPMAsyncTaskHandlers" - >>> when? >> This is the new suggested format of executeCommand(). I'll >> clarify >> this too. >> >>> * If the second task is an HSM command (vs. SPM command), I >>> think you >>> should explain in the design how to handle such flows as >>> well. >> HSM commands do not create AsyncTasks, as they do today - I >> will >> clarify this. >> >>> * Why do we need before task? can you give a concrete >>> example >>> of what >>> would you do in such a method. >> Basically, /today/, command look like this: >> executeCommand() { >> doStuffInTheDB(); >> runVdsCommand(someCommand); >> } >> >> endSuccessfully() { >> doMoreStuffInTheDB(); >> } >> >> endWithFailure() { >> doMoreStuffForFailureInTheDB(); >> } >> >> In the new design, the entire doStuffInTheDB() should be >> moved >> to a >> breforeTask of the (only) SPMAsyncTaskHandler. >> >>> >>> - I see you added SPMAsyncTaskHandler, any reason not to use >>> SPMAsyncTasK to manage it own life-cycle? >> Conserving today's design - The SPMAsyncTaskHandler is the >> place to >> add additional, non-SPM, logic around the SPM task execution, >> like >> CommandBase allows today. >> >>> >>> - In the life-cycle managed by the SPMAsyncTaskHandler there >>> is a >>> step >>> 'createTask - how to create the async task' can you please >>> elaborate >>> what are the options. >> new [any type of async task]
(I cleaned thread a little.) The following design and it is implementation http://gerrit.ovirt.org/#/c/7956/ is bad. I don't see any reason for creating a new SPMAsyncTaskHandler and especially in the way as it's done in patch. The reason are following: 1. Performance , increased memory footprint, created CYCLIC REFERENCE. 2. Readability and robust of code: the code which is written as cyclic references is unreadable and difficult for debug. 3. Why I need a generic implementation and changes all over whole project because of series of async commands, for me it is a private case? This will occur all over the storage commands (which are the only usages of tasks nowadys). Moreover, async task handling is done at the Commandbase level (see the end* methods) - instead of hacking it in X different places whenever we need it, I'd prefer doing it once, properly.

----- Original Message -----
----- Original Message -----
From: "Michael Kublin" <mkublin@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Maor Lipchuk" <mlipchuk@redhat.com>, "engine-devel" <engine-devel@ovirt.org> Sent: Sunday, September 23, 2012 12:41:05 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
>>>>>> Hi guys, >>>>>> >>>>>> As you may know the engine currently has the ability to >>>>>> fire >>>>>> an >>>>>> SPM >>>>>> task, and be asynchronously be "woken-up" when it ends. >>>>>> This is great, but we found the for the Live Storage >>>>>> Migration >>>>>> feature we need something a bit complex - the ability to >>>>>> have a >>>>>> series of async tasks in a single control flow. >>>>>> >>>>>> Here's my initial design for this, your comments and >>>>>> criticism >>>>>> would >>>>>> be welcome: >>>>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>>> -successful execution - >>>> * "CommandBase iterates over its SPMAsyncTaskHandlers" - >>>> when? >>> This is the new suggested format of executeCommand(). I'll >>> clarify >>> this too. >>> >>>> * If the second task is an HSM command (vs. SPM command), >>>> I >>>> think you >>>> should explain in the design how to handle such flows as >>>> well. >>> HSM commands do not create AsyncTasks, as they do today - I >>> will >>> clarify this. >>> >>>> * Why do we need before task? can you give a concrete >>>> example >>>> of what >>>> would you do in such a method. >>> Basically, /today/, command look like this: >>> executeCommand() { >>> doStuffInTheDB(); >>> runVdsCommand(someCommand); >>> } >>> >>> endSuccessfully() { >>> doMoreStuffInTheDB(); >>> } >>> >>> endWithFailure() { >>> doMoreStuffForFailureInTheDB(); >>> } >>> >>> In the new design, the entire doStuffInTheDB() should be >>> moved >>> to a >>> breforeTask of the (only) SPMAsyncTaskHandler. >>> >>>> >>>> - I see you added SPMAsyncTaskHandler, any reason not to >>>> use >>>> SPMAsyncTasK to manage it own life-cycle? >>> Conserving today's design - The SPMAsyncTaskHandler is the >>> place to >>> add additional, non-SPM, logic around the SPM task >>> execution, >>> like >>> CommandBase allows today. >>> >>>> >>>> - In the life-cycle managed by the SPMAsyncTaskHandler >>>> there >>>> is a >>>> step >>>> 'createTask - how to create the async task' can you please >>>> elaborate >>>> what are the options. >>> new [any type of async task]
(I cleaned thread a little.) The following design and it is implementation http://gerrit.ovirt.org/#/c/7956/ is bad. I don't see any reason for creating a new SPMAsyncTaskHandler and especially in the way as it's done in patch. The reason are following: 1. Performance , increased memory footprint, created CYCLIC REFERENCE. 2. Readability and robust of code: the code which is written as cyclic references is unreadable and difficult for debug. 3. Why I need a generic implementation and changes all over whole project because of series of async commands, for me it is a private case?
What is the private case here exactly? Every task can have multiple jobs. We've identified several such places (e.g. live storage migration, move disk, move vm) and I have no doubt more will popup. As Allon notes below, task handling is done at CommandBase, if you think task management should be for storage only, you're welcome to push it down to StorageHandlingCommandBase (or get rid of inheritance here altogether).
This will occur all over the storage commands (which are the only usages of tasks nowadys). Moreover, async task handling is done at the Commandbase level (see the end* methods) - instead of hacking it in X different places whenever we need it, I'd prefer doing it once, properly.
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message ----- > From: "Ayal Baron" <abaron@redhat.com> > To: "Allon Mureinik" <amureini@redhat.com>, "Michael Kublin" <mkublin@redhat.com> > Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" > <ewarszaw@redhat.com> > Sent: Sunday, September 23, 2012 1:10:07 PM > Subject: Re: [Engine-devel] Serial Execution of Async Tasks > > > > ----- Original Message ----- > > > > > > ----- Original Message ----- > > > From: "Michael Kublin" <mkublin@redhat.com> > > > To: "Allon Mureinik" <amureini@redhat.com> > > > Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Liron Aravot" > > > <laravot@redhat.com>, "Maor Lipchuk" > > > <mlipchuk@redhat.com>, "engine-devel" <engine-devel@ovirt.org> > > > Sent: Sunday, September 23, 2012 12:41:05 PM > > > Subject: Re: [Engine-devel] Serial Execution of Async Tasks > > > > > > > > > >>>>>>>>>> Hi guys, > > > >>>>>>>>>> > > > >>>>>>>>>> As you may know the engine currently has the ability > > > >>>>>>>>>> to > > > >>>>>>>>>> fire > > > >>>>>>>>>> an > > > >>>>>>>>>> SPM > > > >>>>>>>>>> task, and be asynchronously be "woken-up" when it > > > >>>>>>>>>> ends. > > > >>>>>>>>>> This is great, but we found the for the Live Storage > > > >>>>>>>>>> Migration > > > >>>>>>>>>> feature we need something a bit complex - the ability > > > >>>>>>>>>> to > > > >>>>>>>>>> have a > > > >>>>>>>>>> series of async tasks in a single control flow. > > > >>>>>>>>>> > > > >>>>>>>>>> Here's my initial design for this, your comments and > > > >>>>>>>>>> criticism > > > >>>>>>>>>> would > > > >>>>>>>>>> be welcome: > > > >>>>>>>>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_Detailed_Design > > > >>>>>>>> -successful execution - > > > >>>>>>>> * "CommandBase iterates over its SPMAsyncTaskHandlers" - > > > >>>>>>>> when? > > > >>>>>>> This is the new suggested format of executeCommand(). > > > >>>>>>> I'll > > > >>>>>>> clarify > > > >>>>>>> this too. > > > >>>>>>> > > > >>>>>>>> * If the second task is an HSM command (vs. SPM > > > >>>>>>>> command), > > > >>>>>>>> I > > > >>>>>>>> think you > > > >>>>>>>> should explain in the design how to handle such flows as > > > >>>>>>>> well. > > > >>>>>>> HSM commands do not create AsyncTasks, as they do today - > > > >>>>>>> I > > > >>>>>>> will > > > >>>>>>> clarify this. > > > >>>>>>> > > > >>>>>>>> * Why do we need before task? can you give a concrete > > > >>>>>>>> example > > > >>>>>>>> of what > > > >>>>>>>> would you do in such a method. > > > >>>>>>> Basically, /today/, command look like this: > > > >>>>>>> executeCommand() { > > > >>>>>>> doStuffInTheDB(); > > > >>>>>>> runVdsCommand(someCommand); > > > >>>>>>> } > > > >>>>>>> > > > >>>>>>> endSuccessfully() { > > > >>>>>>> doMoreStuffInTheDB(); > > > >>>>>>> } > > > >>>>>>> > > > >>>>>>> endWithFailure() { > > > >>>>>>> doMoreStuffForFailureInTheDB(); > > > >>>>>>> } > > > >>>>>>> > > > >>>>>>> In the new design, the entire doStuffInTheDB() should be > > > >>>>>>> moved > > > >>>>>>> to a > > > >>>>>>> breforeTask of the (only) SPMAsyncTaskHandler. > > > >>>>>>> > > > >>>>>>>> > > > >>>>>>>> - I see you added SPMAsyncTaskHandler, any reason not to > > > >>>>>>>> use > > > >>>>>>>> SPMAsyncTasK to manage it own life-cycle? > > > >>>>>>> Conserving today's design - The SPMAsyncTaskHandler is > > > >>>>>>> the > > > >>>>>>> place to > > > >>>>>>> add additional, non-SPM, logic around the SPM task > > > >>>>>>> execution, > > > >>>>>>> like > > > >>>>>>> CommandBase allows today. > > > >>>>>>> > > > >>>>>>>> > > > >>>>>>>> - In the life-cycle managed by the SPMAsyncTaskHandler > > > >>>>>>>> there > > > >>>>>>>> is a > > > >>>>>>>> step > > > >>>>>>>> 'createTask - how to create the async task' can you > > > >>>>>>>> please > > > >>>>>>>> elaborate > > > >>>>>>>> what are the options. > > > >>>>>>> new [any type of async task] > > > > > > (I cleaned thread a little.) > > > The following design and it is implementation > > > http://gerrit.ovirt.org/#/c/7956/ > > > is bad. > > > I don't see any reason for creating a new SPMAsyncTaskHandler and > > > especially in the > > > way as it's done in patch. > > > The reason are following: > > > 1. Performance , increased memory footprint, created CYCLIC > > > REFERENCE. > > > 2. Readability and robust of code: the code which is written as > > > cyclic references is unreadable > > > and difficult for debug. > > > 3. Why I need a generic implementation and changes all over whole > > > project because of > > > series of async commands, for me it is a private case? > > What is the private case here exactly? > Every task can have multiple jobs. We've identified several such > places (e.g. live storage migration, move disk, move vm) and I have > no doubt more will popup. > As Allon notes below, task handling is done at CommandBase, if you > think task management should be for storage only, you're welcome to > push it down to StorageHandlingCommandBase (or get rid of > inheritance here altogether). Interesting , regards cyclic reference no response, but who cares, it is difficult to answer , that's why better not to response? Regards private case: 1. We have command that not creating any task 2. We have command that will create a one task. 3. And we have 3 commands meanwhile which will create more than one task. I think that 3 is private case and not common? (In the future, I removed too many lines of code that were preparation for future that never come) The handling done at CommandBase it means that it is influence all system. Now regards architecture why I need some handler which will be inside a command and will call for command methods? Please explain. > > This will occur all over the storage commands (which are the only > > usages of tasks nowadys). > > Moreover, async task handling is done at the Commandbase level (see > > the end* methods) - instead of hacking it in X different places > > whenever we need it, I'd prefer doing it once, properly. > > > > > > > > _______________________________________________ > > Engine-devel mailing list > > Engine-devel@ovirt.org > > http://lists.ovirt.org/mailman/listinfo/engine-devel > > >

----- Original Message -----
----- Original Message -----
From: "Ayal Baron" <abaron@redhat.com> To: "Allon Mureinik" <amureini@redhat.com>, "Michael Kublin" <mkublin@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com> Sent: Sunday, September 23, 2012 1:10:07 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
----- Original Message -----
From: "Michael Kublin" <mkublin@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Maor Lipchuk" <mlipchuk@redhat.com>, "engine-devel" <engine-devel@ovirt.org> Sent: Sunday, September 23, 2012 12:41:05 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
>>>>>>>> Hi guys, >>>>>>>> >>>>>>>> As you may know the engine currently has the ability >>>>>>>> to >>>>>>>> fire >>>>>>>> an >>>>>>>> SPM >>>>>>>> task, and be asynchronously be "woken-up" when it >>>>>>>> ends. >>>>>>>> This is great, but we found the for the Live Storage >>>>>>>> Migration >>>>>>>> feature we need something a bit complex - the >>>>>>>> ability >>>>>>>> to >>>>>>>> have a >>>>>>>> series of async tasks in a single control flow. >>>>>>>> >>>>>>>> Here's my initial design for this, your comments and >>>>>>>> criticism >>>>>>>> would >>>>>>>> be welcome: >>>>>>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>>>>> -successful execution - >>>>>> * "CommandBase iterates over its SPMAsyncTaskHandlers" >>>>>> - >>>>>> when? >>>>> This is the new suggested format of executeCommand(). >>>>> I'll >>>>> clarify >>>>> this too. >>>>> >>>>>> * If the second task is an HSM command (vs. SPM >>>>>> command), >>>>>> I >>>>>> think you >>>>>> should explain in the design how to handle such flows >>>>>> as >>>>>> well. >>>>> HSM commands do not create AsyncTasks, as they do today >>>>> - >>>>> I >>>>> will >>>>> clarify this. >>>>> >>>>>> * Why do we need before task? can you give a concrete >>>>>> example >>>>>> of what >>>>>> would you do in such a method. >>>>> Basically, /today/, command look like this: >>>>> executeCommand() { >>>>> doStuffInTheDB(); >>>>> runVdsCommand(someCommand); >>>>> } >>>>> >>>>> endSuccessfully() { >>>>> doMoreStuffInTheDB(); >>>>> } >>>>> >>>>> endWithFailure() { >>>>> doMoreStuffForFailureInTheDB(); >>>>> } >>>>> >>>>> In the new design, the entire doStuffInTheDB() should >>>>> be >>>>> moved >>>>> to a >>>>> breforeTask of the (only) SPMAsyncTaskHandler. >>>>> >>>>>> >>>>>> - I see you added SPMAsyncTaskHandler, any reason not >>>>>> to >>>>>> use >>>>>> SPMAsyncTasK to manage it own life-cycle? >>>>> Conserving today's design - The SPMAsyncTaskHandler is >>>>> the >>>>> place to >>>>> add additional, non-SPM, logic around the SPM task >>>>> execution, >>>>> like >>>>> CommandBase allows today. >>>>> >>>>>> >>>>>> - In the life-cycle managed by the SPMAsyncTaskHandler >>>>>> there >>>>>> is a >>>>>> step >>>>>> 'createTask - how to create the async task' can you >>>>>> please >>>>>> elaborate >>>>>> what are the options. >>>>> new [any type of async task]
(I cleaned thread a little.) The following design and it is implementation http://gerrit.ovirt.org/#/c/7956/ is bad. I don't see any reason for creating a new SPMAsyncTaskHandler and especially in the way as it's done in patch. The reason are following: 1. Performance , increased memory footprint, created CYCLIC REFERENCE. 2. Readability and robust of code: the code which is written as cyclic references is unreadable and difficult for debug. 3. Why I need a generic implementation and changes all over whole project because of series of async commands, for me it is a private case?
What is the private case here exactly? Every task can have multiple jobs. We've identified several such places (e.g. live storage migration, move disk, move vm) and I have no doubt more will popup. As Allon notes below, task handling is done at CommandBase, if you think task management should be for storage only, you're welcome to push it down to StorageHandlingCommandBase (or get rid of inheritance here altogether). Interesting , regards cyclic reference no response, but who cares, it is difficult to answer , that's why better not to response?
There is no problem with cyclic references in general, GCs know how to deal with these just fine and in this case it's limited to the command and its handlers. I did not reply, however, as I do not feel strongly about this.
Regards private case: 1. We have command that not creating any task 2. We have command that will create a one task. 3. And we have 3 commands meanwhile which will create more than one task. I think that 3 is private case and not common? (In the future, I
once happens twice is a coincidence three times is a method But if you insist on more then it's easy enough. We've discussed many times in the past that we need to change many of the storage verbs to run asynchronously (e.g. createStorageDomain) once this happens then existing flows would have to run multiple async tasks serially.
removed too many lines of code that were preparation for future that never come)
This is not in preparation for the future, it is for a feature we're working on right now (live storage migration) and for fixing move disk on which we have several bugs pending.
The handling done at CommandBase it means that it is influence all system.
That is how the task management was done. Again, if you feel it should only affect storage flows, feel free to push it down into StorageCommandHandlingBase and then only storage verbs will have task management.
Now regards architecture why I need some handler which will be inside a command and will call for command methods? Please explain.
As opposed to what?
This will occur all over the storage commands (which are the only usages of tasks nowadys). Moreover, async task handling is done at the Commandbase level (see the end* methods) - instead of hacking it in X different places whenever we need it, I'd prefer doing it once, properly.
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Ayal Baron" <abaron@redhat.com> To: "Michael Kublin" <mkublin@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Allon Mureinik" <amureini@redhat.com> Sent: Sunday, September 23, 2012 5:27:54 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
----- Original Message -----
From: "Ayal Baron" <abaron@redhat.com> To: "Allon Mureinik" <amureini@redhat.com>, "Michael Kublin" <mkublin@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com> Sent: Sunday, September 23, 2012 1:10:07 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
----- Original Message -----
From: "Michael Kublin" <mkublin@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Maor Lipchuk" <mlipchuk@redhat.com>, "engine-devel" <engine-devel@ovirt.org> Sent: Sunday, September 23, 2012 12:41:05 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
>>>>>>>>> Hi guys, >>>>>>>>> >>>>>>>>> As you may know the engine currently has the >>>>>>>>> ability >>>>>>>>> to >>>>>>>>> fire >>>>>>>>> an >>>>>>>>> SPM >>>>>>>>> task, and be asynchronously be "woken-up" when it >>>>>>>>> ends. >>>>>>>>> This is great, but we found the for the Live >>>>>>>>> Storage >>>>>>>>> Migration >>>>>>>>> feature we need something a bit complex - the >>>>>>>>> ability >>>>>>>>> to >>>>>>>>> have a >>>>>>>>> series of async tasks in a single control flow. >>>>>>>>> >>>>>>>>> Here's my initial design for this, your comments >>>>>>>>> and >>>>>>>>> criticism >>>>>>>>> would >>>>>>>>> be welcome: >>>>>>>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>>>>>> -successful execution - >>>>>>> * "CommandBase iterates over its >>>>>>> SPMAsyncTaskHandlers" >>>>>>> - >>>>>>> when? >>>>>> This is the new suggested format of executeCommand(). >>>>>> I'll >>>>>> clarify >>>>>> this too. >>>>>> >>>>>>> * If the second task is an HSM command (vs. SPM >>>>>>> command), >>>>>>> I >>>>>>> think you >>>>>>> should explain in the design how to handle such >>>>>>> flows >>>>>>> as >>>>>>> well. >>>>>> HSM commands do not create AsyncTasks, as they do >>>>>> today >>>>>> - >>>>>> I >>>>>> will >>>>>> clarify this. >>>>>> >>>>>>> * Why do we need before task? can you give a >>>>>>> concrete >>>>>>> example >>>>>>> of what >>>>>>> would you do in such a method. >>>>>> Basically, /today/, command look like this: >>>>>> executeCommand() { >>>>>> doStuffInTheDB(); >>>>>> runVdsCommand(someCommand); >>>>>> } >>>>>> >>>>>> endSuccessfully() { >>>>>> doMoreStuffInTheDB(); >>>>>> } >>>>>> >>>>>> endWithFailure() { >>>>>> doMoreStuffForFailureInTheDB(); >>>>>> } >>>>>> >>>>>> In the new design, the entire doStuffInTheDB() should >>>>>> be >>>>>> moved >>>>>> to a >>>>>> breforeTask of the (only) SPMAsyncTaskHandler. >>>>>> >>>>>>> >>>>>>> - I see you added SPMAsyncTaskHandler, any reason >>>>>>> not >>>>>>> to >>>>>>> use >>>>>>> SPMAsyncTasK to manage it own life-cycle? >>>>>> Conserving today's design - The SPMAsyncTaskHandler >>>>>> is >>>>>> the >>>>>> place to >>>>>> add additional, non-SPM, logic around the SPM task >>>>>> execution, >>>>>> like >>>>>> CommandBase allows today. >>>>>> >>>>>>> >>>>>>> - In the life-cycle managed by the >>>>>>> SPMAsyncTaskHandler >>>>>>> there >>>>>>> is a >>>>>>> step >>>>>>> 'createTask - how to create the async task' can you >>>>>>> please >>>>>>> elaborate >>>>>>> what are the options. >>>>>> new [any type of async task]
(I cleaned thread a little.) The following design and it is implementation http://gerrit.ovirt.org/#/c/7956/ is bad. I don't see any reason for creating a new SPMAsyncTaskHandler and especially in the way as it's done in patch. The reason are following: 1. Performance , increased memory footprint, created CYCLIC REFERENCE. 2. Readability and robust of code: the code which is written as cyclic references is unreadable and difficult for debug. 3. Why I need a generic implementation and changes all over whole project because of series of async commands, for me it is a private case?
What is the private case here exactly? Every task can have multiple jobs. We've identified several such places (e.g. live storage migration, move disk, move vm) and I have no doubt more will popup. As Allon notes below, task handling is done at CommandBase, if you think task management should be for storage only, you're welcome to push it down to StorageHandlingCommandBase (or get rid of inheritance here altogether). Interesting , regards cyclic reference no response, but who cares, it is difficult to answer , that's why better not to response?
There is no problem with cyclic references in general, GCs know how to deal with these just fine and in this case it's limited to the command and its handlers. I did not reply, however, as I do not feel strongly about this.
Regards private case: 1. We have command that not creating any task 2. We have command that will create a one task. 3. And we have 3 commands meanwhile which will create more than one task. I think that 3 is private case and not common? (In the future, I
once happens twice is a coincidence three times is a method
But if you insist on more then it's easy enough. We've discussed many times in the past that we need to change many of the storage verbs to run asynchronously (e.g. createStorageDomain) once this happens then existing flows would have to run multiple async tasks serially.
removed too many lines of code that were preparation for future that never come)
This is not in preparation for the future, it is for a feature we're working on right now (live storage migration) and for fixing move disk on which we have several bugs pending.
The handling done at CommandBase it means that it is influence all system.
That is how the task management was done. Again, if you feel it should only affect storage flows, feel free to push it down into StorageCommandHandlingBase and then only storage verbs will have task management.
Now regards architecture why I need some handler which will be inside a command and will call for command methods? Please explain.
As opposed to what? So, u think it is a good design where we are using a "Circular references" design pattern. If yes, please elaborate.
This will occur all over the storage commands (which are the only usages of tasks nowadys). Moreover, async task handling is done at the Commandbase level (see the end* methods) - instead of hacking it in X different places whenever we need it, I'd prefer doing it once, properly.
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
----- Original Message -----
From: "Ayal Baron" <abaron@redhat.com> To: "Michael Kublin" <mkublin@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Allon Mureinik" <amureini@redhat.com> Sent: Sunday, September 23, 2012 5:27:54 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
----- Original Message -----
From: "Ayal Baron" <abaron@redhat.com> To: "Allon Mureinik" <amureini@redhat.com>, "Michael Kublin" <mkublin@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com> Sent: Sunday, September 23, 2012 1:10:07 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
----- Original Message -----
From: "Michael Kublin" <mkublin@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Maor Lipchuk" <mlipchuk@redhat.com>, "engine-devel" <engine-devel@ovirt.org> Sent: Sunday, September 23, 2012 12:41:05 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
>>>>>>>>>> Hi guys, >>>>>>>>>> >>>>>>>>>> As you may know the engine currently has the >>>>>>>>>> ability >>>>>>>>>> to >>>>>>>>>> fire >>>>>>>>>> an >>>>>>>>>> SPM >>>>>>>>>> task, and be asynchronously be "woken-up" when >>>>>>>>>> it >>>>>>>>>> ends. >>>>>>>>>> This is great, but we found the for the Live >>>>>>>>>> Storage >>>>>>>>>> Migration >>>>>>>>>> feature we need something a bit complex - the >>>>>>>>>> ability >>>>>>>>>> to >>>>>>>>>> have a >>>>>>>>>> series of async tasks in a single control flow. >>>>>>>>>> >>>>>>>>>> Here's my initial design for this, your comments >>>>>>>>>> and >>>>>>>>>> criticism >>>>>>>>>> would >>>>>>>>>> be welcome: >>>>>>>>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>>>>>>> -successful execution - >>>>>>>> * "CommandBase iterates over its >>>>>>>> SPMAsyncTaskHandlers" >>>>>>>> - >>>>>>>> when? >>>>>>> This is the new suggested format of >>>>>>> executeCommand(). >>>>>>> I'll >>>>>>> clarify >>>>>>> this too. >>>>>>> >>>>>>>> * If the second task is an HSM command (vs. SPM >>>>>>>> command), >>>>>>>> I >>>>>>>> think you >>>>>>>> should explain in the design how to handle such >>>>>>>> flows >>>>>>>> as >>>>>>>> well. >>>>>>> HSM commands do not create AsyncTasks, as they do >>>>>>> today >>>>>>> - >>>>>>> I >>>>>>> will >>>>>>> clarify this. >>>>>>> >>>>>>>> * Why do we need before task? can you give a >>>>>>>> concrete >>>>>>>> example >>>>>>>> of what >>>>>>>> would you do in such a method. >>>>>>> Basically, /today/, command look like this: >>>>>>> executeCommand() { >>>>>>> doStuffInTheDB(); >>>>>>> runVdsCommand(someCommand); >>>>>>> } >>>>>>> >>>>>>> endSuccessfully() { >>>>>>> doMoreStuffInTheDB(); >>>>>>> } >>>>>>> >>>>>>> endWithFailure() { >>>>>>> doMoreStuffForFailureInTheDB(); >>>>>>> } >>>>>>> >>>>>>> In the new design, the entire doStuffInTheDB() >>>>>>> should >>>>>>> be >>>>>>> moved >>>>>>> to a >>>>>>> breforeTask of the (only) SPMAsyncTaskHandler. >>>>>>> >>>>>>>> >>>>>>>> - I see you added SPMAsyncTaskHandler, any reason >>>>>>>> not >>>>>>>> to >>>>>>>> use >>>>>>>> SPMAsyncTasK to manage it own life-cycle? >>>>>>> Conserving today's design - The SPMAsyncTaskHandler >>>>>>> is >>>>>>> the >>>>>>> place to >>>>>>> add additional, non-SPM, logic around the SPM task >>>>>>> execution, >>>>>>> like >>>>>>> CommandBase allows today. >>>>>>> >>>>>>>> >>>>>>>> - In the life-cycle managed by the >>>>>>>> SPMAsyncTaskHandler >>>>>>>> there >>>>>>>> is a >>>>>>>> step >>>>>>>> 'createTask - how to create the async task' can >>>>>>>> you >>>>>>>> please >>>>>>>> elaborate >>>>>>>> what are the options. >>>>>>> new [any type of async task]
(I cleaned thread a little.) The following design and it is implementation http://gerrit.ovirt.org/#/c/7956/ is bad. I don't see any reason for creating a new SPMAsyncTaskHandler and especially in the way as it's done in patch. The reason are following: 1. Performance , increased memory footprint, created CYCLIC REFERENCE. 2. Readability and robust of code: the code which is written as cyclic references is unreadable and difficult for debug. 3. Why I need a generic implementation and changes all over whole project because of series of async commands, for me it is a private case?
What is the private case here exactly? Every task can have multiple jobs. We've identified several such places (e.g. live storage migration, move disk, move vm) and I have no doubt more will popup. As Allon notes below, task handling is done at CommandBase, if you think task management should be for storage only, you're welcome to push it down to StorageHandlingCommandBase (or get rid of inheritance here altogether). Interesting , regards cyclic reference no response, but who cares, it is difficult to answer , that's why better not to response?
There is no problem with cyclic references in general, GCs know how to deal with these just fine and in this case it's limited to the command and its handlers. I did not reply, however, as I do not feel strongly about this.
Regards private case: 1. We have command that not creating any task 2. We have command that will create a one task. 3. And we have 3 commands meanwhile which will create more than one task. I think that 3 is private case and not common? (In the future, I
once happens twice is a coincidence three times is a method
But if you insist on more then it's easy enough. We've discussed many times in the past that we need to change many of the storage verbs to run asynchronously (e.g. createStorageDomain) once this happens then existing flows would have to run multiple async tasks serially.
removed too many lines of code that were preparation for future that never come)
This is not in preparation for the future, it is for a feature we're working on right now (live storage migration) and for fixing move disk on which we have several bugs pending.
The handling done at CommandBase it means that it is influence all system.
That is how the task management was done. Again, if you feel it should only affect storage flows, feel free to push it down into StorageCommandHandlingBase and then only storage verbs will have task management.
Now regards architecture why I need some handler which will be inside a command and will call for command methods? Please explain.
As opposed to what? So, u think it is a good design where we are using a "Circular references" design pattern. If yes, please elaborate.
I'm saying nacking something without suggesting a better alternative is not good practice. Besides, the design is classic callback pattern (http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) which is quite common and accepted. Regardless though, take a look at the new patches.
This will occur all over the storage commands (which are the only usages of tasks nowadys). Moreover, async task handling is done at the Commandbase level (see the end* methods) - instead of hacking it in X different places whenever we need it, I'd prefer doing it once, properly.
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 09/27/2012 01:11 AM, Ayal Baron wrote:
----- Original Message -----
----- Original Message -----
From: "Ayal Baron" <abaron@redhat.com> To: "Michael Kublin" <mkublin@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Allon Mureinik" <amureini@redhat.com> Sent: Sunday, September 23, 2012 5:27:54 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
----- Original Message -----
From: "Ayal Baron" <abaron@redhat.com> To: "Allon Mureinik" <amureini@redhat.com>, "Michael Kublin" <mkublin@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com> Sent: Sunday, September 23, 2012 1:10:07 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
----- Original Message ----- > From: "Michael Kublin" <mkublin@redhat.com> > To: "Allon Mureinik" <amureini@redhat.com> > Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Liron > Aravot" > <laravot@redhat.com>, "Maor Lipchuk" > <mlipchuk@redhat.com>, "engine-devel" > <engine-devel@ovirt.org> > Sent: Sunday, September 23, 2012 12:41:05 PM > Subject: Re: [Engine-devel] Serial Execution of Async Tasks > > >>>>>>>>>>> Hi guys, >>>>>>>>>>> >>>>>>>>>>> As you may know the engine currently has the >>>>>>>>>>> ability >>>>>>>>>>> to >>>>>>>>>>> fire >>>>>>>>>>> an >>>>>>>>>>> SPM >>>>>>>>>>> task, and be asynchronously be "woken-up" when >>>>>>>>>>> it >>>>>>>>>>> ends. >>>>>>>>>>> This is great, but we found the for the Live >>>>>>>>>>> Storage >>>>>>>>>>> Migration >>>>>>>>>>> feature we need something a bit complex - the >>>>>>>>>>> ability >>>>>>>>>>> to >>>>>>>>>>> have a >>>>>>>>>>> series of async tasks in a single control flow. >>>>>>>>>>> >>>>>>>>>>> Here's my initial design for this, your comments >>>>>>>>>>> and >>>>>>>>>>> criticism >>>>>>>>>>> would >>>>>>>>>>> be welcome: >>>>>>>>>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>>>>>>>> -successful execution - >>>>>>>>> * "CommandBase iterates over its >>>>>>>>> SPMAsyncTaskHandlers" >>>>>>>>> - >>>>>>>>> when? >>>>>>>> This is the new suggested format of >>>>>>>> executeCommand(). >>>>>>>> I'll >>>>>>>> clarify >>>>>>>> this too. >>>>>>>> >>>>>>>>> * If the second task is an HSM command (vs. SPM >>>>>>>>> command), >>>>>>>>> I >>>>>>>>> think you >>>>>>>>> should explain in the design how to handle such >>>>>>>>> flows >>>>>>>>> as >>>>>>>>> well. >>>>>>>> HSM commands do not create AsyncTasks, as they do >>>>>>>> today >>>>>>>> - >>>>>>>> I >>>>>>>> will >>>>>>>> clarify this. >>>>>>>> >>>>>>>>> * Why do we need before task? can you give a >>>>>>>>> concrete >>>>>>>>> example >>>>>>>>> of what >>>>>>>>> would you do in such a method. >>>>>>>> Basically, /today/, command look like this: >>>>>>>> executeCommand() { >>>>>>>> doStuffInTheDB(); >>>>>>>> runVdsCommand(someCommand); >>>>>>>> } >>>>>>>> >>>>>>>> endSuccessfully() { >>>>>>>> doMoreStuffInTheDB(); >>>>>>>> } >>>>>>>> >>>>>>>> endWithFailure() { >>>>>>>> doMoreStuffForFailureInTheDB(); >>>>>>>> } >>>>>>>> >>>>>>>> In the new design, the entire doStuffInTheDB() >>>>>>>> should >>>>>>>> be >>>>>>>> moved >>>>>>>> to a >>>>>>>> breforeTask of the (only) SPMAsyncTaskHandler. >>>>>>>> >>>>>>>>> >>>>>>>>> - I see you added SPMAsyncTaskHandler, any reason >>>>>>>>> not >>>>>>>>> to >>>>>>>>> use >>>>>>>>> SPMAsyncTasK to manage it own life-cycle? >>>>>>>> Conserving today's design - The SPMAsyncTaskHandler >>>>>>>> is >>>>>>>> the >>>>>>>> place to >>>>>>>> add additional, non-SPM, logic around the SPM task >>>>>>>> execution, >>>>>>>> like >>>>>>>> CommandBase allows today. >>>>>>>> >>>>>>>>> >>>>>>>>> - In the life-cycle managed by the >>>>>>>>> SPMAsyncTaskHandler >>>>>>>>> there >>>>>>>>> is a >>>>>>>>> step >>>>>>>>> 'createTask - how to create the async task' can >>>>>>>>> you >>>>>>>>> please >>>>>>>>> elaborate >>>>>>>>> what are the options. >>>>>>>> new [any type of async task] > > (I cleaned thread a little.) > The following design and it is implementation > http://gerrit.ovirt.org/#/c/7956/ > is bad. > I don't see any reason for creating a new > SPMAsyncTaskHandler > and > especially in the > way as it's done in patch. > The reason are following: > 1. Performance , increased memory footprint, created CYCLIC > REFERENCE. > 2. Readability and robust of code: the code which is > written > as > cyclic references is unreadable > and difficult for debug. > 3. Why I need a generic implementation and changes all over > whole > project because of > series of async commands, for me it is a private case?
What is the private case here exactly? Every task can have multiple jobs. We've identified several such places (e.g. live storage migration, move disk, move vm) and I have no doubt more will popup. As Allon notes below, task handling is done at CommandBase, if you think task management should be for storage only, you're welcome to push it down to StorageHandlingCommandBase (or get rid of inheritance here altogether). Interesting , regards cyclic reference no response, but who cares, it is difficult to answer , that's why better not to response?
There is no problem with cyclic references in general, GCs know how to deal with these just fine and in this case it's limited to the command and its handlers. I did not reply, however, as I do not feel strongly about this.
Regards private case: 1. We have command that not creating any task 2. We have command that will create a one task. 3. And we have 3 commands meanwhile which will create more than one task. I think that 3 is private case and not common? (In the future, I
once happens twice is a coincidence three times is a method
But if you insist on more then it's easy enough. We've discussed many times in the past that we need to change many of the storage verbs to run asynchronously (e.g. createStorageDomain) once this happens then existing flows would have to run multiple async tasks serially.
removed too many lines of code that were preparation for future that never come)
This is not in preparation for the future, it is for a feature we're working on right now (live storage migration) and for fixing move disk on which we have several bugs pending.
The handling done at CommandBase it means that it is influence all system.
IMHO, I think the fact ALL commands have the ability to create VDSM async tasks (even nowadays, regardless of the serial execution suggestion) - is bad. IMHO, A command should use AsyncTaskManager to create/manage tasks
That is how the task management was done. Again, if you feel it should only affect storage flows, feel free to push it down into StorageCommandHandlingBase and then only storage verbs will have task management.
Who knows if storage will be the only case. See previous comment on where we should consider having task MGMT code.
Now regards architecture why I need some handler which will be inside a command and will call for command methods? Please explain.
As opposed to what?
So, u think it is a good design where we are using a "Circular references" design pattern. If yes, please elaborate.
I'm saying nacking something without suggesting a better alternative is not good practice.
Besides, the design is classic callback pattern (http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) which is quite common and accepted. Regardless though, take a look at the new patches.
This will occur all over the storage commands (which are the only usages of tasks nowadys). Moreover, async task handling is done at the Commandbase level (see the end* methods) - instead of hacking it in X different places whenever we need it, I'd prefer doing it once, properly. > > _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
On 09/27/2012 01:11 AM, Ayal Baron wrote:
----- Original Message -----
----- Original Message -----
From: "Ayal Baron" <abaron@redhat.com> To: "Michael Kublin" <mkublin@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Allon Mureinik" <amureini@redhat.com> Sent: Sunday, September 23, 2012 5:27:54 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
----- Original Message -----
From: "Ayal Baron" <abaron@redhat.com> To: "Allon Mureinik" <amureini@redhat.com>, "Michael Kublin" <mkublin@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com> Sent: Sunday, September 23, 2012 1:10:07 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message ----- > > > ----- Original Message ----- >> From: "Michael Kublin" <mkublin@redhat.com> >> To: "Allon Mureinik" <amureini@redhat.com> >> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Liron >> Aravot" >> <laravot@redhat.com>, "Maor Lipchuk" >> <mlipchuk@redhat.com>, "engine-devel" >> <engine-devel@ovirt.org> >> Sent: Sunday, September 23, 2012 12:41:05 PM >> Subject: Re: [Engine-devel] Serial Execution of Async Tasks >> >> >>>>>>>>>>>> Hi guys, >>>>>>>>>>>> >>>>>>>>>>>> As you may know the engine currently has the >>>>>>>>>>>> ability >>>>>>>>>>>> to >>>>>>>>>>>> fire >>>>>>>>>>>> an >>>>>>>>>>>> SPM >>>>>>>>>>>> task, and be asynchronously be "woken-up" when >>>>>>>>>>>> it >>>>>>>>>>>> ends. >>>>>>>>>>>> This is great, but we found the for the Live >>>>>>>>>>>> Storage >>>>>>>>>>>> Migration >>>>>>>>>>>> feature we need something a bit complex - the >>>>>>>>>>>> ability >>>>>>>>>>>> to >>>>>>>>>>>> have a >>>>>>>>>>>> series of async tasks in a single control flow. >>>>>>>>>>>> >>>>>>>>>>>> Here's my initial design for this, your comments >>>>>>>>>>>> and >>>>>>>>>>>> criticism >>>>>>>>>>>> would >>>>>>>>>>>> be welcome: >>>>>>>>>>>> http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D... >>>>>>>>>> -successful execution - >>>>>>>>>> * "CommandBase iterates over its >>>>>>>>>> SPMAsyncTaskHandlers" >>>>>>>>>> - >>>>>>>>>> when? >>>>>>>>> This is the new suggested format of >>>>>>>>> executeCommand(). >>>>>>>>> I'll >>>>>>>>> clarify >>>>>>>>> this too. >>>>>>>>> >>>>>>>>>> * If the second task is an HSM command (vs. SPM >>>>>>>>>> command), >>>>>>>>>> I >>>>>>>>>> think you >>>>>>>>>> should explain in the design how to handle such >>>>>>>>>> flows >>>>>>>>>> as >>>>>>>>>> well. >>>>>>>>> HSM commands do not create AsyncTasks, as they do >>>>>>>>> today >>>>>>>>> - >>>>>>>>> I >>>>>>>>> will >>>>>>>>> clarify this. >>>>>>>>> >>>>>>>>>> * Why do we need before task? can you give a >>>>>>>>>> concrete >>>>>>>>>> example >>>>>>>>>> of what >>>>>>>>>> would you do in such a method. >>>>>>>>> Basically, /today/, command look like this: >>>>>>>>> executeCommand() { >>>>>>>>> doStuffInTheDB(); >>>>>>>>> runVdsCommand(someCommand); >>>>>>>>> } >>>>>>>>> >>>>>>>>> endSuccessfully() { >>>>>>>>> doMoreStuffInTheDB(); >>>>>>>>> } >>>>>>>>> >>>>>>>>> endWithFailure() { >>>>>>>>> doMoreStuffForFailureInTheDB(); >>>>>>>>> } >>>>>>>>> >>>>>>>>> In the new design, the entire doStuffInTheDB() >>>>>>>>> should >>>>>>>>> be >>>>>>>>> moved >>>>>>>>> to a >>>>>>>>> breforeTask of the (only) SPMAsyncTaskHandler. >>>>>>>>> >>>>>>>>>> >>>>>>>>>> - I see you added SPMAsyncTaskHandler, any reason >>>>>>>>>> not >>>>>>>>>> to >>>>>>>>>> use >>>>>>>>>> SPMAsyncTasK to manage it own life-cycle? >>>>>>>>> Conserving today's design - The SPMAsyncTaskHandler >>>>>>>>> is >>>>>>>>> the >>>>>>>>> place to >>>>>>>>> add additional, non-SPM, logic around the SPM task >>>>>>>>> execution, >>>>>>>>> like >>>>>>>>> CommandBase allows today. >>>>>>>>> >>>>>>>>>> >>>>>>>>>> - In the life-cycle managed by the >>>>>>>>>> SPMAsyncTaskHandler >>>>>>>>>> there >>>>>>>>>> is a >>>>>>>>>> step >>>>>>>>>> 'createTask - how to create the async task' can >>>>>>>>>> you >>>>>>>>>> please >>>>>>>>>> elaborate >>>>>>>>>> what are the options. >>>>>>>>> new [any type of async task] >> >> (I cleaned thread a little.) >> The following design and it is implementation >> http://gerrit.ovirt.org/#/c/7956/ >> is bad. >> I don't see any reason for creating a new >> SPMAsyncTaskHandler >> and >> especially in the >> way as it's done in patch. >> The reason are following: >> 1. Performance , increased memory footprint, created CYCLIC >> REFERENCE. >> 2. Readability and robust of code: the code which is >> written >> as >> cyclic references is unreadable >> and difficult for debug. >> 3. Why I need a generic implementation and changes all over >> whole >> project because of >> series of async commands, for me it is a private case?
What is the private case here exactly? Every task can have multiple jobs. We've identified several such places (e.g. live storage migration, move disk, move vm) and I have no doubt more will popup. As Allon notes below, task handling is done at CommandBase, if you think task management should be for storage only, you're welcome to push it down to StorageHandlingCommandBase (or get rid of inheritance here altogether). Interesting , regards cyclic reference no response, but who cares, it is difficult to answer , that's why better not to response?
There is no problem with cyclic references in general, GCs know how to deal with these just fine and in this case it's limited to the command and its handlers. I did not reply, however, as I do not feel strongly about this.
Regards private case: 1. We have command that not creating any task 2. We have command that will create a one task. 3. And we have 3 commands meanwhile which will create more than one task. I think that 3 is private case and not common? (In the future, I
once happens twice is a coincidence three times is a method
But if you insist on more then it's easy enough. We've discussed many times in the past that we need to change many of the storage verbs to run asynchronously (e.g. createStorageDomain) once this happens then existing flows would have to run multiple async tasks serially.
removed too many lines of code that were preparation for future that never come)
This is not in preparation for the future, it is for a feature we're working on right now (live storage migration) and for fixing move disk on which we have several bugs pending.
The handling done at CommandBase it means that it is influence all system.
IMHO, I think the fact ALL commands have the ability to create VDSM async tasks (even nowadays, regardless of the serial execution suggestion) - is bad. IMHO, A command should use AsyncTaskManager to create/manage tasks
Fine by me, but that's a whole different ball game and has nothing to do with the current feature.
That is how the task management was done. Again, if you feel it should only affect storage flows, feel free to push it down into StorageCommandHandlingBase and then only storage verbs will have task management.
Who knows if storage will be the only case. See previous comment on where we should consider having task MGMT code.
I agree it should be split out of the commands altogether, as most of the code in commands should (in fact I see no justification for the command pattern in most places in the code at all). But that is a much bigger change and requires a ton of refactoring.
Now regards architecture why I need some handler which will be inside a command and will call for command methods? Please explain.
As opposed to what?
So, u think it is a good design where we are using a "Circular references" design pattern. If yes, please elaborate.
I'm saying nacking something without suggesting a better alternative is not good practice.
Besides, the design is classic callback pattern (http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) which is quite common and accepted. Regardless though, take a look at the new patches.
> This will occur all over the storage commands (which are the > only > usages of tasks nowadys). > Moreover, async task handling is done at the Commandbase > level > (see > the end* methods) - instead of hacking it in X different > places > whenever we need it, I'd prefer doing it once, properly. >> >> > _______________________________________________ > Engine-devel mailing list > Engine-devel@ovirt.org > http://lists.ovirt.org/mailman/listinfo/engine-devel >
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "Livnat Peer" <lpeer@redhat.com> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Tuesday, August 14, 2012 2:10:55 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
Thanks for all your comments! The correct response for many these points is to update the wiki. I'm enclosing here the quick-and-dirty replies just to keep this thread alive, and will update the wiki shortly.
See inline.
----- Original Message -----
From: "Livnat Peer" <lpeer@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eli Mesika" <emesika@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com> Sent: Sunday, August 12, 2012 9:39:23 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
On 10/08/12 03:40, Eli Mesika wrote:
----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram 2) Flow diagram
Good idea, I'll see if I can jimmy something up.
+1, it would help understanding the flow.
- It looks like you chose not re-use/extend the ExecutionHandler (the entity used for building the tasks view exposed to the users). It might be a good idea to keep the separation between the engine Jobs and the underlying vdsm tasks, but I want to make sure you are familiar with this mechanism and ruled it out with a reason. If this is the case please share why you decided not to use it. As you said Jobs and Steps are pure engine entities - they can contain no VDSM tasks, one VDSM task, or plausibly, in the future, several tasks. Even /today/, AsyncTasks and Jobs/Steps are two different kinds of animals - I don't see any added value in mixing them together.
- how does this design survives a jboss restart? Can you please a section in the wiki to explain that.
Basically, the way as a Command does today - the task is saved with the executionIndex, and continues when the command is woken up. I'll clarify this point in the wiki. Added to the wiki.
-successful execution - * "CommandBase iterates over its SPMAsyncTaskHandlers" - when?
This is the new suggested format of executeCommand(). I'll clarify this too. Added to the wiki.
* If the second task is an HSM command (vs. SPM command), I think you should explain in the design how to handle such flows as well. HSM commands do not create AsyncTasks, as they do today - I will clarify this. Added to the wiki.
* Why do we need before task? can you give a concrete example of what would you do in such a method. Basically, /today/, command look like this: executeCommand() { doStuffInTheDB(); runVdsCommand(someCommand); }
endSuccessfully() { doMoreStuffInTheDB(); }
endWithFailure() { doMoreStuffForFailureInTheDB(); }
In the new design, the entire doStuffInTheDB() should be moved to a breforeTask of the (only) SPMAsyncTaskHandler.
- I see you added SPMAsyncTaskHandler, any reason not to use SPMAsyncTasK to manage it own life-cycle?
Conserving today's design - The SPMAsyncTaskHandler is the place to add additional, non-SPM, logic around the SPM task execution, like CommandBase allows today.
- In the life-cycle managed by the SPMAsyncTaskHandler there is a step 'createTask - how to create the async task' can you please elaborate what are the options.
new [any type of async task]
Livnat
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Eli Mesika" <emesika@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org> Sent: Friday, August 10, 2012 3:40:48 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram Done 2) Flow diagram
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "Eli Mesika" <emesika@redhat.com> Cc: "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eduardo Warszawski" <ewarszaw@redhat.com> Sent: Wednesday, August 22, 2012 12:48:01 PM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
From: "Eli Mesika" <emesika@redhat.com> To: "Allon Mureinik" <amureini@redhat.com> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com>, "engine-devel" <engine-devel@ovirt.org> Sent: Friday, August 10, 2012 3:40:48 AM Subject: Re: [Engine-devel] Serial Execution of Async Tasks
----- Original Message -----
From: "Allon Mureinik" <amureini@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Cc: "Eduardo Warszawski" <ewarszaw@redhat.com>, "Yeela Kaplan" <ykaplan@redhat.com>, "Federico Simoncelli" <fsimonce@redhat.com>, "Liron Aravot" <laravot@redhat.com> Sent: Thursday, August 9, 2012 6:41:09 PM Subject: [Engine-devel] Serial Execution of Async Tasks
Hi guys,
As you may know the engine currently has the ability to fire an SPM task, and be asynchronously be "woken-up" when it ends. This is great, but we found the for the Live Storage Migration feature we need something a bit complex - the ability to have a series of async tasks in a single control flow.
Here's my initial design for this, your comments and criticism would be welcome: http://wiki.ovirt.org/wiki/Features/Serial_Execution_of_Asynchronous_Tasks_D...
Apart from the short explanation & flow , since this is a detailed design , I would add 1) Class diagram Done 2) Flow diagram Done too.
-Allon _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
participants (8)
-
Allon Mureinik
-
Ayal Baron
-
Eli Mesika
-
Itamar Heim
-
Livnat Peer
-
Maor Lipchuk
-
Michael Kublin
-
Yair Zaslavsky