Skip to content

MOD-16600 Bump LibMR to master on 8.4 - #2142

Merged
gabsow merged 1 commit into
RedisTimeSeries:8.4from
gabsow:tom.gabsow/bump-libmr-8.4
Aug 9, 2026
Merged

gabsow merged 1 commit into
RedisTimeSeries:8.4from
gabsow:tom.gabsow/bump-libmr-8.4

Conversation

@gabsow

@gabsow gabsow commented Aug 9, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • deps/LibMR a37b672 → c6a5ed62 (master)
  • topologyEvents=false at the MR_Init call site
  • INFOCLUSTER's status read from the end (n[-1]) instead of index 17, in tests/flow/includes.py and tests/flow/test_ts_libmr_failiure.py

Same shape as #2139 (which landed on 8.8), with the test fix that 8.8 still needs as a follow-up.

Why, and why it is not the same reason as 8.8

The mr.c:939 assertion that motivated #2139 cannot fire on this line — git grep -c MR_ExecutionBuilderInternalCommand returns 0 here versus 6 on 8.8, so no execution contains a StepType_InternalCommand step.

What this line does have is the silent half of the same race: MR_ClusterFree sets clusterCtx.clusterSize = 1 while MR_CreateExecution reads it on the main thread, and an execution wrongly flagged ExecutionFlag_Local skips the cross-shard collect — so TS.MRANGE / TS.MGET / TS.QUERYINDEX answer from the local shard with no error. #116 closes that by holding the Redis lock across the free/rebuild.

Also arriving, and wanted here:

commit why it matters on this line
#104 (MOD-16399) stops an argument-identical CLUSTERSET tearing down connections and aborting in-flight executions
#108 execution leak when an initiator execution is aborted after completing
#117 removes a live assert at the current pin — a37b672 src/cluster.c:1530 RedisModule_Assert(n->slotRanges->len == 1), trippable by a multi-range or slotless master from the RE extended ASM long form
#111 + #115 (MOD-16951) inter-shard TLS gating; see the caveat below

Why topologyEvents=false is correct, not just conservative

Redis on this line never emits the topology-change notification (the Enterprise cluster plugin logs Failed to load symbol: "clusterNotifyTopologyChanged"). Independently of that, MR_ClusterInit's entire diff between the two pins is clusterCtx.topologyEvents = topologyEvents;, and MR_TopologyEventSeen has exactly one setter — MR_UpdateClusterTopology() — which no release branch calls. So the gated branches are provably inert and false reproduces a37b672's behaviour.

Why the test change is required

#117 turns INFOCLUSTER's per-node reply from a fixed 18 elements into 14 + 4*ranges. The order is id, ip, port, unixSocket, runid, [minHslot, maxHslot]×N, pendingMessages, status — so status is last in both layouts. n[-1] is therefore correct before and after the bump, while n[17] silently reads a slot-range value once a node has more than one range, hanging verifyClusterInitialized rather than failing cleanly.

Two behaviour changes for the release notes

  1. Inter-shard TLS now requires tls-cluster=yes. TS.RANGE not returning results if Retention bigger than sample time #115 deletes fix #110 verify no empty label key or value are passed #111's long-form carve-out, so the tls-port != 0 fallback is gone for every topology form. The changed cell (tls-port set, tls-cluster not yes) goes from TLS to plaintext, and it fails open — checkTLS returns 0 and AUTH <internal password> is then sent in cleartext. Not reachable in RE steady state (CNM writes both settings together), but reachable during a live internode-encryption enable and permanently for a non-RE consumer with TLS endpoints. No release branch has a TLS test leg.
  2. Short-form CLUSTERSET is now fail-closed. MR_BuildCluster rejects a topology with a duplicate slot claim or coverage != 16384 instead of installing a degraded one. A rejection leaves the shard answering locally until the next successful CLUSTERSET, so rejecting topology / Cluster topology covers %zu of / is claimed by two master nodes in shard logs are worth alerting on. short_form_clusterset is in pack/ramp.yml on this line and tests/flow/test_asm.py is env.skip(), so only real Enterprise exercises it.

