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: removes entry size limit #14057

Closed
wants to merge 1 commit into from

Conversation

algobardo
Copy link

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.

zeroMb := 0
oneMb := 1 * 1024 * 1024
twentyMb := 20 * 1024 * 1024
for _, entrySize := range []int{zeroMb, oneMb, twentyMb} {
Copy link
Member

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} {
Copy link
Member

Choose a reason for hiding this comment

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

Please use subtest instead.

@ahrtr
Copy link
Member

ahrtr commented May 21, 2022

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 {
Copy link
Contributor

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:

SegmentSizeBytes int64 = 64 * 1000 * 1000 // 64MB

And refuse configs where --max-request-bytes > SegmentSizeBytes/4=16MB

@ptabor
Copy link
Contributor

ptabor commented Jun 21, 2022

@ptabor ptabor closed this Jun 21, 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.

3 participants