Skip to main content

Control-Plane Cluster Behaviour and Limits

On this page

This page explains how a three-member control-plane cluster behaves when members fail, and what this release does not do.

The community distribution carries neither the cluster runtime nor any cluster command: the cluster engine stays in this repository behind the dqlite build tag, and the default build leaves it out. The installation commands, the database helper gpuworks-dqlite, and its native build come with a distribution that ships the cluster runtime; see that distribution's documentation for the installation steps.

Composition

  • Each of the three members runs one gpuworks server. The server is a pure Go program; the database is carried by the helper gpuworks-dqlite that it starts. The three helpers use mutual TLS with member certificates and replicate one database.
  • All three members are voters; a write needs two of them to confirm it.
  • Users and agents reach only one stable entry (a load balancer or a keepalived VIP). Member addresses are not a supported entry.
  • The default build and macOS remain a single SQLite node and do not join a cluster.

Behaviour on Failure

  • One member lost: the other two keep serving. The entry should forward requests to members that answer 200 on GET /api/v1/readyz.

  • The majority lost: the remaining member refuses management writes with 503; it does not shrink the membership to keep writing.

  • Scheduling follows the database leader: only the member that holds the database leader runs the scheduling and control loops; after the leader changes, the new leader takes over. There is no separate scheduling lease.

  • Business is served by the member that leads the database. Any other member that receives a business request (management API, console, /v1 inference, an agent connecting) hands it over unchanged on the mutual-TLS channel between members, so the answer through the entry is the same whichever member it lands on. /healthz and /api/v1/readyz are answered by the member that received them. A member that cannot observe a leader for the moment answers business requests with 503, which the entry may retry.

  • A write sent to a member that cannot commit it: it answers 503, nothing is committed, and the entry can send the request to another member.

  • A member that has not opened business (just started, cut off from the majority, or with materials not yet verified): business requests and /api/v1/readyz both answer 503 with the body member business service is not ready.

  • Why a member refused a request: the 503 above, and the 403 the leader gives a request forwarded by a member it does not admit, carry the response header X-Gpuworks-Refusal, whose value is one of the codes below. It is given before authentication and holds the code only, no address and no identity. Once a refusal has happened, GET /api/v1/healthz with a token has one more field, business_refusals: the count per code since the process started. Both are diagnostics for operators and collectors; the codes may change between releases, and clients must not depend on them.

    CodeMeaning
    no_business_generation, generation_changed, no_business_handlerThe member's business handler is not installed yet, or was withdrawn under the request
    cluster_upgradeBusiness is closed for a cluster upgrade
    proof_missing, proof_expired, proof_stopped, proof_run_canceled, proof_canceled, proof_not_eligibleThe member has no valid confirmation of its membership at the moment
    member_revokedThe database refused this member's admission: it was revoked
    cluster_identity_conflictThe database is another cluster's, or its protocol version is not this program's
    sessions_not_routable, target_not_currentThe member cannot accept session calls, or its target version is not the current one
    no_known_leader, not_the_leader, leader_unreachableNo leader was observed in the last few seconds; a forwarded request reached a member that does not lead; the forward to the leader failed
    forward_peer_unidentified, forward_not_ready, forward_peer_undecided, forward_peer_not_admittedOn the leader: the forwarding side has no member certificate; the member route is not ready; no answer about the forwarding member; the forwarding member is not admitted (403)
    proof_headroom, proof_epoch_changed, proof_owner_changed, renewal_unavailable, request_canceled, request_deadlineOnly on /api/v1/readyz: the confirmation ends too soon or changed under the probe; the probe was cancelled or ran out of time
    otherA reason this table does not name
  • Why a member closed its business: when a member closes its business admission it leaves one log line, closed business admission, whose caller is one of the causes below; first_of_period says whether it is the first close of this closed period. Each cause is logged once per closed period. Once the member is closed, the confirmation's own failures no longer leave this line; they are in candidate material proof failed while business admission is closed. Recovery leaves candidate material proof succeeded after business admission closed, where close_callers is the number of causes seen in the period. caller only ever holds a word of this table, no function name and no line number; a collector that matches the earlier form (for example caller=app.(*materialEligibility).Reprove:422) must match these words instead. Like the refusal codes they are diagnostics and may change between releases.

    callerMeaning
    proof_failedA confirmation of membership ended on a negative finding, or got no answer for too long
    proof_expiredThe last confirmation ran out
    proof_canceled, proof_context_ended, proof_run_canceledThe confirmation in progress was cancelled; its context ended for another reason than its own time limit; the background task ended before a confirmation could start
    proof_stopped, member_stoppingThe confirmation's background task was stopped; the member is stopping its own business
    transport_refresh_refused, writer_refusedThe refresh of the member-to-member admission ended on a negative finding; the database refused a write because the member is no longer admitted
    member_absent, own_origin_changed, origin_registeredThe member is not in the observed member list; the member's enrollment address is not the registered one; a member registered a changed address
    material_probe_rejected, material_startup_rejected, material_check_rejected, material_pass_rejectedA check of the key files ended on a negative finding: the probe of the published manifest, the first copy after start, the periodic check of the installed files, a copy pass
    material_received, material_installedA change to the key files arrived from another member; a copy pass changed this member's installed key files
    otherA cause this table does not name
  • A short storage stall: a member admits requests on the membership it last confirmed. The confirmation is renewed in the background every few seconds and no request waits for it, so a storage stall of a few seconds neither refuses nor delays a request for authorization. While a renewal gets no answer (a storage stall, a timeout, no database leader) the member keeps admitting requests, and closes business only when no renewal has succeeded for 60 seconds after the start of the last successful confirmation. A pass that copies the members' key files to the other members and runs out of time, finds no database leader, or for the moment gets no answer from a majority of members (one member down and another refusing just then, for example) does not close the member either; files that differ from what was verified, are missing or cannot be read do.

  • After a member is revoked or cut off:

    • Writes: a revoked member's write is refused before it commits, even while the member still reaches the database leader, and the member then closes its own business; a member cut off from the majority could not commit anyway. A check that itself fails (writer taken, no leader, a dropped connection, a timeout) is not a refusal and is returned to the caller as it is. The writes that decide membership itself, loading a backup or an import into an empty database, and the server's own work at startup do not pass this check.
    • Reads and inference requests: when the database answers that the member was revoked, the member closes at once; once a background confirmation has been refused, requests on it get 503 with the refusal code member_revoked (when a refused write closed it first, or the process has just restarted, the code is proof_missing for the few seconds until the next confirmation is refused); a background confirmation starts at most 4 seconds after the previous one succeeded, so a member that writes nothing still closes within a few seconds of its revocation. Only a refusal of the member itself closes it at once: the revocation of another member, or a maintenance phase in which the cluster does not serve, does not. This release has no command that revokes or removes a single member: a revocation only happens in a restore from a backup, which yields a cluster of one member that the others join again, so a member that is revoked yet still in the database's membership does not occur. When its renewals get no answer, at most 60 seconds after the start of its last successful confirmation; until then it answers from the data it last saw. For what the log shows, see the troubleshooting guide.
    • Connections between members: admitted on a member list confirmed within the last 15 seconds, and for at most 60 seconds when it cannot be confirmed, the same limit as for the member's own requests; a member revoked during a storage stall is therefore still accepted by the others for up to 60 seconds. The member that commits a revocation drops its list at once. A connection that is already open is checked only when it is opened.

