[
https://issues.apache.org/jira/browse/GOBBLIN-1713?focusedWorklogId=811095&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-811095
]
ASF GitHub Bot logged work on GOBBLIN-1713:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 22/Sep/22 08:20
Start Date: 22/Sep/22 08:20
Worklog Time Spent: 10m
Work Description: phet commented on code in PR #3567:
URL: https://github.com/apache/gobblin/pull/3567#discussion_r977340366
##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_store/MysqlBaseSpecStore.java:
##########
@@ -325,6 +327,7 @@ protected <T> T withPreparedStatement(String sql,
CheckedFunction<PreparedStatem
}
return result;
} catch (SQLException e) {
+ log.warn("Received SQL exception that can result from invalid
connection. Checking if validation query is set {} Exception is {}",
((BasicDataSource) this.dataSource).getValidationQuery());
Review Comment:
good thinking!
##########
gobblin-utility/src/main/java/org/apache/gobblin/util/jdbc/DataSourceProvider.java:
##########
@@ -37,6 +38,7 @@
/**
* A provider class for {@link javax.sql.DataSource}s.
*/
+@Slf4j
Review Comment:
curious, do we need this in addition to the `LoggerFactory.getLogger` call?
##########
gobblin-utility/src/main/java/org/apache/gobblin/util/jdbc/DataSourceProvider.java:
##########
@@ -81,6 +83,7 @@ public DataSourceProvider(@Named("dataSourceProperties")
Properties properties)
}
public DataSourceProvider() {
+ log.warn("Creating {} without setting validation query",
this.getClass().getSimpleName());
Review Comment:
another great idea. might consider including
`Thread.currentThread().getStackTrace()` to better pinpoint context.
##########
gobblin-metastore/src/main/java/org/apache/gobblin/metastore/JobHistoryDataSourceProvider.java:
##########
@@ -33,6 +33,7 @@ public class JobHistoryDataSourceProvider extends
org.apache.gobblin.util.jdbc.D
@Inject
public JobHistoryDataSourceProvider(@Named("dataSourceProperties")
Properties properties) {
+ super(properties);
Review Comment:
should we worry that perhaps some settings within the base class ctor (like
`.setUsername` or `.setPassword`) wouldn't be overridden here, if the config
keys used by the base class are present, but the ones used by this derived
class are not?
Issue Time Tracking
-------------------
Worklog Id: (was: 811095)
Remaining Estimate: 0h
Time Spent: 10m
> Add validation check for mysql connection
> ------------------------------------------
>
> Key: GOBBLIN-1713
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1713
> Project: Apache Gobblin
> Issue Type: New Feature
> Reporter: Urmi Mustafi
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Detect once a MySQL connection becomes read-only. Enforce verification when
> this happens, so we know to create new, replacement connections (to a
> read-write host). Adding this check to a code path that was missing this
> check.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)