Skip to content

Allow non-denyoom commands in MULTI on OOM - #12888

Closed
eladbern wants to merge 1 commit into
redis:unstablefrom
eladbern:eladbern/unstable
Closed

eladbern wants to merge 1 commit into
redis:unstablefrom
eladbern:eladbern/unstable

Conversation

@eladbern

@eladbern eladbern commented Dec 26, 2023 •

Copy link
Copy Markdown

Allow queuing of multi commands up to 32kb when server is at maxmemory as long as there are no DENY-OOM commands.
Fixes: #9926

@eladbern eladbern changed the title Allow non-denyoom commands in MULTI on OOM Allow non-denyoom commands in MULTI on OOM https://github.com/redis/redis/issues/9926 Dec 26, 2023
@eladbern eladbern changed the title Allow non-denyoom commands in MULTI on OOM https://github.com/redis/redis/issues/9926 Allow non-denyoom commands in MULTI on OOM Dec 26, 2023
Comment thread src/server.c
* contains denied commands, in which case is_denyoom_command is already
* set. */
if (c->flags & CLIENT_MULTI &&
c->mstate.argv_len_sums > MULTI_MAX_BYTES_ON_OOM &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
c->mstate.argv_len_sums > MULTI_MAX_BYTES_ON_OOM &&
c->mstate.argv_len_sums > server. proto_max_bulk_len &&

I'm still going to advocate this should be a config, since I think it's possible 32k will be too low.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok, fair enough, clients can easily consume that amount of memory without multi-exec, so i'm fine using that limit (1gb).
but then i'd remind you that for unauthenticated clients we have a limit of 16k

} else if (ll > 16384 && authRequired(c)) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I suppose this loophole still exists today as long as the server is not at max memory

@madolson

Copy link
Copy Markdown
Contributor

@madolson madolson added the state:to-be-closed requesting the core team to close the issue label Jan 27, 2024
@oranagra oranagra closed this Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:to-be-closed requesting the core team to close the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Any command used in MULTI fails when used_memory > maxmemory

3 participants