Open mdubbyap opened 6 years ago
Used proper message encodings and kafka tools to print out the contents of the disk and things looks fine there. It appears the logic here is messed up. https://github.com/travisjeffery/jocko/blob/master/commitlog/segment.go#L220
The || e.Offset == 0
i think is trying to differentiate from unused portions, but basically makes offset 1, always fail. Moreover, the error return of s.Index.ReadEntryAtFileOffset
is not being checked, and so e is not actually getting updated when seeking past where you've written to. With these two changes i can't break it anymore. I'll send you a PR.
@mdubbyap did you ever work on the PR?
Wrote a test for it, haven't determined if it's an issue with the index, or the what is written to the disk. If i'm doing something wrong, please let me know. Thanks!