[
https://issues.apache.org/jira/browse/PHOENIX-6052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17657021#comment-17657021
]
ASF GitHub Bot commented on PHOENIX-6052:
-----------------------------------------
tkhurana commented on code in PR #1546:
URL: https://github.com/apache/phoenix/pull/1546#discussion_r1066468936
##########
phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java:
##########
@@ -1480,8 +1500,10 @@ public List<Mutation> getMutationList() {
GLOBAL_MUTATION_INDEX_COMMIT_FAILURE_COUNT.update(numFailedPhase3Mutations);
}
} finally {
- mutationCommitTime =
EnvironmentEdgeManager.currentTimeMillis() - startTime;
- GLOBAL_MUTATION_COMMIT_TIME.update(mutationCommitTime);
+ if (mutationCommitTime != 0) {
Review Comment:
Didn't understand this check
##########
phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java:
##########
@@ -947,20 +963,24 @@ private long validateAndGetServerTimestamp(TableRef
tableRef, MultiRowMutationSt
}
for (PColumn column : columns) {
if (column != null) {
-
resolvedTable.getColumnFamily(column.getFamilyName().getString()).getPColumnForColumnName(
- column.getName().getString());
+
resolvedTable.getColumnFamily(column.getFamilyName().getString())
+
.getPColumnForColumnName(column.getName().getString());
}
}
}
}
- } catch(Throwable e) {
- if(table != null) {
-
TableMetricsManager.updateMetricsForSystemCatalogTableMethod(table.getTableName().toString(),
- NUM_METADATA_LOOKUP_FAILURES, 1);
+ } catch (Throwable e) {
+ if (table != null) {
+ TableMetricsManager.updateMetricsForSystemCatalogTableMethod(
+ table.getTableName().toString(),
NUM_METADATA_LOOKUP_FAILURES, 1);
}
throw e;
+ } finally {
+ long endTime = EnvironmentEdgeManager.currentTimeMillis();
+ GLOBAL_MUTATION_SYSCAT_TIME.update(endTime - startTime);
Review Comment:
This looks good
> GLOBAL_MUTATION_COMMIT_TIME metric doesn't include the time spent in syscat
> rpc's
> ---------------------------------------------------------------------------------
>
> Key: PHOENIX-6052
> URL: https://issues.apache.org/jira/browse/PHOENIX-6052
> Project: Phoenix
> Issue Type: Bug
> Components: core
> Affects Versions: 4.14.3
> Reporter: Rushabh Shah
> Assignee: Aman Poonia
> Priority: Major
>
> Currently we measure the metric GLOBAL_MUTATION_COMMIT_TIME as the time spent
> just in htable.batch rpc for base and index tables.
> https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java#L1029-L1136
> We don't measure the time spent in
> MutationState#validateAndGetServerTimestamp which makes rpc to SYSTEM.CATALOG
> table and which is a part of commit phase.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)