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>
It appears that concurrent reads and writes on AIO seem to
result in inconsistent reads in some very rare cases, due to
races. Sometimes, the inode claims that the file has been already
appended by a write operation, but the data has not actually hit
the page cache, such that a concurrent read gets NULL blocks.
This is a workaround by "misusing" the mapfree infrastructure.
It depends on uniqueness of file names, which is not the right thing
to do.
Best fix would be in the kernel.
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>
Makefile.dist contains targets for distribution/packaging, such as
the generation of release tarballs, and other administrative tasks.
Commits 43770d2 dfcd866 b04bf8d 68b9f2e 191cc1a dd6db46 rebased on eaba743
Signed-off-by: Thomas Schoebel-Theuer <tst@1und1.de>