Commit Graph

345 Commits

Author SHA1 Message Date
Thomas Schoebel-Theuer
89014d29c3 marsadm: new primitive device-opened
This is absolutely needed for race avoidance in scripting.
2016-02-03 22:01:48 +01:00
Thomas Schoebel-Theuer
561c2bd6c6 marsadm: rename occurences of deprecated present-{disk,device} 2016-02-03 22:01:48 +01:00
Thomas Schoebel-Theuer
6418370357 marsadm: rename present-{disk,device} to *-present and deprecate it
This is important for namespace systematics of primitive macros.

First name the object, then name its property. Like in OO.

Exception: when _finding_ the object itself needs an operation, or
additional information, e.g. %get-disk{} (this is the "lookup operation"
for the object itself, at least by concept).

For compatibility, the old forms will be accepted also
(silently, undocumented).
2016-02-03 22:01:48 +01:00
Thomas Schoebel-Theuer
08c776fc36 marsadm: allow devices as size argument 2016-02-03 22:01:48 +01:00
Thomas Schoebel-Theuer
f4f9ba93e2 marsadm: correct replay error checking 2016-02-03 22:01:48 +01:00
Thomas Schoebel-Theuer
7ff2d896ea marsadm: fix join-cluster when the peer is actively running
In such a case rsync may spill an error because some symlinks
were updated in the meantime or have vanished. We can safely
ignore that.
2016-02-03 22:01:48 +01:00
Thomas Schoebel-Theuer
e36a2ea4f1 marsadm: fix present-{disk,device} 2016-02-03 22:01:48 +01:00
Thomas Schoebel-Theuer
0e6bb47cb6 marsadm: fix edge cases of try_to_avoid_splitbrain()
Originally a trivial silly bug (boolean value was wrong), leading to an
endless loop when a local versionlink was missing, which can happen
only after a primary crash at the wrong moment shortly after a logrotate
(not even during ordinary operations), followed by a hard reboot.

As documented in mars-manual.pdf, you simply need "modprobe mars"
to recover after such a crash reboot. MARS remembers the primary state
persistently for you and restores everything _automatically_.

Using "marsadm primary" in such a case to switch the current primary
to primary again (after an unnecessary "marsadm secondary" which is
strongly discouraged by mars-manual.pdf), although the host is / was
already in primary state after the reboot, is at least as silly as
the mentioned bug. Doing this in an /etc/init.d/ startup script
where it really doesn't belong into, is even more silly.

The latter is even an OPERATIONAL RISK, because "marsadm secondary"
works _globally_ in the whole cluster (as documented in mars-manual.pdf).
Such an improper startup script _can_ (potentially) disturb another
cluster member which had become primary in the _meantime_ during reboot.
Global cluster operations don't belong into startup scripts, because
reboots may happen unintentionally at any time.
2016-02-03 22:00:47 +01:00
Thomas Schoebel-Theuer
e207443833 marsadm: fix binary operators =~ and "match" 2016-01-21 08:09:48 +01:00
Thomas Schoebel-Theuer
feb0b34604 marsadm: fix irritating "Inconsistent" display at primary side
At an actual primary, "Inconsistent" would be the correct description
for the state of the _disk_.

However most sysadmins will confuse this with the state of the
_replication_ (which is of course never inconsistent during
writeback from the memory buffer).

Although documented correctly, misunderstandings continue
to survive, because humans are automatically abstracting away
from detail components such as a "disk", and are automatically
assuming that "marsadm view" would relate to the replication
as a whole.

Avoid misunderstandings by more detailed message distinctions
aiming to address all of these in parallel.
2016-01-15 17:58:30 +01:00
Thomas Schoebel-Theuer
cd122db700 marsadm: display logfile replay errors in diskstate 2016-01-15 17:58:27 +01:00
Thomas Schoebel-Theuer
cc1074fc53 marsadm: add primitive macro errno-text 2016-01-15 17:29:47 +01:00
Thomas Schoebel-Theuer
6c41326f7a marsadm: add basic macro replay-code 2016-01-15 17:23:14 +01:00
Thomas Schoebel-Theuer
cc1d786654 marsadm: disallow ordinary switching when logfiles are damaged
Only primary --force should be possible in such a (rare) case.
2016-01-15 17:10:48 +01:00
Thomas Schoebel-Theuer
69386b33d9 marsadm: fix /mars security issues
Only relevant for non-storage servers where customers have access to.

Notice that /mars is a _reserved_ filesystem for MARS-internal purposes.
It has mothing to do with an ordinary filesystem.