Limits

These are limits of this release.

  • In-flight streams are not resumed. On a failover, streamed answers and image or model transfers that are already open end with the member that holds them; the client has to start again. A failure after a request has been forwarded is not retried.
  • When the leader changes, agents stay connected and inference requests in progress are cut. An agent's connection stays on the member that accepted it, which attaches it to the leader. After the lead moves to another member, that member attaches it to the new leader, and the agent only receives its full desired state once more. For that time (about one to a few seconds, as measured) the node may briefly show as connecting, inference requests through it get 503, and calls awaiting an answer and open streams (log tails, terminals, transfers) are cut. When the member that accepted an agent's connection stops, that agent reconnects. Running instances are not affected. All business traffic passes through one member: the cluster adds availability, not capacity.
  • A member key is revoked only by a restore from a backup. This release has no command that revokes a single member while the cluster runs. A restore requires every member to be stopped, and the member it builds refuses database connections of the revoked keys from its first start; a running member never adds a revocation to its own database connection policy. On the revoked member itself, writes are refused at once and its business closes at its next confirmation, within seconds.
  • There is no recovery-time guarantee. Writes resume after a leader election and after members reopen business; the time depends on the storage's synchronous write latency and on the network. It grows clearly on slow disks; no number of seconds is guaranteed here. The storage tier settled at installation sets the election wait; what it lists is a recovery target, not a guarantee.
  • A member is not upgraded, restarted or stopped with the single-server commands. gpuworks upgrade, gpuworks restart, gpuworks stop and the upgrade in the console act on one server only; they do not know the member's own service unit, its database helper or the other members. On a cluster member's installation they refuse and change nothing. A cluster is upgraded with gpuworks cluster upgrade of the edition that provides the cluster; a member is started and stopped through its own service unit.
  • Fewer than three members is not supported, and members are not removed by hand. With two members the database helper keeps a single voter and the other member stops receiving data, so one more failure stops the cluster. When a member's host fails, leave it in the membership: two of the three voters remain and still commit writes. This release has no procedure for replacing a member. When a member has left or lost its vote, or a voter cannot be reached, the cluster status report says Overall: degraded with the reason instead of ready; a cluster that is still being formed does not count: within five minutes of its newest admission, with no member ever revoked.
  • Backups are manual, and a restore stops the whole cluster. A cluster takes no backups by itself. One member can write the complete database image, the master key, the cluster identity and the files the database refers to into one archive while the cluster keeps serving; for a restore every member is stopped, the member that took the backup rebuilds its data directory from the archive, and the other two join again. Writes and login sessions made after the archive do not exist after a restore. The backup of the single-server gpuworks upgrade does not apply to a cluster: the replicated database refuses the snapshot method it uses.
  • The first start is slow. Migrations on a new database commit one by one and are synchronized to the majority.
  • Only Linux amd64 members are supported; the helper is the only artifact that uses cgo.

