feat: Add replica events#213
Merged
Merged
Conversation
Coverage Report for CI Build 1068Warning No base build found for commit Coverage: 50.79%Details
Uncovered Changes
Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
thalesmg
reviewed
May 27, 2026
thalesmg
previously approved these changes
May 27, 2026
Co-authored-by: Thales Macedo Garitezi <16166434+thalesmg@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a new (explicitly unstable) API for subscribing to replicant replica-state transition events per shard, and adds a CT test to validate event emission across core shutdown/restart scenarios.
Changes:
- Add
mria:subscribe_replica_events/2andmria:unsubscribe_replica_events/2API endpoints. - Emit
#mria_replica_status_update{}events frommria_rlog_replicaon state transitions and add an ETS-backed subscription registry. - Add a CT testcase
t_replica_state_events/1to verify the expected status transition sequence.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
test/mria_SUITE.erl |
Adds a CT test validating replica state event sequences during bootstrap and reconnect. |
src/mria.erl |
Exposes public API functions to subscribe/unsubscribe to replica state events. |
src/mria_rlog.erl |
Initializes replica event ETS table during app startup. |
src/mria_rlog_replica.erl |
Implements subscription storage and broadcasts state transition events. |
include/mria.hrl |
Adds include-guard and defines #mria_replica_status_update{} record. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zmstone
approved these changes
May 27, 2026
thalesmg
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.