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

Appending to log return EOF error #6

Open
varunbpatil opened this issue Dec 24, 2021 · 0 comments
Open

Appending to log return EOF error #6

varunbpatil opened this issue Dec 24, 2021 · 0 comments

Comments

@varunbpatil
Copy link

In *Index.Write(), the very first if condition checks whether there is enough space to write one more index entry. If not, it bails out with EOF error. Unfortunately, at this point, the record is already written to the store. This EOF error gets propagated all the way back to *Log.Append() and the append operation fails entirely.

What should have happened in this case is that a new segment should have been created and the record should have been appended to this new segment. Unfortunately, in *Log.Append(), the call to l.newSegment() is in the wrong place. It should have been called before we append to the active segment and not after it.

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

No branches or pull requests

1 participant