Skip to content
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

Parse Snapshot message header to check for non-204 status codes #545

Conversation

christopher-wong
Copy link

When the server cancels backup due to a timeout or lost interest, the jetstream backup client does not return an error. This change parses the error from the nats message header and returns an error to the caller if it's anything but a successful 204.

https://github.com/nats-io/nats-server/blob/main/server/jetstream_api.go#L3823

Copy link
Collaborator

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small changes, thanks!

@@ -692,128 +705,3 @@ func (m *Manager) RestoreSnapshotFromBuffer(ctx context.Context, stream string,
_, ss, err := m.restoreSnapshot(ctx, stream, dataReader, metadataReader, sopts)
return ss, err
}

// SnapshotToBuffer creates a compressed s2 backup and writes to an io.Writer
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SnapshotToBufferOld was accidentally committed during the refactor - removing.

Copy link
Collaborator

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ripienaar ripienaar merged commit 365bb50 into nats-io:main Jul 1, 2024
2 checks passed
@ripienaar
Copy link
Collaborator

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants