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

Enhance the WAL file related error #14300

Merged
merged 1 commit into from
Aug 6, 2022
Merged

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Aug 2, 2022

This PR should be helpful to debug #14252

The ErrFileNotFound was used for for three cases:

  1. There is no any WAL files (probably due to no read permission);
  2. There is no WAL files matching the snapshot index;
  3. The WAL file seqs do not increase continuously.

It's not good for debug when users see the ErrFileNotFound error,
so in this PR, a different error is returned for each case above.

Signed-off-by: Benjamin Wang wachao@vmware.com

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

The `ErrFileNotFound` was used for for three cases:
1. There is no any WAL files (probably due to no read permission);
2. There is no WAL files matching the snapshot index;
3. The WAL file seqs do not increase continuously.

It's not good for debug when users see the `ErrFileNotFound` error,
so in this PR, a different error is returned for each case above.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
@ahrtr
Copy link
Member Author

ahrtr commented Aug 2, 2022

cc @spzala @ptabor

Copy link
Member

@spzala spzala left a comment

Choose a reason for hiding this comment

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

@ahrtr thanks, this can be very helpful with debugging. I don't see anything rely on the return err, ErrFileNotFound but to be on safe side, probably good idea to update CHANGELOG around error enhancement? (e.g. Verify() in the wal.go will return different error with these changes) Thanks!

@ahrtr
Copy link
Member Author

ahrtr commented Aug 4, 2022

probably good idea to update CHANGELOG around error enhancement? (e.g. Verify() in the wal.go will return different error with these changes)

Thanks @spzala for the comment. I thought about updating the CHANGELOG, but didn't do it, reasons:

  1. We do not have detailed document on WAL, so nobody will understand the CHANGELOG item without digging into the source code;
  2. The change is a very minor change and just to enhance the error message, which is only useful for debugging related issue.

So I'd like not to update the CHANGELOG, what do you think?

@spzala
Copy link
Member

spzala commented Aug 6, 2022

probably good idea to update CHANGELOG around error enhancement? (e.g. Verify() in the wal.go will return different error with these changes)

Thanks @spzala for the comment. I thought about updating the CHANGELOG, but didn't do it, reasons:

1. We do not have detailed document on WAL, so nobody will understand the CHANGELOG item without digging into the source code;

2. The change is a very minor change and just to enhance the error message, which is only useful for debugging related issue.

So I'd like not to update the CHANGELOG, what do you think?

@ahrtr ok, that's fair. It's minor as you said and I don't have a hard opinion.

@spzala spzala merged commit 871d8fd into etcd-io:main Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants