By default, {dis}connect and {pause,resume}-{replay,sync} should
only switch the _local_ buttons. Otherwise, unexpected side-effects
could result at bigger clusters (#nodes >> 2) from a human point of view.
The new behaviour is different from DRBD, but DRBD was (until recently)
only working on _pairs_, so global spreadout was impossible.
Global switching may be requested at any time by appending suffix
"-global", which is just no longer the default in MARS.
If anyone has objections, it is straightforward to change the
defaults again.
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.
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.
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>
The actual primary is decoded in 'actual-*/is-primary' links, while the
target primary is decoded in the 'primary' link. This is not clearly
taken into account in several functions of marsadm. This commit fixes
this problem.
- Added _get_actual_primary() function
- Remove $pri parameter in _primary_res
- Use _get_actual_primary() where actual state should be used
Commits 3e96a5e 578d003 5dccbdc rebased to dfeb8e6
Signed-off-by: Thomas Schoebel-Theuer <tst@1und1.de>
- Added mars_time() function returning lamport clock
- Renamed check_mtime to check_file_aged and fixed to use mars_time()
- Renamed check_all_mtimes to check_files_modified_any_of
Commits eb849e2 1be8700 fbb415a rebased on dfeb8e6
Signed-off-by: Thomas Schoebel-Theuer <tst@1und1.de>
The actual state is decoded in 'actual-*/is-primary' links, while the target
state is decoded in the 'primary' link.
- check_primary() now uses actual state
- check_not_primary() now uses both actual state and target state
Commits c38a822 94ac15a rebased on eaba743
Signed-off-by: Thomas Schoebel-Theuer <tst@1und1.de>