A3 package 2: the store's mode from config, one filer per cluster (#19) #20
Loading…
Reference in a new issue
No description provided.
Delete branch "vesta/cluster-store"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs macula-services/mcl-scribe#19
A3 package 2 for the scribe: the reckon-db store's mode comes from configuration, and the lesson filer's place follows the log.
lesson_log:store_mode/0reads{mcl_scribe, [{store_mode, single | cluster}]},singleby default, and refuses an unknown value by name — a typo must not put a replicated deployment on per-node stores.mcl_scribe_service:event_store/0andguide_lessons_supboth take their decision from it, so the store and its filer cannot drift. Standalone and every existing deployment are untouched.mcl_scribe_store:open/1does not return untilreckon_db_cluster:local_healthy/1says the store is a joined cluster (a live leader, more than one member, the local Raft server answering), so the app does not boot, the mesh does not advertiserecord_lesson, and nothing is appended into the join window a join would wipe. The wait is not silent: it logsscribe_store_not_joinedwith what it waits for every few seconds, and it stays there for the operator rather than failing into a restart loop that hides the cause — a data holder is refused a join forever (reckon-db's guide).store_mode. The node whose store holds the data must be started before the empty nodes join; if the empty nodes form a cluster first, the holder can never join it (recovery steps included).What a double filer run does on each side of a netsplit.
globalsees only the nodes it is connected to, so a split runs one filer per connected partition. That double run is safe and no guard is added for it (a new check needs the owner's yes; nothing here names a harm): only the partition holding the log's Raft quorum accepts appends, so normally one side files; and where both sides hold the same queued lesson, filing is at least once and final exactly once — the filer reads the lesson's stream and skips a lesson no longer queued, the aggregate refuses a second final state, and mcl-rag keys a chunk by source and text, so the copy lands on the same chunk.Tests.
lesson_log_testspins the mode default, the configured value and the refusal by name;mcl_scribe_service_testspins the store's mode from the service;mcl_scribe_store_testsproves a cluster-mode store holds the boot (the opener has not returned) and that it says what it waits for;guide_lessons_sup_testspins the plain child in single mode and themcl_om_singletonguard in cluster mode, and that alone on a node the guard runs the filer.Gates on this tip (OTP 28, reckon_db 5.12.0):
lint,xref,eunit(88 tests),dialyzer— all green.Not landable yet: the
reckon_dbpin floor moves to~> 5.12.1before the land (reckon-db#14 is open on 5.12.0; no service moves to cluster mode before 5.12.1 is on hex). This tip is for review.Landed by fast-forward: main is
a69a2d7c93(fromd9551a35). This repository does not allow the manually-merged style, so the PR is closed by hand.Pull request closed