-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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: removes entry size limit #14057
Conversation
zeroMb := 0 | ||
oneMb := 1 * 1024 * 1024 | ||
twentyMb := 20 * 1024 * 1024 | ||
for _, entrySize := range []int{zeroMb, oneMb, twentyMb} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use subtest instead. There are lots of examples, such as discovery_test.go#L66
zeroMb := 0 | ||
oneMb := 1 * 1024 * 1024 | ||
twentyMb := 20 * 1024 * 1024 | ||
for _, entrySize := range []int{zeroMb, oneMb, twentyMb} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use subtest instead.
Overall looks good to me. Please fix the comments and see issuecomment-1133780272 |
@@ -84,10 +79,6 @@ func (d *decoder) decodeRecord(rec *walpb.Record) error { | |||
} | |||
|
|||
recBytes, padBytes := decodeFrameSize(l) | |||
if recBytes >= maxWALEntrySizeLimit-padBytes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was defensive protection against OOMing or consuming whole server memory in case of a corrupted frame.
I agree with @ahrtr suggestion from: #14025 (comment) to use:
etcd/server/storage/wal/wal.go
Line 55 in 8093fc9
SegmentSizeBytes int64 = 64 * 1000 * 1000 // 64MB |
And refuse configs where --max-request-bytes > SegmentSizeBytes/4=16MB
I think it got obsolete by: |
Solves #14025
I don't fully get the reason the entry size limit was introduced.
I have added tests that show that the entry size that is currently set as maximum can be exceeded, without compromising the wal functionalities.