1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +03:00
Commit Graph

1407 Commits

Author SHA1 Message Date
Zdenek Kabelac
05dd566a52 dmeventd: unify error handling
Always make sure the 'status' is release on 'error' path (thin pluging missed)
Make code looking same across all plugins.
2017-02-14 00:03:34 +01:00
Zdenek Kabelac
aa0c735e2c dmeventd: limit thin_command usage
Require usable command string to begining with '/'
So 'thin_command = "/some/path/command"' is the only supported variant
to internal 'lvm' command.
2017-02-13 09:43:53 +01:00
Zdenek Kabelac
0844b20f98 coverity: remove unneeded header files 2017-02-11 21:17:27 +01:00
Zdenek Kabelac
375e38709c cleanup: drop double const specifier
Remove duplicated 'const' specifier.
Reindent.
2017-02-11 20:30:16 +01:00
Zdenek Kabelac
2a9eda1229 mem: add extra mem pages for pthread stack
Some archs can use even 64K pages and then lvm2 runs into trouble if
the stack is 'too small' to fit extra page capturing stack overwrite.

So when lvm2 limits stack - add extra mem page - be it 4K or 64K.

Relates to ppc64le bug: https://bugzilla.redhat.com/1387279
2017-02-11 18:23:15 +01:00
Zdenek Kabelac
dae4f53acb clvmd: add mutex protection for cpg_ call
The library for corosync multicasting is not supporting multithread
usage - add local mutex to avoid parallel call of cpg_mcast_joined().
2017-02-05 17:55:37 +01:00
Tony Asleson
875ce04c61 lvmdbusd: cmdhandler.py, remove duplicate code
Move similar code to common functions, less is more!
2017-02-01 19:05:41 -06:00
Tony Asleson
3eccbb4b47 lvmdbusd: manager.py, remove duplicate code
Move similar code to common functions, less is more!
2017-02-01 18:57:01 -06:00
Tony Asleson
945842fa68 lvmdbusd: lvmdb.py, remove duplicate code
Move similar code to common functions, less is more!
2017-02-01 18:56:39 -06:00
Tony Asleson
681d69c70a lvmdbusd: pv.py, remove duplicate code
Move similar code to common functions, less is more!
2017-02-01 16:51:00 -06:00
Tony Asleson
a010cede6e lvmdbusd: vg.py, remove duplicate code
Move similar code to common functions, less is more!
2017-02-01 16:37:03 -06:00
Tony Asleson
83a1907586 lvmdbusd: lv.py, remove duplicate code
Move similar code to common functions, less is more!
2017-02-01 15:38:55 -06:00
Zdenek Kabelac
836eb122ce dmeventd_thind: set LVM_RUN_BY_DMEVENTD
Set LVM_RUN_BY_DMEVENTD envvar to expose the command is runing from
dmeventd environment.
2017-01-23 14:55:47 +01:00
Zdenek Kabelac
2e0605d6db dmeventd_thin: internal command without lvm prefix
Internal command processing needs to go without 'lvm ' prefix.
2017-01-21 17:42:19 +01:00
Zdenek Kabelac
85dab3963f dmeventd_thin: enable support for external command
With this commit we start to support configurable action
from thin-pool monitoring via  'dmeventd/thin_command'
2017-01-21 00:01:05 +01:00
Zdenek Kabelac
8c4f3633ac dmeventd_thin: new logic for calling commands
For more advanced support we need to ensure better logic for calling
external much more advanced script for maintanance of thin-pool.

So this new code ensures:

When thin-pool data or metadata is bigger then 50%,
then with each 5% increment, action is called.
This is independent from autoextend_threshold.
This action always happens when thin-pool is over threshold,
(so no action when it's exactly i.e. 60%).
The only exception is 100% full thin-pool - which invokes 'last'
action.

Since thin-pool occupancy may change also downward, code needs
to also handle possibly reduction of occupancy  of thin-pool.
So when usage drop from 90% to 50%, thin-pool will start to call
again action when it will pass 55% threshold.

This give external commands lot of option i.e. to call 'fstrim'
before actual resize is needed.
2017-01-20 23:58:56 +01:00
Zdenek Kabelac
8b95551ade dmeventd_thin: drop umounting on error path
Default internal logic will stop trying to do any 'rescue' action
when executed command fails.
This will be now fully in hands of external script if such
behaviour is needed.
2017-01-20 23:58:56 +01:00
Zdenek Kabelac
43e3268ada dmeventd_thin: rework failure handling
Instead of stopping monitoring after couple failing retries,
keep monitoring forever, just make larger delays between command
retries (ATM upto ~42 minutes).

So syslog is not spammed too often, yet commands have a chance to
be retried and succeed eventually...
2017-01-20 23:56:39 +01:00
Zdenek Kabelac
46c23dfb87 dmeventd_thin: SIGCHLD handler
To improve reaction time on when child is finished,
lets handle SIGCHLD in particular thread.
Let's hope kernel will route SIGCHLD to matching thread.
2017-01-20 23:55:51 +01:00
Zdenek Kabelac
bc7a1d70d4 dmeventd_thin: init command
When dmeventd configured command does not start with 'lvm ' prefix,
it's going to be an 'external' command.
In this case we split command by spaces to argv strings.
2017-01-20 23:55:50 +01:00
Zdenek Kabelac
14746a6c00 dmeventd_thin: add wait_pid
Add support handling command exit.
2017-01-20 23:55:50 +01:00
Zdenek Kabelac
2e935c0967 dmeventd_thin: add run_command
Implement forking of executable command.
When command is forked, dmeventd may continue monitor device.
2017-01-20 23:55:50 +01:00
Zdenek Kabelac
e5bef50827 dmeventd_thin: better warning logic
When fullness is passing WARN_THRESHOLD, print warning,
when it drops bellow and crossed again, we should print
warning again, but always only once.
2017-01-20 23:55:50 +01:00
Zdenek Kabelac
0d945ddbad dmeventd_thin: switch to struct percent
Later we can use stored percent values to pass them
to executed commands.
2017-01-20 23:55:50 +01:00
Zdenek Kabelac
eca964b554 dmeventd_thin: handling of internal command 2017-01-20 23:55:50 +01:00
Zdenek Kabelac
dd19b56985 thin: refresh status when error processing fails
When thin-pool processes event and 'lvextend --use-policies' fails
rather capture up-to-date new info as the fullness percentage may
have jumped noticable. This way we could use 'more' correct numbers
when checking for thresholds.
2016-12-22 23:37:07 +01:00
Tony Asleson
a7e1f973cc lvmdbusd: Use timeout_add instead
The function timeout_add_seconds has quite a bit of variability.  Using
timeout_add which specifies the timeout in ms instead of seconds.  Testing
shows that this is much more consistent which should improve clients that
are using shorter timeouts for the API and the connection.
2016-12-20 11:06:57 -06:00
Tony Asleson
75568294be lvmdbusd: Use cfg.reload() instead of dbo.refresh
We want to update the data and send out any signals as needed, not just
update the in memory database.
2016-12-20 11:06:57 -06:00
Tony Asleson
6fe6e8053a lvmdbusd: Remove un-needed main thread execution 2016-12-20 11:06:57 -06:00
Bryn M. Reeves
14c20ae217 lvmdbusd: add path.py to .gitignore 2016-12-10 17:59:07 +00:00
David Teigland
c459f23565 lvmetad: fix segfault in daemon_reply_simple
missing NULL termination
2016-12-09 15:22:30 -06:00
Zdenek Kabelac
f9c6c115d3 cleanup: easier code for raid plugin
Set bits only when then were not yet assigned.
2016-12-09 15:15:02 +01:00
Tony Asleson
c9848bb7ea lvmdbusd: Only allow 0..N for --blackboxsize argument 2016-11-30 16:47:39 -06:00
Tony Asleson
53ef496719 lvmdbusd: Emit signal on Job completion
Added a properties changed signal on the job dbus object so that client
can wait for a signal that the job is complete instead of polling or
blocking on the wait method.
2016-11-30 15:59:06 -06:00
Tony Asleson
1d52090953 lvmdbusd: Remove TODO on concurrent access to properties
As the code now uses a single thread to handle all changes to the
dbus model we no longer need to handle this potential race
condition.
2016-11-30 15:59:06 -06:00
Tony Asleson
37f05ccab1 lvmdbusd: Supress protected member access warning
We want _run to be protected so that users outside of the class
don't mistakenly use it.  It's for internal use only.
2016-11-30 15:59:06 -06:00
Tony Asleson
3bc69cb23c lvmdbusd: Add --blackboxsize command line argument
Allows the user to override the number of commands that get dumped
to the log when we encounter a lvm error.  Also useful during
development when you don't want to see the blackbox output.
2016-11-30 15:59:06 -06:00
Tony Asleson
b0757ac96e lvmdbusd: Remove unused variable
This variable has been un-used for a long time.
2016-11-30 15:59:06 -06:00
Tony Asleson
58f4d98af1 lvmdbusd: Remove debug log_error 2016-11-29 16:50:30 -06:00
Tony Asleson
617a819abc lvmdbusd: WS fix 2016-11-29 16:50:30 -06:00
Tony Asleson
d882edb32d lvmdbusd: Simplfy reading streams
Remove redundant code and make code paths the same for all streams.
2016-11-29 16:50:30 -06:00
Tony Asleson
25b5413f89 lvmdbusd: Make lvm shell read more robust
Make sure JSON is correct before we stop trying to read.
2016-11-29 16:50:30 -06:00
Zdenek Kabelac
4a59cfaa1d makefiles: drop file source and indent 2016-11-26 00:22:38 +01:00
Tony Asleson
064e24bc1e lvmdbusd: Only read whats buffered
When reading data from stdout & stderr we were reading until the
reading until we got None back which really isn't needed as the
read will return everything that is available.
2016-11-23 18:16:11 -06:00
Zdenek Kabelac
e38678be3f cleanup: single LVM_SYSTEM_DIR string 2016-11-23 17:55:03 +01:00
Zdenek Kabelac
5fd5cfe061 cleanup: use display_lvname and msg cleanup
Use display_lvname in tracing messages.
Add some missing 'dots' to messages.
2016-11-23 17:48:01 +01:00
Tony Asleson
0bbf631349 lvmdbusd: Remove extraneous finally
The print statement is incorrect.
2016-11-17 13:59:39 -06:00
Tony Asleson
3b4c5a2151 lvmdbusd: Fix source documentation 2016-11-17 13:58:17 -06:00
Tony Asleson
3a6c78e22a lvmdbusd: cmdhandler.py, fix imports
Use the correct py3 syntax for handling imports.  Also use print instead
of log_debug which in this context will produce no output.
2016-11-17 13:57:44 -06:00
Tony Asleson
19a0bf9df6 lvmdbusd: Remove debug JSON file 2016-11-17 11:45:11 -06:00