Skip to content

Only use the provider conf.d file we are testing - #5

Merged
Akm0d merged 1 commit into
Akm0d:cloud_test_optimizationfrom
Ch3LL:cloud_provider_files
Aug 19, 2019
Merged

Akm0d merged 1 commit into
Akm0d:cloud_test_optimizationfrom
Ch3LL:cloud_provider_files

Conversation

@Ch3LL

@Ch3LL Ch3LL commented Aug 19, 2019

Copy link
Copy Markdown

No description provided.

@Akm0d
Akm0d merged commit e58b40a into Akm0d:cloud_test_optimization Aug 19, 2019
dwoz added a commit that referenced this pull request Dec 2, 2019
Akm0d pushed a commit that referenced this pull request May 8, 2026
Closes three gaps identified in the Raft correctness audit.

Dynamic join — joiner starts as learner (priority #2 & #6)
-----------------------------------------------------------
A master that joins via discover_peers starts _publish_daemon before the
join handshake completes, so cluster_peers is empty and RaftService is not
started.  Once join-reply arrives the MasterPubServerChannel now calls
_start_raft_as_learner(), which:
  - builds pushers to every peer received in join-reply (fixes gap #6:
    dispatcher had no pushers to reply to the leader)
  - starts RaftService with voting=False (fixes gap #2: joiner was starting
    as a voter, risking split-brain before the leader promoted it)

salt/channel/server.py
- _start_raft_as_learner(known_peers): new helper started from the
  join-reply handler; builds peer pushers and calls
  RaftService(voting=False).
- join-reply handler: calls _start_raft_as_learner after event.set().

salt/cluster/consensus/service.py
- RaftService(voting=True): new optional parameter passed to Node so the
  node starts in learner mode when the master joined dynamically.

Founding CONFIG entry (priority #5)
-------------------------------------
The first elected leader of a fresh cluster now writes a CONFIG entry
recording the founding voter set before any application entries.  This
makes cluster membership durably verifiable from the log alone.

salt/cluster/consensus/service.py
- _maybe_commit_founding_config(): proposes {voters, learners} CONFIG entry
  when the leader's log is empty; no-ops if the log already has content.
- _heartbeat_tick: calls _maybe_commit_founding_config() on every tick
  while leader (the guard makes it idempotent).

Tests
-----
tests/pytests/functional/cluster/consensus/test_raft_service.py
- TestFoundingConfig: leader writes CONFIG entry on empty log; no-ops if
  log is non-empty.
- TestDynamicJoinerAsLearner: RaftService(voting=False) produces a
  non-voting node; learner-mode service does not start elections.
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