Skip to content

Add MIGRATE_MODULE_PROPAGATE_END event to propagate module commands at the end of slot migration#472

Open
sundb wants to merge 3 commits into
unstablefrom
asm-propagate-end
Open

Add MIGRATE_MODULE_PROPAGATE_END event to propagate module commands at the end of slot migration#472
sundb wants to merge 3 commits into
unstablefrom
asm-propagate-end

Conversation

@sundb

@sundb sundb commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Background

During atomic slot migration (ASM), modules can already propagate commands to
the destination node at the beginning of the migration via the
REDISMODULE_SUBEVENT_CLUSTER_SLOT_MIGRATION_MIGRATE_MODULE_PROPAGATE event and
the RM_ClusterPropagateForSlotMigration() API. Those commands are delivered as
the first part of the migration stream, before the slot snapshot.

There was no equivalent hook to propagate commands at the end of the
migration, which some modules need to keep their own state consistent on the
destination side.

What this PR does

Adds a new sub-event
REDISMODULE_SUBEVENT_CLUSTER_SLOT_MIGRATION_MIGRATE_MODULE_PROPAGATE_END,
fired on the source node at the very end of the migration — right before the
STREAM-EOF is sent to the destination. Modules use the same
RM_ClusterPropagateForSlotMigration() API to enqueue commands; they are
delivered as the last part of the migration stream.

Sub-event Context Delivery position
MIGRATE_MODULE_PROPAGATE RDB fork child, before snapshot first
MIGRATE_MODULE_PROPAGATE_END main process, before STREAM-EOF last

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.

1 participant