[
https://issues.apache.org/jira/browse/HIVE-25642?focusedWorklogId=669963&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-669963
]
ASF GitHub Bot logged work on HIVE-25642:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Oct/21 09:10
Start Date: 26/Oct/21 09:10
Worklog Time Spent: 10m
Work Description: lcspinter commented on a change in pull request #2743:
URL: https://github.com/apache/hive/pull/2743#discussion_r736302385
##########
File path:
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
##########
@@ -571,6 +571,12 @@ public static ConfVars getMetaConf(String name) {
"tables or partitions to be compacted once they are determined to
need compaction.\n" +
"It will also increase the background load on the Hadoop cluster
as more MapReduce jobs\n" +
"will be running in the background."),
+
COMPACTOR_WORKER_DETECT_MULTIPLE_VERSION_THRESHOLD("metastore.compactor.worker.detect_multiple_versions.threshold",
Review comment:
Could you please use `.` instead of `_` in the config parameter name?
`metastore.compactor.worker.detect.multiple.versions.threshold`
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/AcidMetricService.java
##########
@@ -104,12 +110,43 @@ public void run() {
}
}
- private void collectMetrics() throws MetaException {
- ShowCompactResponse currentCompactions = txnHandler.showCompact(new
ShowCompactRequest());
+ private void detectMultipleWorkerVersions(ShowCompactResponse
currentCompactions) {
+ long workerVersionThresholdInHours = MetastoreConf.getLongVar(conf,
+
MetastoreConf.ConfVars.COMPACTOR_WORKER_DETECT_MULTIPLE_VERSION_THRESHOLD);
+ long since = System.currentTimeMillis() -
hoursInMillis(workerVersionThresholdInHours);
+
+ List<String> versions =
collectWorkerVersions(currentCompactions.getCompacts(), since);
+ if (versions.size() > 1) {
+ LOG.warn("Multiple Compaction Worker versions detected: {}", versions);
+ }
+ }
+
+ private void updateMetrics(ShowCompactResponse currentCompactions) throws
MetaException {
updateMetricsFromShowCompact(currentCompactions, conf);
updateDBMetrics();
}
+ @VisibleForTesting
+ public static long hoursInMillis(long hours) {
Review comment:
You don't need this method, if you get the conf value using
`MetastoreConf.getTimeVar(conf,
MetastoreConf.ConfVars.COMPACTOR_WORKER_DETECT_MULTIPLE_VERSION_THRESHOLD,
TimeUnit.MILLISECONDS)`
##########
File path:
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
##########
@@ -571,6 +571,12 @@ public static ConfVars getMetaConf(String name) {
"tables or partitions to be compacted once they are determined to
need compaction.\n" +
"It will also increase the background load on the Hadoop cluster
as more MapReduce jobs\n" +
"will be running in the background."),
+
COMPACTOR_WORKER_DETECT_MULTIPLE_VERSION_THRESHOLD("metastore.compactor.worker.detect_multiple_versions.threshold",
+ "hive.metastore.compactor.worker.detect_versions.threshold", 24,
Review comment:
You should define the default time unit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 669963)
Time Spent: 0.5h (was: 20m)
> Log a warning if multiple Compaction Worker versions are running compactions
> ----------------------------------------------------------------------------
>
> Key: HIVE-25642
> URL: https://issues.apache.org/jira/browse/HIVE-25642
> Project: Hive
> Issue Type: Improvement
> Components: Hive
> Affects Versions: 4.0.0
> Reporter: Viktor Csomor
> Assignee: Viktor Csomor
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Log a warning if multiple versions of a Compaction Workers are running
> compactions.
> The start time of the individual HMS services are not stored at the moment,
> however this information could proved a good baseline of detecting multiple
> Worker versions.
> Due to the lack of this information we can check periodically in the past N
> hours to detect the versions.
> The N hours can be configured by
> {{metastore.compactor.worker.detect_multiple_versions.threshold}} property.
> This periodical check only make sense if the Compaction are enabled.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)