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

Partial fix for #2068 #2099

Merged
merged 2 commits into from
Apr 11, 2021
Merged

Partial fix for #2068 #2099

merged 2 commits into from
Apr 11, 2021

Conversation

derekcollison
Copy link
Member

Signed-off-by: Derek Collison derek@nats.io

/cc @nats-io/core

Signed-off-by: Derek Collison <derek@nats.io>
This will not protect against the index file being completely removed.

Signed-off-by: Derek Collison <derek@nats.io>
Copy link
Contributor

@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

@@ -616,6 +616,11 @@ func (mb *msgBlock) rebuildState() (*LostStreamData, error) {
index += rl
}

// For empty msg blocks make sure we recover last seq correctly based off of first.
if mb.msgs == 0 {
mb.last.seq = mb.first.seq - 1
Copy link
Member

Choose a reason for hiding this comment

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

Do you need to take care of special case with mb.first.seq could be 0, and therefore mb.last.seq would end-up being -1?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will take a look.

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.

3 participants