Skip to content

Commit

Permalink
fix: offset of append context (vanus-labs#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
ifplusor authored May 27, 2022
1 parent 3a4a8b6 commit e50c426
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/store/block/file/append.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (b *Block) NewAppendContext(last *block.Entry) block.AppendContext {
full = 1
}
return &appendContext{
offset: last.Offset + uint32(len(last.Payload)),
offset: last.Offset + uint32(last.Size()),
num: last.Index + 1,
full: full,
}
Expand Down Expand Up @@ -196,6 +196,7 @@ func (b *Block) checkEntries(ctx context.Context, entries []block.Entry) error {
"blockID": b.id,
"offset": offset,
"wo": b.actx.offset,
"index": entries[0].Index,
})
return errors.ErrInternal
}
Expand Down

0 comments on commit e50c426

Please sign in to comment.