Zach Brown 5b258cee3b scoutfs: refine quorum voting
The current quorum voting implementatoin had some rough edges that
increased the complexity of the system and introduced undesirable
failure modes.  We can keep the same basic pattern but move
functionality around a few places, and rethink the quorum voting, to end
up with a meaningfully simpler system.

The motivation for this work was to remove the need to provide a
uniq_name option for every mount instance.

The first big change is to remove the idea of static configuration slots
for mounts.  This removes the use of uniq_name.  Mounts now simply have
a server_addr mount option instead of using their uniq_name to find
their address in the configuration.

The server can't check the configuration to see if a given connected
client's name is found in the quorum config.  Clients can set a flag in
their sent greeting which indicates that they're a voter.  This removes
the uniq_name from the greeting and mounted client records.

Without a static configuration mounts no longer have dedicated block
locations to write to.  We increase the size of the region of quorum
blocks and have voters simply write to a random block.  Overwriting vote
blocks is OK because we move from heartbeating design patterns to a
protocol strongly based on raft's election.  We're using quorum blocks
to communicate votes instead of network messages and overwriting blocks
is analagous to lossy networks droping vote messages in the raft
election protocol.

We were using the dedicated per-mount quorum blocks to track mounts that
had been elected and needed to be fenced.  We no longer have that
storage so instead we add the idea of an election log that is stored in
every voting block.  Readers merge the logs from all the blocks they
read and write the resulting merged log in their block.

With no static quorum configuration we no longer have to worry about the
complexity of changing the slot configurations while they're in use.
The only persistent configuration is the number of votes a candidate
needs to be elected by a quorum.

It was a mistake to use quorum voting blocks to communicate state
between the server and the quorum voters.  We can easily move the
unmount_barrier, server address, and fencing state from the quorum
blocks into the super block.  The server no longer needs the quorum
election info struct to be able to later write its quorum block.  It
instead writes a few fields in the super.  There's only one place where
clients need to look to find out who they should connect to or if they
can finish unmount.

Signed-off-by: Zach Brown <zab@versity.com>
2019-08-20 15:52:13 -07:00
2019-08-20 15:52:13 -07:00
Description
No description provided
9 MiB
Languages
C 86.2%
Shell 10.2%
Roff 2.5%
TeX 0.8%
Makefile 0.3%