Skip to content

MQTT: introduce limits for the retained message store (backport #17189) - #17190

Merged
michaelklishin merged 1 commit into
v4.3.xfrom
mergify/bp/v4.3.x/pr-17189
Aug 17, 2026
Merged

MQTT: introduce limits for the retained message store (backport #17189)#17190
michaelklishin merged 1 commit into
v4.3.xfrom
mergify/bp/v4.3.x/pr-17189

Conversation

@mergify

@mergify mergify Bot commented Aug 15, 2026

Copy link
Copy Markdown

This adds both size and message count limits to how much data can be retained via MQTT's retained messages feature. The protocol itself does not discuss any limits or safety protocols.

All retained messages flow through one code path, which is where the limits are applied.

The defaults are 100K messages (and as many topics [1]) per virtual host, or 1 GiB of data. I consider these to be very reasonable, even generous, for most MQTT workloads.

The accounting is not super precise because accounting for ETS/DETS metadata is hard but the way we compute message footprint passes the common sense check: mc_mqtt:size/1 returns the size of the topic plus message properties plus the payload, which is all we really need to account for to introduce a practical limit.

  1. given how message retention works
    This is an automatic backport of pull request MQTT: introduce limits for the retained message store #17189 done by Mergify.

This adds both size and message count limits.

(cherry picked from commit 6d6e90d)
@mergify

mergify Bot commented Aug 15, 2026

Copy link
Copy Markdown
Author

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@michaelklishin michaelklishin modified the milestones: 4.3.5, 4.3.6 Aug 15, 2026
@michaelklishin michaelklishin changed the title MQTT: introduce limits for the retained message store (backport #17189) DO NOT MERGE For after 4.3.5: MQTT: introduce limits for the retained message store (backport #17189) Aug 15, 2026
@michaelklishin michaelklishin changed the title DO NOT MERGE For after 4.3.5: MQTT: introduce limits for the retained message store (backport #17189) MQTT: introduce limits for the retained message store (backport #17189) Aug 17, 2026
@michaelklishin
michaelklishin merged commit a8d889b into v4.3.x Aug 17, 2026
188 checks passed
@michaelklishin
michaelklishin deleted the mergify/bp/v4.3.x/pr-17189 branch August 17, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant