[ 
https://issues.apache.org/jira/browse/RATIS-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsz-wo Sze updated RATIS-2745:
------------------------------
    Summary: Add start/end log messages for StateMachineUpdater.stopAndJoin  
(was: Add start/end logs for StateMachineUpdater.stopAndJoin)

> Add start/end log messages for StateMachineUpdater.stopAndJoin
> --------------------------------------------------------------
>
>                 Key: RATIS-2745
>                 URL: https://issues.apache.org/jira/browse/RATIS-2745
>             Project: Ratis
>          Issue Type: Improvement
>          Components: StateMachine
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>             Fix For: 3.4.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When a Raft server shuts down, `StateMachineUpdater.stopAndJoin()` sets the 
> stop index to the last committed index. It then wakes up the updater thread 
> and waits until every committed entry up to that index has been applied and 
> the state machine has been closed (or it hits a timeout parameter and then 
> force shutdown).
> Right now this wait logs nothing at the start or the end, so it is hard to 
> tell:
> - when the state machine started to stop,
> - how many entries were still waiting to be applied, and
> - how long the apply-and-close step took, or whether it is stuck.
> This JIRA proposes adding two INFO logs to `stopAndJoin()`:
> 1. **Start:** written before the stop index is set. It logs the state machine 
> class, `lastApplied` and `lastCommitted`.
> 2. **End:** written after `updater.join()` returns. It logs the elapsed time 
> in milliseconds, `stopIndex` and the final `lastApplied`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to