Skip to content

feat: Add replica events#213

Merged
ieQu1 merged 3 commits into
mainfrom
dev/replica-status-events
May 28, 2026
Merged

feat: Add replica events#213
ieQu1 merged 3 commits into
mainfrom
dev/replica-status-events

Conversation

@ieQu1

@ieQu1 ieQu1 commented May 27, 2026

Copy link
Copy Markdown
Member

No description provided.

@coveralls

coveralls commented May 27, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 1068

Warning

No base build found for commit cfa6e88 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 50.79%

Details

  • Patch coverage: 10 uncovered changes across 2 files (11 of 21 lines covered, 52.38%).

Uncovered Changes

File Changed Covered %
src/mria_rlog_replica.erl 15 9 60.0%
src/mria.erl 4 0 0.0%
Total (3 files) 21 11 52.38%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 2404
Covered Lines: 1221
Line Coverage: 50.79%
Coverage Strength: 1656.48 hits per line

💛 - Coveralls

Comment thread include/mria.hrl
thalesmg
thalesmg previously approved these changes May 27, 2026
Co-authored-by: Thales Macedo Garitezi <16166434+thalesmg@users.noreply.github.com>

Copilot AI 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.

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/2 and mria:unsubscribe_replica_events/2 API endpoints.
  • Emit #mria_replica_status_update{} events from mria_rlog_replica on state transitions and add an ETS-backed subscription registry.
  • Add a CT testcase t_replica_state_events/1 to 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.

Comment thread src/mria_rlog.erl
Comment thread src/mria_rlog_replica.erl
Comment thread src/mria.erl
Comment thread test/mria_SUITE.erl Outdated
@ieQu1 ieQu1 requested a review from thalesmg May 27, 2026 15:49
@ieQu1 ieQu1 merged commit 20ebe9f into main May 28, 2026
2 checks passed
@ieQu1 ieQu1 deleted the dev/replica-status-events branch May 28, 2026 07:29
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.

5 participants