Skip to content

Update wal.go#7

Open
yanmaipian wants to merge 1 commit into
aarthikrao:mainfrom
yanmaipian:fix-logic
Open

Update wal.go#7
yanmaipian wants to merge 1 commit into
aarthikrao:mainfrom
yanmaipian:fix-logic

Conversation

@yanmaipian

Copy link
Copy Markdown

fix previousOffset is always less than offset

logic error
@yanmaipian

Copy link
Copy Markdown
Author

Fix the logic error that previousOffset is always less than offset

Comment thread wal.go
}
if previousOffset <= offset && offset <= startingOffset {

if offset <= startingOffset {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The format for the file name is wal.{file_Count}.{starting_offset_in_wal_file}
Here starting_offset_in_wal_file tells us what offset the file starts from. We later increment this in the func (wal *WriteAheadLog) Replay. This offset helps us to maintain the track of the offset so far.

With the changes you have proposed, we are not updating this offset.

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