Verification

  • Builds clean for linux-arm64 in rockylinux:9 + gcc-toolset-13 — the toolchain behind the shipped rhel9-arm64 artifact.
  • Flow suite left to CI.
  • Not covered by any existing lane on this branch, and worth a deliberate soak before release: the TLS matrix above, and a cardinality assertion on multi-shard reads while hammering CLUSTERSET (a local-only reply is a correct-looking success, so an existence check will not catch it).

Note

Medium Risk
Touches multi-shard LibMR initialization (cluster reads/writes) and reflects a LibMR bump with TLS/topology behavior changes described in the PR; the diff itself is small but the dependency upgrade carries operational risk.

Overview
LibMR init now passes topologyEvents=false as the fourth argument to MR_Init in register_rg, matching this Redis line where topology-change notifications are unused and keeping behavior aligned with the pre-bump LibMR pin.

Cluster flow tests no longer read node status at fixed index 17 from timeseries.INFOCLUSTER; they use n[-1] so waits stay correct when per-node replies grow with variable slot-range fields (and status remains the last element).

Reviewed by Cursor Bugbot for commit 0b8d104. Bugbot is set up for automated code reviews on this repo. Configure here.

deps/LibMR a37b672 -> c6a5ed62, pass topologyEvents=false at MR_Init
(src/libmr_integration.c:796), and read INFOCLUSTER's status positionally from
the end instead of index 17.

The mr.c:939 assertion that motivated the 8.8 bump (RedisTimeSeries#2139) cannot fire on this
line -- there are no MR_ExecutionBuilderInternalCommand call sites here, so no
execution contains a StepType_InternalCommand step. What this line does have is
the silent half of the same race: MR_ClusterFree sets clusterCtx.clusterSize = 1
while MR_CreateExecution reads it on the main thread, and an execution wrongly
flagged ExecutionFlag_Local skips the cross-shard collect, so TS.MRANGE /
TS.MGET / TS.QUERYINDEX answer from the local shard with no error. RedisTimeSeries#116 closes
that by holding the Redis lock across the free/rebuild.

Taking master rather than cherry-picking RedisTimeSeries#116 alone also brings RedisTimeSeries#104
(MOD-16399, skip the rebuild for an unchanged CLUSTERSET), RedisTimeSeries#108 (execution leak
on an aborted initiator execution), RedisTimeSeries#111+RedisTimeSeries#115 (MOD-16951, inter-shard TLS), and
the RedisTimeSeries#117 INFOCLUSTER fix that removes a live assert here
(a37b672 src/cluster.c:1530, RedisModule_Assert(n->slotRanges->len == 1),
trippable by a multi-range or slotless master).

topologyEvents=false is correct rather than merely conservative: redis on this
line never emits the topology-change notification, and MR_ClusterInit's whole
diff between the two pins is 'clusterCtx.topologyEvents = topologyEvents;'.
MR_TopologyEventSeen has exactly one setter, MR_UpdateClusterTopology(), which
no release branch calls, so the gated branches are provably inert.

The test change is required by RedisTimeSeries#117, which turns INFOCLUSTER's per-node reply
from a fixed 18 elements into 14 + 4*ranges. status is the last element in both
layouts, so n[-1] is correct before and after the bump; n[17] silently reads a
slot-range value once a node has more than one range and hangs
verifyClusterInitialized.

Two behaviour changes worth naming in the release notes:
- Inter-shard TLS now requires tls-cluster=yes. RedisTimeSeries#115 deletes RedisTimeSeries#111's long-form
  carve-out, so the tls-port fallback is gone for every topology form.
- Short-form CLUSTERSET is now fail-closed: MR_BuildCluster rejects a topology
  with a duplicate slot claim or coverage != 16384 instead of installing a
  degraded one. Rejection leaves the shard answering locally until the next
  successful CLUSTERSET, so watch for 'rejecting topology' in shard logs.

Verified: builds clean for linux-arm64 in rockylinux:9 + gcc-toolset-13. Flow
suite left to CI.
@sonarqubecloud

sonarqubecloud Bot commented Aug 9, 2026

Copy link
Copy Markdown

@gabsow
gabsow merged commit 887b5f7 into RedisTimeSeries:8.4 Aug 9, 2026
15 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants