| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the start of the command, check if the lvmetad
content needs updating (token not matching), and
if so do the scan and update it. This gets the
updating done right at the beginning, before
command processing is started. The early scan
already exists for the foreign VGs case, so this
is added to it.
Previously, the command would be part way through
its own processing before discovering via lvmetad_send
that lvmetad needed updating. It's not good to
interrupt a command, insert a 'pvscan --cache', then
continue on with the original command. The pvscan
is likely to interfere with the original command.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running pvscan --cache, the intention is to scan
all devices, i.e. the equivalent of running
'pvscan --cache dev' for each device. But, some devices
holding duplicate PVs were being skipped, and lvmetad
was not being told about them.
This was a side effect of the fact that the lvmcache
layer is used internally during scanning (it's used
to transfer info between the different stages of the
command: label reading, vg reading, sending the vg.)
An unwanted side effect of using lvmcache is that it
eliminates duplicate PVs if it sees them. This
prevented the command from sending some duplicate PVs
to lvmetad (when the first duplicate was preferred
over the second.)
The fix is to drop the lvmcache state between scanning
each PV. There is no need to keep any cache state between
each PV being scanned (there's nothing being reused), and
the unneeded state is causing lvmcache to eliminate
duplicates which is harmful for pvscan --cache.
Also, remove clvm locking from pvscan_lvmetad. This is
not needed since lvmetad cannot be used with clvm. It
was interfering with clearing the cache.
|
|
|
|
|
|
|
| |
When the command gets a list of alternate devices
from lvmetad, warn about them all directly. This
is not the same as the warnings when adding lvmcache,
which are related to which duplicate is preferred.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
update_metadata and pv_found update the cached metadata;
rewrite both of these to improve the code, make it much
more clear what they do, more thoroughly cover possible
combinations/transitions, add more error checking and
handling, add comments.
The state and content of the cache (hash tables) does not
change (apart from things that didn't work before), and the
transfers to/from commands do not change.
The implementation and organization of the code making
the state changes does change significantly.
One detail related to the content of the cache does change:
different hash tables do not reference the same memory any more;
the target values in each hash table are allocated and freed
individually.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When vgchange -u changes the vgid in an existing VG,
it invokes update_metadata() in lvmetad with the existing
VG name but a new vgid. update_metadata() doesn't recognize
this condition, and ends up with in correct state, e.g.
the existing name is missing in the vgname_to_vgid hash table.
This fixes update_metadata() to recognize when an existing VG
name is being updated with a new vgid, and in that case first
calls remove_metadata() on the old vgid, before continuing
with update_metadata() which will add the updated VG as if it
were new.
One known shortcoming of this approach is that the VG is
missing from lvmetad hash tables completely in the short time
between the remove and adding it again. Other commands that
look up the VG in that window will not find it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old code made two loops through the PVs: in the first
loop it found the max PV and VG name lengths, and in the
second loop it printed each PV using the name lengths as
field widths for aligning columns.
The new code uses process_each_pv() which makes one loop
through the PVs. In the *first* call to pvscan_single(),
the max name lengths are found by looping through the
lvmcache entries which have been populated by the generic
process_each code prior to calling any _single functions.
Subsequent calls to pvscan_single() reuse the max lengths
that were found by the first call.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in report output
The new report/compact_output_cols setting has exactly the same effect
as report/compact_output setting. The difference is that with the new
setting it's possible to define which cols should be compacted exactly
in contrast to all cols in case of report/compact_output.
In case both compact_output and compact_output_cols is enabled/set,
the compact_output prevails.
For example:
$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=0
compact_output_cols=""
$ lvs vg
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lvol0 vg -wi-a----- 4.00m
---
$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=0
compact_output_cols="data_percent,metadata_percent,pool_lv,move_pv,origin"
$ lvs vg
LV VG Attr LSize Log Cpy%Sync Convert
lvol0 vg -wi-a----- 4.00m
---
$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=1
compact_output_cols="data_percent,metadata_percent,pool_lv,move_pv,origin"
$ lvs vg
LV VG Attr LSize
lvol0 vg -wi-a----- 4.00m
|
|
|
|
|
|
| |
dm_report_compact_given_fields is the same as dm_report_compact_fields,
but it processes only given fields, not all the fields in the report
like dm_report_compact_field does.
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a host failed while holding a sanlock lease,
sanlock_acquire will by default block and wait
for the lease to expire before returning. We
want it to return with an error so we can retry
instead of blocking, which allows us to process
other lock operations.
(Enclose this in an ifdef until the new flag
appears in a sanlock release.)
|
|
|
|
|
|
| |
Respect lvm2_log_fn prototype. The idea of 'reusing' print_log with
plain cast is causing very strange crashes with some older 'gcc' compilers.
So just do it cleanly...
|
|
|
|
|
| |
As we need to check how full thin-pool is - require thin-pool is
locally active.
|
|
|
|
|
| |
Plain rpath is to invasive and gets into binary.
We only want to provide hint for linker.
|
|
|
|
| |
During recent code changes '!' was badly converted.
|
|
|
|
|
| |
gcc 4.3 seems not to be able to find linked library without
specifying -rpath to linker (plain -L) is not enough.
|
|
|
|
| |
Missed compilability without DEBUG.
|
|
|
|
|
|
|
|
| |
This reverts commit 1b1c01a27b359f8e91c3c9e08684c435d8fd51c2.
This caused messages to get dropped instead of logged into the log file.
(The log file and log function are independent at the moment.)
|
| |
|
|
|
|
| |
Raid should be in-sync ATM for any gaming.
|
|
|
|
|
| |
Log dmeventd output from test - keep output logging in test
and avoid sending messages to syslog.
|
|
|
|
| |
Enhance check for matching prefix.
|
|
|
|
|
| |
Make visible actual status line when returing 'raid' is in sync.
Useful to prove when kernel is wrong.
|
|
|
|
| |
For tags generation scan depth 5.
|
|
|
|
| |
Nothing in /sscripts needs devmapper-event library so drop its linking.
|
|
|
|
|
|
|
|
|
|
| |
Use same exported symbols list for other generated symfile
as it appeared to be the right way for libdm.
Local {
local:
*;
};
|
|
|
|
|
| |
Switch to per-thread mem-pool and lock only for lvm2 calls.
Use libdm parser for raid status line.
|
|
|
|
|
| |
Rework mirror plugin to use per-thread mem-pool.
This allows to use locking only for lvm2 library calls.
|
|
|
|
|
|
|
| |
Use lvm lock for lvm library calls.
dm functions in-use are 'thread-safe' since we use
local per-thread mem pool.
|
|
|
|
| |
Using local mempools allows to drop locks when such memory is needed.
|
|
|
|
|
| |
For thin and snapshot use new macros
to simplify mempool init and destroy
|
|
|
|
| |
Simplify commonly used pool creation.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rework thread creation code to better use resources.
New code will not leak 'timeout' registered thread on error path.
Also if the thread already exist - avoid creation of thread
object and it's later destruction.
If the race is noticed during adding new monitoring thread,
such thread is put on cleanup list and -EEXIST is reported.
|
| |
|
| |
|
|
|
|
| |
Switch private to user.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Add new supported option '-l' log to stdout/stderr.
It has to be paired with '-f' (foreground run).
|
|
|
|
| |
Document ? is printing to stderr.
|
|
|
|
|
| |
When snapshot reports overflow, handle it in the same way as Invalid.
Until better ideas are implemented.
|
| |
|
| |
|
|
|
|
|
|
|
| |
As we now use 'unified' logging macro system - we no longer need
to protect from change of logging function pointer - it's set
once at the start of dmeventd and not change anymore
(as lvm2 library no longer interferers here).
|
| |
|
| |
|
|
|
|
| |
Convert from syslog to standard log_() macros in plugins.
|
|
|
|
| |
Convert logging of dmeventd to libdm logging macros.
|