Timestamps of symlinks are used for Lamport comparison
(any newer one overwrites any older one).
That concept should _not_ be used for any other comparison, since
there is no / not yet any "transactional" property of
bulk updates of symlinks (the Lamport condition treats each
symlink independently from any other).
Until such "transactions" are introduced at the strategy layer,
timestamp comparisons between _different_ symlinks are
unmeaningful in general.
Switch on only when all predecessor bricks are also on.
Failing to do so can result in fatal errors.
Similarly, switch only off if no successor exists any more.
Add infrastructure for splitting commands in multiple phases.
Usually, phase0 will check for some preconditions, while
phase1 will execute the command. The final result will only
be committed if nothing fails.
The difference to the old behaviour will only show up when combined
with 'all' resources. If anything fails in phase0, nothing will be
touched in phase1. The old behaviour could touch some resources,
but omit others when something failed.
The new behaviour is more transactional-like.
Writethrough of bio requests having more than one biovec should
only sync the last one. The others will be written to the transaction
log anyway. No need to wait for each of them to be committed one
by one.
Previously, the 'marsadm primary' and 'marsadm secondary' commands
were successful as soon as the target primary was successfully set
to the new primary or '(none)', respectively. This commit appends
a check to wait until the primary is really changed (actual state).
Changes in marsadm:
- Added check_primary_settled() function
- Do not use local variable named '$host' in _primary_res() since
a global variable with same name exists.
- Do not use/set global variable '$host' in primary_res(). Use
local variable '$new' initially set to '$host' instead.
- Make 'secondary' command idempotent ("is already secondary")
- Call trigger() and check_primary_settled() in primary_res()
Related minor changes:
- marsadm: Added optional parameter 'sleeptime' to sleep_timeout()
- Removed debug output in check_file_aged()
Signed-off-by: Thomas Schoebel-Theuer <tst@1und1.de>