rajeshkumarchandolu commented on code in PR #12145:
URL: https://github.com/apache/ozone/pull/12145#discussion_r4694229276
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java:
##########
@@ -214,6 +220,8 @@ public CompletableFuture<Message> applyTransaction(
// Otherwise, it's considered as a logical rejection and is returned to
// Ratis client, leaving SCM intact.
applyTransactionFuture.completeExceptionally(ex);
+ } finally {
+ span.end();
Review Comment:
Thanks, valid points — resolved in 606d8d95d2
(https://github.com/apache/ozone/pull/12145/commits/606d8d95d27ccfcbe04a37c2ac3d6fce67875376).
applyTransaction's span now follows the same failure path as the state
machine:
- The span covers the whole apply, including updateLatestTrxInfo and the
flush, so its duration is the real time the apply took.
- Any exception that terminates SCM — a fatal SCMException, an unexpected
exception from process(), or a flush failure — is recorded on the span, and the
span is ended before ExitUtils.terminate so it isn't lost on exit.
- Non-fatal SCMException rejections are recorded as before.
Added testFlushFailureIsRecordedOnTheApplySpan (the same injected flush
failure as testFlushFailureTerminatesAndClosesApplyingWindow, checking what the
apply span records) and testUnexpectedApplyFailureIsRecordedOnTheApplySpan.
Note: flushIfPendingLimitReached() writes the pending batch only when the
limit is reached, so most apply spans won't change; the apply that crosses the
limit now shows the flush time.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]