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

wal: expose a function to validate the wal contents #10497

Closed
shreyas-s-rao opened this issue Feb 22, 2019 · 3 comments
Closed

wal: expose a function to validate the wal contents #10497

shreyas-s-rao opened this issue Feb 22, 2019 · 3 comments

Comments

@shreyas-s-rao
Copy link
Contributor

Is there a way to verify that the wal contents are not corrupted?

My use case involves a corruption check for the data directory before starting etcd. I have been using the wal.ReadAll() function to read through the wal contents and ensure that there are no errors in the read. But this consumes large memory for large wal sizes during high workloads, because the function returns the entire contents of the wal in memory (in the ents slice). My use case of simply verifying the integrity of the wal does not require the function returning the wal contents, but just the error from the read.

Would it be possible to expose a new function, say something like wal.Verify() that just iterates through the wal records and ensures the validity of the wal? This function would probably omit the ents array so that memory consumption is minimal, and would return only the error back to the caller. This would allow a more streamlined, lightweight version of the wal.ReadAll() function that provides verification functionality for the wal contents.

@shreyas-s-rao
Copy link
Contributor Author

/cc @gyuho

@xiang90
Copy link
Contributor

xiang90 commented Feb 26, 2019

@shreyas-s-rao

I do not think we need this feature for etcd at least for now. If you want to use wal pkg for external use, I am fine with adding this feature and contributing it to the etcd codebase :)

Verify seems to be a good method name.

@shreyas-s-rao
Copy link
Contributor Author

Sure @xiang90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants