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

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

                Author: ASF GitHub Bot
            Created on: 30/Oct/23 20:15
            Start Date: 30/Oct/23 20:15
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3812:
URL: https://github.com/apache/gobblin/pull/3812#discussion_r1376753467


##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/dag_action_store/MysqlDagActionStore.java:
##########
@@ -58,6 +64,8 @@ public class MysqlDagActionStore implements DagActionStore {
       + "flow_execution_id varchar(" + 
ServiceConfigKeys.MAX_FLOW_EXECUTION_ID_LENGTH + ") NOT NULL, "
       + "dag_action varchar(100) NOT NULL, modified_time TIMESTAMP DEFAULT 
CURRENT_TIMESTAMP  on update CURRENT_TIMESTAMP NOT NULL, "
       + "PRIMARY KEY (flow_group,flow_name,flow_execution_id, dag_action))";
+  // Deletes rows older than retention time period (in seconds) to prevent 
this table from growing unbounded.
+  private static final String RETENTION_STATEMENT = "DELETE FROM %s WHERE 
modified_time < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL ? SECOND)";

Review Comment:
   if one makes more sense in ms than secs, leave it.  but why should one use 
`%s` and another the bind var `?`?





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

    Worklog Id:     (was: 887938)
    Time Spent: 1.5h  (was: 1h 20m)

> Create MySQL util class for re-usable methods & enable MysqlDagActionStore 
> retention
> ------------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1942
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1942
>             Project: Apache Gobblin
>          Issue Type: Bug
>          Components: gobblin-service
>            Reporter: Urmi Mustafi
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Defines a new class {{MySQLStoreUtils}} used for common functionality between 
> MySQL based implementations of stores. It includes a new method to run a SQL 
> command in a {{ScheduledThreadPoolExecutor}} using {{interval T}} which is 
> used for retention on the {{MysqlDagActionStore}} and 
> {{{}MysqlMultiActiveLeaseArbiter{}}}.  



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

Reply via email to