Storage Tiers

Every commit in the cluster waits for a majority of members to finish one synchronous write. The database holds a new election after it has not reached the leader for some time; the storage tier sets that time, and the three members must agree on it. The tier is settled at installation and recorded by the first node as storage_tier in <data directory>/cluster-enrollment/config.json (standard writes no key); the other members get it from the cluster when they join.

TierWait before a follower starts an electionSuitable storageRecovery target after the leader process is killed
standard150–300 msSynchronous writes never stall for 150 ms or more10 seconds
slow-storage0.75–1.5 sSynchronous writes stall for hundreds of milliseconds to seconds (such as shared network storage)6 seconds

The recovery targets come from a small measured sample and are no guarantee for other storage. When the storage of all three members stalls for seconds at once, requests fail in both tiers.

A tier name can be followed by the database latency it runs at, for example slow-storage@100ms: whole milliseconds, 10 to 200, and one timing has one spelling: a latency that is a tier's own value (10 ms for standard, 50 ms for slow-storage) is that tier, and any other latency is written on slow-storage (standard@50ms is recorded as slow-storage). Only this version and later know the spelling with a latency; an earlier server that reads it refuses to start. Every other time of the database follows from the latency: the heartbeat interval is 1.5 times it and the election timeout 15 times (a leader steps down after that long without answers from a majority, and a follower starts an election after one to two election timeouts). Two more things follow it: the time a membership grant is retried for (two election timeouts plus one commit, no less than 2.2 seconds and no more than 4.7 seconds; from a latency of about 140 ms an election can take longer than that) and the recovery target (the two additional election timeouts are added). Above a latency of 50 ms two windows that are otherwise fixed grow in proportion as well: the 3 seconds for which the business layer acts on a leader observation (6 seconds at 100 ms, 12 seconds at 200 ms), and the 3 seconds after which a connection between members is closed without an acknowledgement (likewise 6 and 12 seconds); otherwise an ordinary election would make every member refuse business, or close the connection at the moment the leader steps down. What does not change with the latency is the 5-second limit of a membership grant itself (the 4.7-second cap of the retry time comes from it) and the material eligibility proof window that depends on it. A member's server reads the record when it starts, so a changed record applies after that member is restarted; the three members should record the same value, and while they are restarted one by one two values may run side by side when three heartbeat intervals of the slower one fit into the election timeout of the faster one. The enterprise edition's gpuworks cluster-storage-tier command shows and changes the record.

Why the Database Leader Changed: Role Records