Users have generally to be kept out.
2016-01-13 14:12:00 +01:00
Thomas Schoebel-Theuer
3a543d5ca5 marsadm: improve weird --host=other deletion 2015-10-07 10:42:07 +02:00
Thomas Schoebel-Theuer
8e786d129f marsadm: remove distracting warning
This is no longer needed.
2015-08-04 14:18:45 +02:00
Thomas Schoebel-Theuer
58294defe5 marsadm: safeguard {create,join}-resource against old remains 2015-08-04 10:21:32 +02:00
Thomas Schoebel-Theuer
3e92223e47 marsadm: fix annoying warning in corner case 2015-07-22 12:19:41 +02:00
Thomas Schoebel-Theuer
b190337eb8 marsadm: use $real_host for deletions
This can make a difference when using --host= and the other
host is no long really existant.
2015-05-05 09:30:08 +02:00
Thomas Schoebel-Theuer
5f485b6a02 marsadm: better leave-cluster cleanup of dead files 2015-05-05 09:30:08 +02:00
Thomas Schoebel-Theuer
fb880f9b2c marsadm: leave-cluster should rmmod only on real host 2015-05-05 09:30:08 +02:00
Thomas Schoebel-Theuer
c6fc05a3be marsadm: allow --force --host= cleanup on non-joined host 2015-05-05 09:30:04 +02:00
Thomas Schoebel-Theuer
2a99f12294 marsadm: cleanup all orphane symlinks 2015-05-05 09:12:42 +02:00
Thomas Schoebel-Theuer
1eea119870 marsadm: allow --force on 'all' 2015-05-05 09:12:37 +02:00
Thomas Schoebel-Theuer
3f9571999d marsadm: allow log-rotate on secondaries upon --force
This makes not much sense, but is provided for cases where you are
really desperate.
2015-05-05 08:56:41 +02:00
Thomas Schoebel-Theuer
27e975f4d7 marsadm: allow --threshold=human-readable 2015-03-24 08:33:03 +01:00
Thomas Schoebel-Theuer
5bead43add marsadm: distinguish multiples of 1024 from 1000 2015-03-24 08:33:03 +01:00
Thomas Schoebel-Theuer
f43d5fd58e marsadm: add list inquiry functions 2015-03-24 08:33:03 +01:00
Thomas Schoebel-Theuer
8d60cb304c marsadm: show replication infos only on secondaries 2015-03-24 08:33:03 +01:00
Thomas Schoebel-Theuer
c481f75cb8 marsadm: hint on wasted disk space 2015-03-24 08:33:03 +01:00
Thomas Schoebel-Theuer
c88965e24a marsadm: report disk/device sizes 2015-03-24 08:33:03 +01:00
Thomas Schoebel-Theuer
1f2680dd62 marsadm: fix external races on resize 2015-03-24 08:33:03 +01:00
Thomas Schoebel-Theuer
8888571b2c marsadm: remove irritating warning 2015-03-24 08:33:03 +01:00
Thomas Schoebel-Theuer
e1b241e3ad marsadm: clarify usability of 'view' 2015-03-24 08:33:02 +01:00
Thomas Schoebel-Theuer
c7b57f864e marsadm: clarify view/flags when network is slow 2015-03-23 13:48:11 +01:00
Thomas Schoebel-Theuer
308925c755 doc: update version 2015-03-09 09:53:06 +01:00
Thomas Schoebel-Theuer
6419b3fb57 marsadm: fix endless wait_cluster 2015-03-09 09:53:06 +01:00
Thomas Schoebel-Theuer
ae47fbdcb4 marsadm: fix leave-cluster when communication is dead 2015-03-09 09:53:06 +01:00
Thomas Schoebel-Theuer
82de077df0 marsadm: clarify meaning of switches/status
fighting the stupidness...
2015-03-09 09:53:05 +01:00
Thomas Schoebel-Theuer
df596cb24e marsadm: report communication status 2015-03-09 09:53:05 +01:00
Thomas Schoebel-Theuer
f9125d33a7 marsadm: safeguard uuid at join-cluster 2015-03-09 09:53:05 +01:00
Thomas Schoebel-Theuer
8a269b2412 marsadm: safeguard missing UUID 2015-03-06 11:44:39 +01:00
Thomas Schoebel-Theuer
b3470e039a marsadm: fix --force in detach 2015-03-05 08:34:00 +01:00
Thomas Schoebel-Theuer
7e7e0ee11b marsadm: fix --host= for non-existing remote devices 2015-03-03 19:00:03 +01:00
Thomas Schoebel-Theuer
656231f658 doc: checkin new manpage 2015-02-27 11:32:58 +01:00
Thomas Schoebel-Theuer
65a44501ee doc: create manpage automatically from marsadm --help 2015-02-27 11:32:57 +01:00
Thomas Schoebel-Theuer
5cb85aa0bd doc: feedback from Cyril Bitterich 2015-02-27 11:32:57 +01:00
Thomas Schoebel-Theuer
96404b89c3 marsadm: unify terms in usage 2015-02-27 11:32:57 +01:00
Thomas Schoebel-Theuer
a25801b2e4 marsadm: usage for MARS-specific commands 2015-02-27 11:32:57 +01:00