doc: update #41,42,49

This commit is contained in:
Thomas Schoebel-Theuer 2014-10-16 19:32:50 +02:00 committed by Thomas Schoebel-Theuer
parent 2197058f84
commit 479fc63a93
2 changed files with 282 additions and 4 deletions

27
docu/images/handshake.fig Normal file
View File

@ -0,0 +1,27 @@
#FIG 3.2 Produced by xfig version 3.2.5c
Landscape
Center
Metric
A4
100.00
Single
-2
1200 2
1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 900 225 186 186 900 225 1080 270
1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1350 1800 186 186 1350 1800 1530 1845
1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 3150 225 186 186 3150 225 3330 270
1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 3825 1800 186 186 3825 1800 4005 1845
2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 6
450 900 900 900 900 450 3150 450 3150 900 4050 900
2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 6
450 1575 1350 1575 1350 1125 3825 1125 3825 1575 4050 1575
2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
450 2250 4050 2250
4 1 0 50 -1 2 13 0.0000 0 150 105 900 315 1\001
4 1 0 50 -1 2 13 0.0000 0 135 105 3150 315 3\001
4 1 0 50 -1 2 13 0.0000 0 150 105 1350 1890 2\001
4 0 0 50 -1 4 13 0.0000 0 195 1515 -900 1485 actual response\001
4 0 0 50 -1 4 13 0.0000 0 150 1065 -900 810 todo switch\001
4 0 0 50 -1 0 12 0.0000 4 135 360 2205 2205 time\001
4 1 0 50 -1 2 13 0.0000 0 150 105 3825 1890 4\001

View File

@ -4609,6 +4609,220 @@ modprobe
have to restore bulks of nodes in a short time.
\end_layout
\begin_layout Section
The State of MARS
\begin_inset CommandInset label
LatexCommand label
name "sec:The-State-of"
\end_inset
\end_layout
\begin_layout Standard
In general, MARS tries to
\emph on
hide
\emph default
any network failures from you as best as it can.
After a network problem, any internal low-level socket connections are
\emph on
transparently
\emph default
tried to re-open ASAP, without need for sysadmin intervention.
In difference to DRBD, network failures will
\emph on
not
\emph default
automatically alter the state of MARS, such as switching to
\family typewriter
disconnected
\family default
after a
\family typewriter
ko_timeout
\family default
or similar.
From a high-level sysadmin viewpoint, communication may just take a very
long time to succeed.
\end_layout
\begin_layout Standard
When the behaviour of MARS is different from DRBD, it is usually intended
as a feature.
\end_layout
\begin_layout Standard
MARS is not only an
\series bold
asynchronous
\series default
system at block IO level, but also
\series bold
at control level
\series default
.
\end_layout
\begin_layout Standard
This is
\emph on
necessary
\emph default
because in a widely distributed long-distance system running on slow or
even temporarily failing networks, actions may take a long time, and there
may be many actions
\series bold
started in parallel
\series default
.
Synchronous concepts are generally not sufficient for that.
\end_layout
\begin_layout Standard
Although MARS tries to
\emph on
approximate
\emph default
/
\emph on
emulate
\emph default
the synchronous control behaviour of DRBD at the interface level (
\family typewriter
marsadm
\family default
) in many situations as best as it can, the
\emph on
internal
\emph default
control model is asynchronous.
As an experiencend sysadmin, you will be curious how it works in principle.
When you know something about it, you will no longer be surprised when
some (detail) behaviour is different from DRBD.
\end_layout
\begin_layout Standard
The general principle is an asynchronous 2-edge handshake protocol, which
is used almost everywhere in MARS:
\end_layout
\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
filename images/handshake.fig
width 80col%
\end_inset
\end_layout
\begin_layout Standard
We have a binary todo switch, which can be either in state
\begin_inset Quotes eld
\end_inset
on
\begin_inset Quotes erd
\end_inset
or
\begin_inset Quotes eld
\end_inset
off
\begin_inset Quotes erd
\end_inset
.
In addition, we have an actual response indicator, which is similar to
an LED indicating the actual status.
In our example, we imagine that both are used for controlling a big ventilator,
having a huge inert mass.
Imagine a big machine from a power plant, which is as tall as a human.
\end_layout
\begin_layout Standard
We start in a situation where the binary switch is off, and the ventilator
is stopped.
At point 1, we turn on the switch.
At that moment, a big contactor will sound like
\begin_inset Quotes eld
\end_inset
zonggg
\begin_inset Quotes erd
\end_inset
, and a big motor will start to hum.
At first you won't hear anything else.
It will take a while, say 1 minute, until the big wheel will have reached
its final operating RPM, due to the huge inert mass.
During that spin-up, the lights in your room will become slightly darker.
When having reached the full RPM at point 2, your workplace will then be
noisier, but in exchange your room lights will be back at ordinary strength,
and the actual response LED will start to lit in order to indicate that
the big fan is now operational.
\end_layout
\begin_layout Standard
Assume we want to turn the system off.
When turning the todo switch to
\begin_inset Quotes eld
\end_inset
off
\begin_inset Quotes erd
\end_inset
at point 3, first nothing will seem to happen at all.
The big wheel will keep spinning due to its heavy inert mass, and the RPM
as well as the sound will go down only slowly.
During spin-down, the actual response LED will stay illuminated, in order
to warn you that you should not touch the wheel, otherwise you may get
injuried
\begin_inset Foot
status open
\begin_layout Plain Layout
Notice that it is only safe to access the wheel when
\emph on
both
\emph default
the switch and the LED are off.
Conversely, if at least one of them is on, something is going on inside
the machine.
Transferred to MARS: always look at
\emph on
both
\emph default
the todo switch and the correponding actual indicator in order to not miss
something.
\end_layout
\end_inset
.
The LED will only go off after, say, 2 minutes, when the wheel has actually
stopped at point 4.
After that, the cycle may potentially start over again.
\end_layout
\begin_layout Standard
As you can see, all four possible cartesian product combinations between
two boolean values are occurring in the diagram.
\end_layout
\begin_layout Standard
The same handshake protocol is used in MARS for communication between userspace
and kernelspace, as well as for communication in the widely distributed
system.
\end_layout
\begin_layout Section
Inspecting the State of MARS
\begin_inset CommandInset label
@ -5333,6 +5547,14 @@ todo-{attach,sync,fetch,replay,primary}
\family default
Shows a boolean value (0 or 1) indicating the current state of the correspondin
g todo switch (whether on or off).
The meaning of todo switches is illustrated in section
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:The-State-of"
\end_inset
.
\end_layout
\begin_layout Labeling
@ -5377,6 +5599,15 @@ is-*
todo-*
\family default
values when something is not (yet) working.
More explanations can be found in section
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:The-State-of"
\end_inset
.
\end_layout
\begin_layout Labeling
@ -5950,7 +6181,7 @@ Misc Informational Status
\family typewriter
get-primary
\family default
Return the name of the current designated primary node.
Return the name of the current designated primary node as locally known.
\end_layout
\begin_layout Labeling
@ -5970,9 +6201,29 @@ appears
guess
\series default
\emph default
, because it is not generally unique in split brain situation! Don't rely
on this.
Try to a avoid it.
, because it is not generally unique in split brain situations! Don't use
this macro.
Instead, use
\family typewriter
is-primary
\family default
on those nodes you are interested in.
The explanations from section
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:The-State-of"
\end_inset
also apply to
\family typewriter
get-primary
\family default
versus
\family typewriter
actual-primary
\family default
analogously.
\end_layout
\begin_layout Labeling