This looks scary. Is the Oozie server timezone also in UTC?
On Tue, Sep 23, 2014 at 4:41 PM, Robert Kanter <[email protected]> wrote:
> Hi all,
>
> Suppose I submit the attached Coordinator job. The important parts to
> note are that the start time is 09/03/2014 at 9:00am, the URI template ends
> with /${YEAR}/${MONTH}/${DAY}/${HOUR}, and the input-event is using
> ${coord:current(0)}.
>
> When you submit this, current(0) seems to be incorrect:
> ID : 0000000-140923162340061-oozie-rkan-C@1
>
> ----------------------------------------------------------------------------------------------------------
> Action Number : 1
> Console URL : -
> Error Code : -
> Error Message : -
> External ID : -
> External Status : -
> Job ID : 0000000-140923162340061-oozie-rkan-C
> Tracker URI : -
> Created : 2014-09-23 23:23 GMT
> Nominal Time : 2014-09-03 *09*:00 GMT
> Status : WAITING
> Last Modified : 2014-09-23 23:23 GMT
> First Missing Dependency :
> hdfs://localhost:8020/user/rkanter/path_coord/input-data/2014/09/03/*08*
> /_SUCCESS
>
> ----------------------------------------------------------------------------------------------------------
> *Notice that the first missing dependency ends with 08 instead of 09, even
> though the nominal time is 9am!*
>
> I was poking through the code and it looks like the problem may be in
> CoordELFunctions.getCurrentInstance(...) which subtracts once frequency
> amount from the computed current instance. If I remove that code, it
> appears to behave correctly:
> diff --git
> a/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
> b/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
> index 3bb191e..02f4166 100644
> --- a/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
> +++ b/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
> @@ -1343,8 +1343,6 @@ public class CoordELFunctions {
> current.add(dsTimeUnit.getCalendarUnit(), dsFreq);
> instanceCount[0]++;
> }
> - current.add(dsTimeUnit.getCalendarUnit(), -dsFreq);
> - instanceCount[0]--;
> return current;
> }
> When I run the original code through a debugger, current is set to 8am;
> my modified code has 9am.
>
> Is there something I'm missing? I feel like we would have noticed this by
> now because current is pretty common...
>
> This code was greatly changed a few months ago by OOZIE-1709, but the old
> code did the same thing were it would subtract at the end and had 8am
> instead of 9am.
>
>
> thanks
> - Robert
>