Skip to content

Improve boot sequence. - #61

Merged
ieQu1 merged 21 commits into
masterfrom
dev/rl-barriers
Oct 3, 2026
Merged

ieQu1 merged 21 commits into
masterfrom
dev/rl-barriers

Conversation

@ieQu1

@ieQu1 ieQu1 commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Fixes: #27

Completely rework the run level concept.

@ieQu1
ieQu1 marked this pull request as ready for review September 25, 2026 11:15
@ieQu1 ieQu1 changed the title Dev/rl barriers Improve boot sequence. Sep 25, 2026
@ieQu1
ieQu1 requested a balanced review from Copilot September 25, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Compilation, persistence compatibility, run-level validation, and boot API correctness issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 High severity · 7 Medium severity

Open (10)
What changed in this PR

Reworks boot sequencing around integer run levels and barriers, replacing classy_rl_changer.

Changes:

  • Adds classy_boot with barrier-controlled transitions.
  • Updates hooks, votes, liveness, supervision, and tests.
  • Adds public run-level constants and updates documentation.
File Description
src/​classy_boot.erl Implements boot and barrier management.
src/​classy_rl_changer.erl Removes the former run-level manager.
src/​classy.erl Exposes the revised run-level API.
src/​classy_node.erl Controls cluster and quorum barriers.
src/​classy_sup.erl Supervises the new boot manager.
src/​classy_hook.erl Registers new boot metadata hooks.
src/​classy_builtin_hooks.erl Emits enter/leave events.
src/​classy_liveness.erl Adopts enter/leave hook semantics.
src/​classy_lib.erl Adds quorum configuration access.
src/​classy_internal.hrl Defines run-level validation and events.
include/​classy.hrl Includes public run-level constants.
include/​classy_rl.hrl Defines numeric run levels.
src/​classy_vote.erl Adapts vote scheduling to ranges.
src/​classy_vote.hrl Updates persisted run-level typing.
src/​classy_vote_coordinator.erl Updates coordinator restoration types.
src/​classy_vote_participant.erl Uses the new boot state.
src/​test/​classy_ct.erl Updates run-level test hooks.
src/​test/​classy_test_fuzzer.erl Updates synchronization and diagnostics.
test/​classy_SUITE.erl Tests barriers and revised transitions.
doc/​classy.texi Documents the quorum default.
rebar.config Updates Meck to 1.2.0.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/classy_internal.hrl Outdated
Comment thread src/classy_sup.erl
Comment thread src/classy_vote.hrl Outdated
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_lib.erl Outdated
Comment thread src/classy_node.erl Outdated
Comment on lines +767 to +769
to_stopped(Reason, _Timeout) -> % FIXME
prep_stop(Reason),
classy_rl_changer:set_sync(?stopped, Timeout).
classy_boot:stop_system().
Comment thread src/classy_vote.erl
Comment on lines 456 to +457
verify_run_level(#{}) ->
{ok, classy_rl_changer:to_int(?cluster)}.
{ok, ?classy_rl_cluster}.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread src/classy_node.erl Outdated
Comment thread src/classy_node.erl Outdated
Comment thread src/classy_vote.erl
Comment thread src/classy_lib.erl
Comment thread test/classy_SUITE.erl Outdated
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_boot.erl

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_boot.erl
Comment thread src/classy_vote.erl

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread src/classy_boot.erl
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_boot.erl
Comment thread src/classy_boot.erl Outdated
Comment thread src/classy_lib.erl Outdated
@ieQu1
ieQu1 requested a balanced review from Copilot October 3, 2026 23:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread src/classy_node.erl
classy_table:flush(?tab),
classy_table:flush(?site_info),
to_stopped(shutdown, infinity),
to_stopped(shutdown),
Comment on lines +98 to +102
classy_boot:with_ready(
RunLevel,
fun() ->
classy_sup:ensure_vote_coordinator([true, {ID, Options}])
end).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is accepted for now, see comment.

@ieQu1
ieQu1 merged commit af0fc41 into master Oct 3, 2026
5 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.

Do not lower run level on rl_changer terminate

2 participants