[ 
https://issues.apache.org/jira/browse/OOZIE-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14029089#comment-14029089
 ] 

Shwetha G S commented on OOZIE-1807:
------------------------------------

Actually, there is an inherent design issue in oozie to implement synchronous 
commands: because of the way DB transactions are started.

Currently, command execution is as follows:
1. do some processing
2. queue child commands
3. update DB - start transaction, execute updates and close 
transaction(commit/rollback)
So, the command either completes successfully and the DB is updated, or the 
command fails and DB update is rolled back

With synchronous commands, this will change to:
1. do some processing
2. execute child command
  2.1 processing in child command
  2.2 update DB for child command - start transaction, execute updates of child 
command and close transaction
3. update DB - start transaction, execute updates of parent command and close 
transaction
If both parent and child command succeed/fail, everything is fine. But the case 
where child command succeeds and the parent fails after that, the API will fail 
and the child DB updates are committed. This results in inconsistent state

The main issue is because parent and child commands use different DB 
transactions. This can probably be changed to sharing DB transactions at thread 
level and both parent and child commands re-use the transaction started by the 
other?

Does this make sense?

> Make bundle change command synchronous
> --------------------------------------
>
>                 Key: OOZIE-1807
>                 URL: https://issues.apache.org/jira/browse/OOZIE-1807
>             Project: Oozie
>          Issue Type: Bug
>            Reporter: Ryota Egashira
>            Assignee: Purshotam Shah
>         Attachments: OOZIE-1807-V2.patch, OOZIE-1807-V3.patch, 
> OOZIE-1807.patch
>
>
> It confusion for user when they issue change command and they are not sure if 
> changes are applied to all coords jobs.
> Fix is to call synchronously all coord from bundle and display error message 
> (if any) to user.
> purushah$ 
> /Users/purushah/views/sysc_command/oozie/distro/target/oozie-4.1.0-SNAPSHOT-distro/oozie-4.1.0-SNAPSHOT/bin/oozie
>  job -change 0000002-140424165425407-oozie-puru-B  -value 
> endtime=2013-01-01T00:00Z -oozie http://localhost:11000/oozie
> Change command for coord job : 0000004-140424165425407-oozie-puru-C failed. 
> Reason : Coord is in killed state
> Change command for coord job : 0000003-140424165425407-oozie-puru-C failed. 
> Reason : Coord is in killed state
> purushah$



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to