[
https://issues.apache.org/jira/browse/GOBBLIN-1851?focusedWorklogId=871412&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-871412
]
ASF GitHub Bot logged work on GOBBLIN-1851:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 18/Jul/23 00:12
Start Date: 18/Jul/23 00:12
Worklog Time Spent: 10m
Work Description: phet commented on code in PR #3715:
URL: https://github.com/apache/gobblin/pull/3715#discussion_r1266033992
##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/MysqlMultiActiveLeaseArbiter.java:
##########
@@ -100,8 +100,9 @@ protected interface CheckedFunction<T, R> {
+ "PRIMARY KEY (flow_group,flow_name,flow_execution_id,flow_action))";
private static final String CREATE_CONSTANTS_TABLE_STATEMENT = "CREATE TABLE
IF NOT EXISTS %s "
+ "(epsilon INT, linger INT, PRIMARY KEY (epsilon, linger))";
- private static final String GET_ROW_COUNT_STATEMENT = "SELECT COUNT(*) FROM
%s";
- private static final String INSERT_IN_CONSTANTS_TABLE_STATEMENT = "INSERT
INTO %s (epsilon, linger) VALUES (?,?)";
+ // Only insert epsilon and linger values from config if this table does not
contain a pre-existing values already.
+ private static final String INSERT_IN_CONSTANTS_TABLE_STATEMENT = "INSERT
INTO %s (epsilon, linger) SELECT ?, ? "
+ + "WHERE NOT EXISTS (SELECT 1 FROM %s)";
Review Comment:
don't we need to overwrite in case the pre-existing values are out-of-date?
that's why I suggested `INSERT INTO... ON DUPLICATE KEY UPDATE`
Issue Time Tracking
-------------------
Worklog Id: (was: 871412)
Time Spent: 50m (was: 40m)
> Unit Testing of Multi-active Algorithm
> --------------------------------------
>
> Key: GOBBLIN-1851
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1851
> Project: Apache Gobblin
> Issue Type: Bug
> Components: gobblin-service
> Reporter: Urmi Mustafi
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Tests all cases of trying to acquire a lease for a flow action event with one
> participant involved and makes corresponding fixes in the
> `MultiActiveLeaseArbiter`.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)