[ 
https://issues.apache.org/jira/browse/GOBBLIN-1921?focusedWorklogId=883016&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-883016
 ]

ASF GitHub Bot logged work on GOBBLIN-1921:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Oct/23 23:55
            Start Date: 02/Oct/23 23:55
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3790:
URL: https://github.com/apache/gobblin/pull/3790#discussion_r1343260707


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/Orchestrator.java:
##########
@@ -264,9 +265,9 @@ public void orchestrate(Spec spec, Properties jobProps, 
long triggerTimestampMil
         String flowExecutionId = 
flowMetadata.get(TimingEvent.FlowEventConstants.FLOW_EXECUTION_ID_FIELD);
         DagActionStore.DagAction flowAction =
             new DagActionStore.DagAction(flowGroup, flowName, flowExecutionId, 
DagActionStore.FlowActionType.LAUNCH);
-        flowTriggerHandler.get().handleTriggerEvent(jobProps, flowAction, 
triggerTimestampMillis);
-        _log.info("Multi-active scheduler finished handling trigger event: 
[{}, triggerEventTimestamp: {}]", flowAction,
-            triggerTimestampMillis);
+        flowTriggerHandler.get().handleTriggerEvent(jobProps, flowAction, 
triggerTimestampMillis, isReminderEvent);
+        _log.info("Multi-active scheduler finished handling trigger event: 
[{}, triggerEventTimestamp: {}]" +
+            "(is " + (isReminderEvent ? "reminder" : "original") + ")", 
flowAction, triggerTimestampMillis);

Review Comment:
   now that you're using the `{}` placeholders, it seems clearest to use 
throughout, as:
   ```
   log.info("Multi-active ... event: [{}, triggerEventTimestamp: {}] (is {})", 
flowAction, ttMillis, isReminderEvent ? "reminder" : "original");
   ```
   writing it that way makes spotting the lack of space before `"(is "` easier 
to see.
   
   also, to entertain which we prefer:
   ```
   event: [{1}, triggerEventTimestamp: {2}] (is {3})
   {3} event: [{1}, triggerEventTimestamp: {2}]
   event: [{1}, is: {3}, triggerEventTimestamp: {2}]
   ```
   (numbered purely for illustration)



##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/MysqlMultiActiveLeaseArbiter.java:
##########
@@ -104,32 +116,50 @@ protected interface CheckedFunction<T, R> {
       + "VALUES(1, ?, ?) ON DUPLICATE KEY UPDATE epsilon=VALUES(epsilon), 
linger=VALUES(linger)";
   protected static final String WHERE_CLAUSE_TO_MATCH_KEY = "WHERE 
flow_group=? AND flow_name=? AND flow_action=?";
   protected static final String WHERE_CLAUSE_TO_MATCH_ROW = 
WHERE_CLAUSE_TO_MATCH_KEY
-      + " AND event_timestamp=? AND lease_acquisition_timestamp=?";
-  protected static final String SELECT_AFTER_INSERT_STATEMENT = "SELECT 
event_timestamp, lease_acquisition_timestamp, "
-    + "linger FROM %s, %s " + WHERE_CLAUSE_TO_MATCH_KEY;
+      + " AND event_timestamp=CONVERT_TZ(?, '+00:00', @@session.time_zone)"
+      + " AND lease_acquisition_timestamp=CONVERT_TZ(?, '+00:00', 
@@session.time_zone)";

Review Comment:
   aren't we on mysql 8?  if so, how about this - 
https://dba.stackexchange.com/a/279140 ?
   ```
   event_timestamp TIMESTAMP(3) NOT NULL DEFAULT (UTC_TIMESTAMP)
   ```
   ?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 883016)
    Time Spent: 2h 20m  (was: 2h 10m)

> Properly handle reminder events
> -------------------------------
>
>                 Key: GOBBLIN-1921
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1921
>             Project: Apache Gobblin
>          Issue Type: Bug
>          Components: gobblin-service
>            Reporter: Urmi Mustafi
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Reminder flow trigger events were being improperly handled and interpreted as 
> new events because they are triggered {{linger}} time after the original 
> trigger where {{epsilon < linger}} and we use {{epsilon}} to determine event 
> distinctness. With reminder events being considered distinct events, we were 
> launching excess concurrent flows that were then being cancelled. Now we 
> handle reminder events differently from normal event triggers to ensure 
> they're properly evaluated. Because of db laundering, reminder events are 
> easy to handle - if they're older than the currently worked upon event in the 
> database they can be skipped and if they're equal to the current event in the 
> database they are handled like normal. Reminder events should never be newer 
> than the current event in the lease arbiter table because db laundering 
> always results in increasing event times. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to