-
Notifications
You must be signed in to change notification settings - Fork 521
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
Add WAL Checksums #418
Comments
Just to clarify, this would be serialized as part of an And the layout here would maybe go from
This feels like it might be a little gross, but would it make sense to maintain multiple WAL format parser? var LatestObjectBinaryFormat = objectBinaryFormatV1{}
type ObjectBinaryFormat interface {
MarshalObjectToWriter(id ID, b []byte, w io.Writer) (int, error)
UnmarshalObjectFromReader(r io.Reader) (ID, []byte, error)
UnmarshalAndAdvanceBuffer(buffer []byte) ([]byte, ID, []byte, error)
}
// | total length (uint32) | id length (uint32) | id (variable) | object bytes (variable) |
type objectBinaryFormatV0 struct {}
// | total length (uint32) | id length (uint32) | crc checksum (uint32) | id (variable) | object bytes (variable) |
type objectBinaryFormatV1 struct {} Finally, any thoughts on how to manage the WAL version? Encode in the filename? Magic bytes at the start of the file? Something else? |
Yes, I believe per object is the right way to go.
Yup, we are heading this way with the blocks as well: multiple parsers supporting multiple formats. These changes will be impacted by the refactoring done to support multiple backend blocks so this issue will probably be delayed until we get versioned blocks done.
I was thinking of a brief header would indicate the WAL version and other important information. If the header is absent then assume it's a "v0" block. |
#638 has given us the ability to have wal checksums by using compression. Considering this fixed with that PR. |
Is your feature request related to a problem? Please describe.
Currently our only indication that there is corruption in the WAL is that proto fails to Unmarshal. Add a checksum here so we can more robustly detect corruption issues.
Describe the solution you'd like
Additional context
Unfortunately this may require versioning and abandoning previous WAL files on upgrade. We need to determine if there's anyway to handle the old WAL file format and the new. Given that we're still in 0.x I'm ok with the upgrade including a dropped WAL as long as this is documented as well as ways to preserve data.
The text was updated successfully, but these errors were encountered: