New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add op type to panic
s
#4108
Add op type to panic
s
#4108
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would reformat the error as suggested.
server/jetstream_cluster.go
Outdated
@@ -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]))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
panic(fmt.Sprintf("JetStream Cluster Unknown meta entry op type! %v", entryOp(buf[0]))) | |
panic(fmt.Sprintf("JetStream Cluster Unknown meta entry op type: %v!", entryOp(buf[0]))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log the more detailed stuff then panic with a simple unknown opcode?
This will not be a bug, fyi, this will be a fault, data corruption, etc. Hence the panic.
server/jetstream_cluster.go
Outdated
@@ -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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
panic(fmt.Sprintf("JetStream Cluster Unknown group entry op type! %v", op)) | |
panic(fmt.Sprintf("JetStream Cluster Unknown group entry op type: %v!", op)) |
Signed-off-by: Neil Twigg <neil@nats.io>
8ca0890
to
e30ea34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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