Skip to content

Commit

Permalink
Add op type to panics (#4108)
Browse files Browse the repository at this point in the history
This updates the `panic` messages on applying meta entries to include
the faulty op type, so that we can better work out what's going on in
these cases.

Signed-off-by: Neil Twigg <neil@nats.io>
  • Loading branch information
neilalexander committed Apr 27, 2023
2 parents f584df4 + e30ea34 commit 3feb9f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/jetstream_cluster.go
Expand Up @@ -1728,7 +1728,7 @@ func (js *jetStream) applyMetaEntries(entries []*Entry, ru *recoveryUpdates) (bo
js.processUpdateStreamAssignment(sa)
}
default:
panic("JetStream Cluster Unknown meta entry op type")
panic(fmt.Sprintf("JetStream Cluster Unknown meta entry op type: %v", entryOp(buf[0])))
}
}
}
Expand Down Expand Up @@ -2687,7 +2687,7 @@ func (js *jetStream) applyStreamEntries(mset *stream, ce *CommittedEntry, isReco
}
}
default:
panic("JetStream Cluster Unknown group entry op type!")
panic(fmt.Sprintf("JetStream Cluster Unknown group entry op type: %v", op))
}
} else if e.Type == EntrySnapshot {
if !isRecovering && mset != nil {
Expand Down Expand Up @@ -4517,7 +4517,7 @@ func (js *jetStream) applyConsumerEntries(o *consumer, ce *CommittedEntry, isLea
}
o.mu.Unlock()
default:
panic(fmt.Sprintf("JetStream Cluster Unknown group entry op type! %v", entryOp(buf[0])))
panic(fmt.Sprintf("JetStream Cluster Unknown group entry op type: %v", entryOp(buf[0])))
}
}
}
Expand Down

0 comments on commit 3feb9f7

Please sign in to comment.