Skip to content

Fix for lib mrci#81

Closed
gabsow wants to merge 22 commits into
masterfrom
fixForLibMRCI
Closed

Fix for lib mrci#81
gabsow wants to merge 22 commits into
masterfrom
fixForLibMRCI

Conversation

@gabsow

@gabsow gabsow commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Note

High Risk
Touches cluster inter-node messaging and execution lifecycle, adding a new internal-command path that runs commands on the main thread and aggregates hiredis replies; bugs here could impact cluster stability or correctness.

Overview
Adds cluster-wide internal command executions to LibMR. Executions can now be built from an empty builder using MR_CreateEmptyExecutionBuilder() and populated with MR_ExecutionBuilderInternalCommand() steps, distributed using a FUNCTION_ID_INTERNAL flag, executed on recipients’ main thread (MR_ClusterExecuteInternalCommands), and aggregated via RESP-array replies parsed in the event loop (MR_SetInternalCommandResults) before completion.

Refactors cluster messaging to distinguish status vs data responses, includes sending internal messages to self when broadcasting, assigns per-node indices for result routing, and centralizes/auth-retries AUTH on connect/hello failures. Also fixes multiple API/typo issues and naming cleanup (e.g., MR_ExecutionBuilderBuildAccumulate, MR_ClusterGetSlotByKey, MR_RecordInitialize, nReceived, array_trim, and Rust FFI binding update).

Written by Cursor Bugbot for commit eeecfff. This will update automatically on new commits. Configure here.

galcohen-redislabs and others added 21 commits February 3, 2026 20:07
Initial additions of the needed types and functions.

(cherry picked from commit 95fc9cc)
(cherry picked from commit c66873c)
… under internal commands

(cherry picked from commit 597d0ac)
(cherry picked from commit 7c5792a)
(cherry picked from commit d2cd1df)
(cherry picked from commit e64de66)
(cherry picked from commit f2e283d)
Avoid newer setuptools behavior in Linux and macOS workflows.
…o no need for the MR_ExecutionCtxSetDone() anymore
Comment thread src/mr.c Outdated
Comment thread src/mr.c
Commit 886d9ab introduced an early-return when MR_ExecutionInvokeCallback
returns false (NULL callback). On non-initiator shards the done callback
is never set, so both MR_RunExecution and MR_ExecutionTimedOutInternal
bailed before completing termination—skipping NOTIFY_DONE and
MR_FreeExecution respectively. This caused resource leaks that made
Redis exit uncleanly under Valgrind.

Restore master's behavior: invoke the callback (no-op if NULL), set it
to NULL, and always continue the full termination flow.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread src/mr.c
// All nodes (shards), including myself, have answered
MR_ExecutionAddTask(e, MR_RunExecution, NULL);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unused nodeIndex parameter in API function

Low Severity

The nodeIndex parameter of MR_SetInternalCommandResults is declared in the public API, passed by the caller (MR_OnDataResponseArrived passes node->index), but never referenced in the function body. The Node.index field was also added specifically for this purpose but provides no value currently. This dead parameter clutters the API and may indicate an incomplete implementation for correlating results with specific nodes.

Additional Locations (1)

Fix in Cursor Fix in Web

@gabsow gabsow closed this Feb 18, 2026
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