Skip to content

Commit

Permalink
Create ReplicaTransitionTimeMap entries immediately
Browse files Browse the repository at this point in the history
Longhorn 8114

Signed-off-by: Eric Weber <eric.weber@suse.com>
  • Loading branch information
ejweber authored and innobead committed Mar 13, 2024
1 parent 7b1d85c commit 229a68d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controller/engine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,11 @@ func (m *EngineMonitor) refresh(engine *longhorn.Engine) error {

currentReplicaModeMap[replica] = r.Mode

if engine.Status.ReplicaModeMap != nil {
if engine.Status.ReplicaModeMap == nil {
// We are constructing the ReplicaModeMap for the first time. Construct the ReplicaTransitionTimeMap
// alongside it.
currentReplicaTransitionTimeMap[replica] = util.Now()
} else {
if r.Mode != engine.Status.ReplicaModeMap[replica] {
switch r.Mode {
case longhorn.ReplicaModeERR:
Expand Down

0 comments on commit 229a68d

Please sign in to comment.