Each change of the database leader cuts business requests in flight, terminals and log tails, and the agents' sessions are registered again with the new leader. Every member's server log (<installation>/logs/server.log on a member installed by the cluster installation; collecting diagnostics takes all three members' along under members/<member>/, with the role records also extracted as role-events.log) records what this member's database process did in Raft and why. It is always on and needs no debug build:

  • cluster database role event: one role record of the database process. observed_at is when it happened (the database process's clock, in nanoseconds); the log line's own time is less than a second later.
  • cluster database leader changed: this member has recognized a new leader. It states the leader before (old_leader), the new leader (new_leader, a member id), the term (term), whether this member is the new leader (leads), the reason as this member saw it (reason), and how long this member had no leader (without_leader_ms, measured on the database process's monotonic clock, so a clock correction does not affect it).
  • cluster database leader kept after a campaign: this member started an election, but the leader it then follows is the one it had (leader), in the same term. This is not a change of leader; when looking for leader changes, read only the line above. One member losing the leadership and winning it again is a change: the line above then has the same old_leader and new_leader, and old_term differs from term.
  • business follows a new database leader: the member's business layer has started to send requests to another leader. agent_sessions_closed is the number of agent sessions it closed so that they register with the new leader.

Values of event:

eventWritten byMeaning and the fields to read
stateevery memberA role change, old → new (FOLLOWER, CANDIDATE, LEADER; UNAVAILABLE is before start and after stop); id and address are this member
election_startthe member that starts an electionreason=election_timeout: it had not heard the leader for this long (since_leader_contact_ms, not less than the election timeout timeout_ms); reason=transfer_requested: the leader before (from) asked it to take over
election_retrya candidateA round ended without a majority of votes; another round starts
pre_vote_won, election_wona candidateThe pre-vote passed; elected, where votes/voters are the votes received and the number of voting members, and term is the new term
vote_replythe member asked for its votecandidate is who asked, granted=1/0; when refused, reason is has_leader (it still hears a leader), local_term_higher, log_or_earlier_vote or installing_snapshot; disrupt_leader=1 means this is a handover
step_downthe leader beforereason=no_majority_contact: no answer from a majority within one election timeout, and peer_ack_age_ms lists each other member as id:role:milliseconds since its last answer (-1 for never); reason=higher_term: the member from has entered a higher term
term_bumpa following memberIt heard a higher term from from
followinga following memberIt started to follow leader (leader_address); also written when the same leader was elected again in a new term
transfer_start, transfer_end, transfer_timeoutthe leader beforeHanding the leadership to to; result=leadership_left means it was handed over, still_leader that it was not
membership_request, configurationthe leader; every memberA request to change the membership or a role (op=add/assign/remove); the new member table received, members=id:role,…
snapshot_take, snapshot_installevery memberA snapshot taken, or one sent by the leader installed; took_ms is how long it took and status is ok, failed (with code) or unfinished. One that took less than 250 milliseconds is written once in 10 minutes
slow_stepevery memberOne step of the database process's main loop took took_ms milliseconds (written from 100 milliseconds): step is recv (handling one message), tick, apply (applying committed log entries, entries of them), fsm_apply (one of them), snapshot_begin or snapshot_restore. While the step runs this member neither sends heartbeats nor answers the leader
loop_lateevery memberThe database process's main loop ran late_ms late (the process was not scheduled, or a step in the loop took too long); written from 250 milliseconds
slow_log_writeevery memberOne write of the Raft log to disk took ms milliseconds; written from 500 milliseconds
peer_connect_failed, peer_send_failedevery memberThe connection to another member (peer, peer_address) failed (attempt number attempts), a send failed
peer_connected, peer_accepted, peer_disconnectedevery memberThe connection to another member was established (after attempts attempts, taking took_ms), a connection from it was accepted, a connection was lost (dir=out is one this member opened, dir=in one the other member opened)
peer_iothe leader before; the member that starts an electionAt most two members to a record, several records in a row for more; the database process keeps the first eight members it meets. Follows step_down reason=no_majority_contact (trigger=step_down) and election_start reason=election_timeout (trigger=election_start): for each other member id:send=…:sent=…:recv=…:out=<state>/<ms>:in=<count>/<ms>. send is how many milliseconds ago the last message for it was handed to the connection, sent how long ago a write last completed, recv how long ago a message was last read from it (-1 for never); out is the state of the outgoing connection (up, trying, down) and how long it has been in it, in is the number of connections it opened to this member and how long ago that last changed
tcpevery memberThe kernel's account of every TCP connection the database process holds, summed per peer address and direction: besides the connections between members it counts those this member's own server and the other members' servers open to the database port, so there is an /in entry whose peer is this member's own address. peers=<address>/<out or in>;…: the number of connections n, milliseconds since data was last sent, data last received and an acknowledgement last received (sent, recv, ack), the retransmission timer rto (milliseconds) and how many times it has backed off (backoff), unacknowledged packets unacked, round-trip time rtt_us; max_rto, max_backoff, max_unacked and retrans (retransmitted packets) are the maxima and the total since the previous tcp record. One is always written after a role change (trigger=role_change); otherwise only while a connection is retransmitting or its retransmission timer has reached half the election timeout (and no less than 400 milliseconds; the kernel's minimum is 200), at most once in 10 seconds (trigger=interval)
healthevery memberThe largest delays measured in a period: the main loop running late (loop_late_max_ms), log writes (log_write_max_ms), the interval between two answers of a following member (ack_gap_max_ms, ack_gap_peer_<id>_max_ms), the interval between two messages of the leader (leader_gap_max_ms); *_over=a/b/c/d counts those of at least 100, 250, 750 and 3000 milliseconds. One is always written after a role change (trigger=role_change); otherwise one per minute only when a delay passes a share of the election timeout (trigger=interval)
appevery memberThe database process's own warnings (adjusting roles, joining the cluster)
proxy_closedevery memberA connection through this member to its own database node ended without a goodbye; a healthy cluster has several a second, so one is written in 10 minutes with the number left out
droppedevery memberRecords were not written: reason=reader_behind means the server did not read in time, library_queue_full that the queue inside the database process was full

A condition that repeats (loop_late, slow_log_write, slow_step, the connection to one member failing, one app warning) is written once in 10 seconds, and suppressed is the number left out in between. A member cut off from the others starts an election once per election timeout: of election_start, election_retry, pre_vote_won, vote_reply to one candidate, state between candidate and follower, and health after a role change, the first 6 of each kind are written as they come and after that one in 10 seconds likewise; the count starts again after a quiet minute. The server has a limit of its own: at most 240 records from one database process are filed in a minute, the rest are only counted, and the next minute has one line cluster database role events suppressed suppressed=…. step_down, election_won, following, dropped, a state into or out of LEADER, the peer_io and tcp that follow a step-down, an election or a role change, and the summary of a leader change do not count against this limit and have one of their own: 1200 in a minute, the first of each kind always written, the rest likewise only counted, and the next minute has one line cluster database role events suppressed with kind=leadership. Connections made and lost (peer_connected, peer_accepted, peer_disconnected, counted per member and direction) are written as they come for the first 6 and after that one in 10 seconds. The database process hands over the records it has collected every 0.2 seconds, so neighbouring lines may appear in the log a fraction of a second out of the order in which they happened; sort by observed_at when the order matters. The database process puts records into a fixed in-memory queue and another thread writes them; when they cannot be written they are dropped and counted, and the Raft main loop does not wait.

How to read one leader change: first find cluster database leader changed of the same moment in the three members' logs. reason is what that member saw itself; where it says not seen by this member, read the other two members' logs. Then compare:

Records foundConclusion
The leader before: step_down reason=no_majority_contact, with both members in peer_ack_age_ms past the election timeout (the next three rows divide it further by the peer_io and tcp that follow it)The leader before got no answer within one election timeout. Read its health, loop_late and slow_log_write just before: a large loop_late means it was not scheduled itself; if all are normal the network or the other two members are the cause, so read loop_late and slow_log_write of the same moment in their logs
The peer_io trigger=step_down after it: for both members send and sent are small (a few heartbeat intervals at most), out=up, and recv is past the election timeoutIt was sent and nothing came back. Read the tcp of the same moment: backoff above 0, max_rto near or past the election timeout and unacked not 0 mean packets were lost on the network and the kernel was retransmitting at intervals longer than the election timeout; a normal tcp means the other side received and did not answer, so read loop_late, slow_step and slow_log_write in its log
The peer_io after it: send or sent is itself past the election timeoutThis member did not send: a large send means the main loop produced no heartbeat (read loop_late, slow_step); a small send with a large sent means the write was stuck on the connection
The peer_io after it: out=trying or out=down, with peer_disconnected or peer_connect_failed before itThe connection was being re-established. took_ms and attempts of peer_connected say how long that took
A following member: election_start reason=election_timeout; the leader before has no step_down of its own but then step_down reason=higher_term from=<that member>That following member started an election after not hearing the leader for this long. Read its since_leader_contact_ms and its health (leader_gap_max_ms) and loop_late just before: its own loop running late points at its side; a normal loop with a long interval between the leader's messages points at the leader's side or the network between the two
The leader before: transfer_start; the target: election_start reason=transfer_requestedSomeone asked for a handover (the upgrade command, or a member stopping normally)
A member whose database process has just started: less than a second after following there is slow_step step=apply entries=<N> took_ms=<thousands>, then loop_lateOn first hearing the leader, a restarted member applies every log entry since its last snapshot (up to about 1024) in one step of the main loop, and answers nothing for those seconds. The time grows with the number of entries, not with the size of the database. If another member is away at that moment, the leader gets no answer from a majority and steps down
The leader before's log stops at that moment and starts again with state old=UNAVAILABLEThe leader before's process exited or was restarted

An example (three members; the database process of the leader before was frozen for 2 seconds). The following member's health shows its own loop on time (loop_late_max_ms=23), and the first record of the leader before after it ran again is loop_late late_ms=1990: the cause is on the side of the leader before.

# member 13029695054750815211 (10.240.4.6), a follower: it stopped hearing the leader and won the election
time=2026-11-23T22:50:56.000Z level=WARN msg="cluster database role event" observed_at=2026-11-23T22:50:55.994851832Z event=election_start reason=election_timeout term=2 leader=12341872649424584096 since_leader_contact_ms=1257 timeout_ms=1193
time=2026-11-23T22:50:56.000Z level=INFO msg="cluster database role event" observed_at=2026-11-23T22:50:55.995559204Z event=pre_vote_won term=2 next_term=3
time=2026-11-23T22:50:56.000Z level=WARN msg="cluster database role event" observed_at=2026-11-23T22:50:56.000035853Z event=health trigger=role_change election_timeout_ms=750 loop_late_max_ms=23 loop_late_n=565 loop_late_over=0/0/0/0 log_write_max_ms=32 log_write_n=330 log_write_over=0/0/0/0 leader_gap_max_ms=164 leader_gap_n=651 leader_gap_over=83/0/0/0 leader_gap_peer_12341872649424584096_max_ms=164
time=2026-11-23T22:50:56.203Z level=INFO msg="cluster database role event" observed_at=2026-11-23T22:50:56.019313298Z event=election_won term=3 votes=2 voters=3
time=2026-11-23T22:50:56.203Z level=INFO msg="cluster database leader changed" old_leader=12341872649424584096 new_leader=13029695054750815211 term=3 this_member=13029695054750815211 leads=true reason="this member started an election: election_timeout since_leader_contact_ms=1257 timeout_ms=1193" observed_at=2026-11-23T22:50:56.019320067Z without_leader_ms=24
time=2026-11-23T22:50:56.819Z level=INFO msg="business follows a new database leader" new_leader=13029695054750815211 this_member=13029695054750815211 leads=true learned="leader observation" agent_sessions_closed=0 old_leader=12341872649424584096 since_last_observation_ms=2381

# member 12341872649424584096 (10.240.4.7), the leader before: its own loop was 1990 ms late, then it met the higher term
time=2026-11-23T22:50:56.828Z level=WARN msg="cluster database role event" observed_at=2026-11-23T22:50:56.751267272Z event=loop_late late_ms=1990 period_ms=75
time=2026-11-23T22:50:56.829Z level=WARN msg="cluster database role event" observed_at=2026-11-23T22:50:56.754016735Z event=step_down reason=higher_term was=leader term=2 new_term=3 from=3297041220608546238 from_address=10.240.4.5:9061
time=2026-11-23T22:50:56.829Z level=INFO msg="cluster database role event" observed_at=2026-11-23T22:50:56.765822683Z event=following leader=13029695054750815211 leader_address=10.240.4.6:9061 term=3
time=2026-11-23T22:50:56.829Z level=INFO msg="cluster database leader changed" old_leader=12341872649424584096 new_leader=13029695054750815211 term=3 this_member=12341872649424584096 leads=false reason="this member stepped down: higher_term from=3297041220608546238 new_term=3" observed_at=2026-11-23T22:50:56.765822683Z without_leader_ms=11

Protocol Version of the Database Helper

When the server starts the helper it reads the helper's one-line ready announcement, in which protocol is the protocol version the helper implements. The server accepts only the version it supports; with a different version, or with no version in the announcement, it refuses to start the database and the error names both versions. Install the helper and the server as a pair.

Upgrading the Cluster's Schema

A version that brings new migrations cannot be rolled out one member at a time: the three members share one database, and a migration changes the schema for all three at once. The cluster does this step in a short maintenance window.

  • A member on the new program waits first. The new version of the server starts on the older schema: it keeps serving its database replica, keeps its business closed, and records its migration list in the database. The other members go on serving business, so while members are replaced one by one, business stays available until the last one is replaced. A program older than the database schema still refuses to start, and so does one that lacks an extension module the database already has.
  • The database leader performs three steps, and each requires all three members to have reported the same migration list:
    1. Begin: the maintenance phase goes from serving to upgrading. From then on no member accepts a business write, including a member still running the old program.
    2. Migrate: the pending migrations of the core and of each extension module run once, in order, each committed in one transaction with its marker. When the new version brings one more module, its tables are created in this step too. After a leader change or a failure the step is repeated on the new leader, and migrations already committed are skipped.
    3. Finish: the maintenance phase returns to serving; the members open business again on their own, without a restart.
  • Answers in the window: every member answers business requests (including /api/v1/readyz) with 503 and the product code CLUSTER_UPGRADE_IN_PROGRESS, with Retry-After. /healthz is unchanged.
  • Progress in the window: every member answers GET /api/v1/cluster/upgrade-progress on its business listener, whether its business is open or closed, without a login (no session can be checked in the window, because sessions are recorded in the business store). It holds only a state code (idle, waiting, window, migrating, unobserved), whether this member's business is open, the applied and target migration counts, and the total and ready member counts; it names no address, release or error text, and requests within one second share one read. On a 503 with the product code above the console switches to its "The control plane is being upgraded" screen, polls this document, and reloads by itself once a member serves again. A browser that opens the console during the window gets a self-contained progress page from the member; the status is still 503.
  • Abort is available only while no migration has run; the maintenance phase returns to serving, and the members then have to go back to the earlier program. Once a migration has run there is no way back except restoring the backup taken before the upgrade, so a backup is required before upgrading.
  • Leadership is handed over before the leader is replaced. The same listener serves a lead step: the member it is sent to asks the current database leader for the leadership and answers only once it leads. The member that led until then can be stopped afterwards without the others waiting out an election. The step is accepted only while the maintenance phase is serving and the member's program matches the database schema, because the leader is the member that serves business; when the handover does not complete within 10 seconds the answer carries the reason and the leader is still the earlier one. A cluster backup being taken meanwhile is not damaged: the backup confirms the leader before and after it reads; when the leader changed, the read broke off or no member led for a moment, it waits briefly and reads again, and fails only after three such attempts, without leaving a partial archive. The answer to status also carries the number of agent connections the member holds itself (agent_connections), and leaves the field out when the member cannot say: an agent's connection stays on the member that accepted it, stopping that member makes those agents connect again, and the upgrade command orders the members by it.
  • The steps are served by each member's own enrollment listener to a caller that presents a cluster member certificate, that is, a command run on a member host as the installation's account. Management sessions are unavailable while business is closed, so the steps are not management API routes.
  • A member that runs as a single member answers only the status. The member of a one-member cluster always runs this way; the member that created a cluster does too, from the time other members join until its own next start. It answers what other members and the cluster's commands ask every member (the status, the discovery of the members, the quorum facts, its part of a diagnostics collection); begin, migrate, finish, abort and lead are refused there with the reason, and the cluster is unchanged. With other members in the cluster, this member takes part in an upgrade after one restart; a cluster of one member applies its migrations when its new program starts, so gpuworks cluster upgrade asks no step of it.

Current limits:

  • A member reports its program each time it starts, and repeats the report every few seconds while it waits for the upgrade. When a member is replaced by another version inside the window and started, its report changes and the later steps are refused. An old version without this feature does not report, so that case goes unnoticed; once the migrations have run it refuses to start because the schema is newer than it.
  • A member that is down keeps its last report. As long as most members repeated theirs within the last 30 seconds the steps go on, and the member catches up when it returns.
  • What replaces the programs member by member and calls these steps in order is gpuworks cluster upgrade of the edition that provides the cluster; a build of this repository has no such command. A console entry and progress at the entry layer do not exist yet.

Was this page helpful?