summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* test: lvmetad-disableddev-dct-pvscan-1David Teigland2016-05-051-1/+1
|
* test: lvmetad-pvscan-filterDavid Teigland2016-05-051-6/+24
| | | | update for pvscan changes
* pvscan: make autoactivate work with disabled lvmetadDavid Teigland2016-05-0511-281/+340
| | | | | | | | | | | | | | | | | | | | This refactors the code for autoactivation. Previously, as each PV was found, it would be sent to lvmetad, then the VG would be autoactivated using a non-standard VG processing function called from within the lvmetad notification path. Now, all scanning is done first, and the names of the VGs found during the scan are saved. After the scanning and lvmetad notifications are done, process_each_vg is used to do autoactivation on the list of saved VG names. If lvmetad is found to be disabled either before or during scanning, then the command reverts to disk scanning and the autoactivation step is done without using lvmetad.
* toollib: add vg name list arg to process_each_vgDavid Teigland2016-05-0518-25/+37
|
* metadata: move warning message about repairing VGDavid Teigland2016-05-051-3/+2
| | | | | | Move the message to just before the repair is going to happen to avoid printing the message in cases where repair is skipped.
* test: vgcfgbackup-lvm1David Teigland2016-05-051-0/+36
| | | | The lvm1 part of vgcfgbackup-usage.
* test: vgcfgbackup-usageDavid Teigland2016-05-051-14/+0
| | | | Split the lvm1 part into a separate test.
* test: vgsplit-usageDavid Teigland2016-05-051-1/+14
| | | | | | Restart clvmd between testing each mdatype to avoid a problem with dev state being kept from one test to the next.
* test: lvmetad-ambiguousDavid Teigland2016-05-051-5/+5
| | | | update for duplicate changes
* test: pv-duplicate-uuidDavid Teigland2016-05-051-6/+28
| | | | update for duplicate changes
* test: process-each-duplicate-pvsDavid Teigland2016-05-051-114/+476
| | | | Update for new duplicate processing.
* lvmetad: add duplicate resolution adviceDavid Teigland2016-05-051-0/+7
|
* lvmetad: disable if device scan failsDavid Teigland2016-05-053-15/+23
| | | | | | | | If a command begins repopulating the lvmetad cache, and fails part way through, it should set the disabled state in lvmetad so other commands don't use bad data. If a subsequent scan succeeds, the disabled state is cleared.
* lvmcache: use active LVs and device sizes to choose between duplicatesDavid Teigland2016-05-051-14/+76
| | | | | | | | If duplicate devices exist for a PV, and one device's size matches the PV size, but the other doesn't, then prefer the matching device. If one device is used by an active LV, prefer that device.
* pvs: new attr and field for unchosen duplicate deviceDavid Teigland2016-05-058-3/+39
| | | | | | | | | | | | When there are duplicate devices for a PV, one device is preferred and chosen to exist in the VG. The other devices are not used by lvm, but are displayed by pvs with a new PV attr "d", indicating that they are unchosen duplicate PVs. The "duplicate" reporting field is set to "duplicate" when the PV is an unchosen duplicate, and that field is blank for the chosen PV.
* lvmcache: process duplicate PVs directlyDavid Teigland2016-05-056-124/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, duplicate PVs were processed as a side effect of processing the "chosen" PV in lvmcache. The duplicate PV would be hacked into lvmcache temporarily in place of the chosen PV. In the old way, we had to always process the "chosen" PV device, even if a duplicate of it was named on the command line. This meant we were processing a different device than was asked for. This could be worked around by naming multiple duplicate devs on the command line in which case they were swapped in and out of lvmcache for processing. Now, the duplicate devs are processed directly in their own processing loop. This means we can remove the old hacks related to processing dups as a side effect of processing the chosen device. We can now simply process the device that was named on the command line. When the same PVID exists on two or more devices, one device is preferred and used in the VG, and the others are duplicates and are not used in the VG. The preferred device exists in lvmcache as usual. The duplicates exist in a specical list of unused duplicate devices. The duplicate devs have the "d" attribute and the "duplicate" reporting field displays "duplicate" for them. 'pvs' warns about duplicates, but the formal output only includes the single preferred PV. 'pvs -a' has the same warnings, and the duplicate devs are included in the output. 'pvs <path>' has the same warnings, and displays the named device, whether it is preferred or a duplicate.
* lvmcache: improve duplicate PV handlingDavid Teigland2016-05-056-222/+376
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wait to compare and choose alternate duplicate devices until after all devices are scanned. During scanning, the first duplicate dev is kept in lvmcache, and others are kept in a new list (_found_duplicate_devs). After all devices are scanned, compare all the duplicates available for a given PVID and decide which is best. If the dev used in lvmcache is changed, drop the old dev from lvmcache entirely and rescan the replacement dev. Previously the VG metadata from the old dev was kept in lvmcache and only the dev was replaced. A new config setting devices/allow_changes_with_duplicate_pvs can be set to 0 which disallows modifying a VG or activating LVs in it when the VG contains PVs with duplicate devices. Set to 1 is the old behavior which allowed the VG to be changed. The logic for which of two devs is preferred has changed. The primary goal is to choose a device that is currently in use if the other isn't, e.g. by an active LV. . prefer dev with fs mounted if the other doesn't, else . prefer dev that is dm if the other isn't, else . prefer dev in subsystem if the other isn't If neither device is preferred by these rules, then don't change devices in lvmcache, leaving the one that was found first. The previous logic for preferring a device was: . prefer dev in subsystem if the other isn't, else . prefer dev without holders if the other has holders, else . prefer dev that is dm if the other isn't
* lvmetad: remove client side altdev codeDavid Teigland2016-05-043-85/+2
| | | | | | This is no longer used since lvmetad no longer keeps track of alternate devices for duplicate PVs, but is simply disabled when duplicates appear.
* lvmetad: set disabled flag when duplicate PVs are seenDavid Teigland2016-05-041-152/+31
| | | | | | | | | | | | | | | | When duplicate PVs are detected, set the disabled flag so that commands will disable use of lvmetad. This duplicate detection is done by lvmetad itself when it's told about a single new PV with a PVID that matches an existing PV on another device. (This is different from the case where the command is scanning all devices and detects the duplicate.) Remove the "altdev" logic that attempted to keep track of multiple devices for a single PV. It is no longer used since lvmetad is disabled in this case.
* lvmetad: set disabled flag in lvmetad if duplicate PVs are foundDavid Teigland2016-05-042-0/+144
| | | | | When devices are being scanned, if duplicate PVs are seen, tell lvmetad to set its disabled flag because of duplicate PVs.
* pvscan: fix errors for single dev scan while lvmetad is disabledDavid Teigland2016-05-041-0/+13
| | | | | While lvmetad was disabled, 'pvscan --cache dev' would produce confusing error messages.
* pvcreate: improve debug messageDavid Teigland2016-05-041-2/+2
| | | | state what the printed UUID is.
* pvcreate, pvremove: translate arg name to device onceDavid Teigland2016-05-041-16/+8
| | | | | | | Rather than doing repeated translations from name to device when comparing args to existing PVs, do one translation of the arg names and saving the device, before checking existing PVs.
* post-releaseAlasdair G Kergon2016-04-304-2/+8
|
* pre-releasev2_02_152Alasdair G Kergon2016-04-304-4/+4
|
* raid: Use inherited tags when wiping rmeta.Alasdair G Kergon2016-04-292-0/+14
| | | | | | If there's an activation volume_filter, it might not be possible to activate the rmeta LVs to wipe them. At least inherit any LV tags from the parent LV while attempting this.
* datastruct: Add str_list_wipe.Alasdair G Kergon2016-04-293-5/+15
|
* libdm: Add dm_udev_wait_immediate.Alasdair G Kergon2016-04-284-2/+58
| | | | | | dm_udev_wait() waits inside the library. dm_udev_wait_immediate allows the caller to do other things if the cookie isn't yet ready to be decremented.
* pvscan: autoactivation should ignore some VGsDavid Teigland2016-04-271-2/+32
| | | | | | | | | | | pvscan autoactivation has its own VG processing implementation, so it can't properly handle things like foreign or shared VGs, so make it ignore those VG types (or errors from them) as best as possible. Add a FIXME stating that pvscan autoactivation must really be moved to the standard VG processing by calling process_each_vg to do activation once the scanning / cache update is finished.
* lvmetad: improve warning after lvmetad message failsDavid Teigland2016-04-271-1/+1
| | | | Make it more consistent with the other similar warning.
* metadata: fix segfault when filters reject devicesDavid Teigland2016-04-271-0/+9
| | | | | | | | | | | | | | Checking for devices uses is_missing_pv() to check if there is a device for the PV. is_missing_pv() is based on the MISSING_PV flag, which does not always correspond to !pv->dev. When using lvmetad, a command like: pvs --config 'devices/filter=["a|/dev/sdb|", "r|.*|"]' will cause a number of PVs to have NULL pv->dev, but not the MISSING_PV flag. So, NULL pv->dev needs to also be checked.
* cache: better support for alias checkZdenek Kabelac2016-04-271-4/+6
| | | | | | To still support disabling of policies for test we need better logic for alias detection introduced in 588455d03ea40ffa37f466023691b0ec2bdf5e82.
* cleanup: use log_debug_activationZdenek Kabelac2016-04-271-2/+2
|
* cleanup: smaller timeoutZdenek Kabelac2016-04-261-5/+6
| | | | | 1s -> 0.5s Also indent fix.
* man: lvcreate doc passthroughZdenek Kabelac2016-04-261-1/+4
| | | | Add few more words about passthough mode.
* man: lvchange updatesZdenek Kabelac2016-04-261-9/+8
| | | | Drop never existing --degrade.
* lvchange: use better arg functionsZdenek Kabelac2016-04-261-31/+46
|
* lvchange: always check for sigintZdenek Kabelac2016-04-262-2/+4
| | | | Check sigint() state during process_each_lv.
* lvchange: fix return codeZdenek Kabelac2016-04-262-1/+2
| | | | We already opened VG for this - so not an invalid cmdline.
* thin: zero and transaction_id also with thin volumesZdenek Kabelac2016-04-263-3/+7
| | | | | | Show trasaction_id when thin volume was created. Also show zeroing state of thin-pool with thin volume (so user doesn't need to lookup thin-pool).
* cache: check for clean cache as separete functionZdenek Kabelac2016-04-262-41/+58
|
* cache: with cache target 1.9 mq is alias to smqZdenek Kabelac2016-04-262-2/+6
| | | | | Avoid useless check for mq policy, it's loaded as smq and aliased.
* modprobe: check /sys/module entry firstZdenek Kabelac2016-04-262-0/+18
| | | | | | | | Before executing modprobe for given module name, just check if the module is not already present in /sys/module. Useful when checking dm-cache-policy modules as we do not having matching interface like for targets.
* udev: rules: add comments explaining subsystem-specific rulesPeter Rajnoha2016-04-261-0/+14
|
* udev: rules: remove mpath from 10-dm.rules, superseded by 11-dm-mpath.rules ↵Peter Rajnoha2016-04-252-4/+1
| | | | | | | | | | | | | | (mpath>=0.6.0) Multipath 0.6.0 contains new 11-dm-mpath.rules which supersede the rule that was in 10-dm.rules. The 11-dm-mpath.rules are also more complete, fixing several other issues. Using the new 11-dm-mpath.rules from multipath-tools >= 0.6.0 is strongly recommended for proper DM multipath functionality! See also: http://christophe.varoqui.free.fr http://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=blob;f=multipath/11-dm-mpath.rules
* cleanup: do not mention segment in warning message if device not found for a ↵Peter Rajnoha2016-04-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | PV when checking used/assumed devs for an LV [0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]' WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Couldn't find device for segment belonging to fedora/root while checking used and assumed devices. WARNING: Couldn't find device for segment belonging to fedora/swap while checking used and assumed devices. PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m [unknown] fedora lvm2 a-m 19.49g 0 Probably not worth mentioning "segments" here, just state that devices for an LV can't be all found during the check - it's less mysterious for user then: [0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]' WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Couldn't find all devices for LV fedora/root while checking used and assumed devices. WARNING: Couldn't find all devices for LV fedora/swap while checking used and assumed devices. PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m [unknown] fedora lvm2 a-m 19.49g 0
* metadata: log warning instead of error if device not found while checking ↵Peter Rajnoha2016-04-251-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | used and assumed devs When checking assumed PVs against real devices used for LVs and if there's no device assigned for an assumed PV (e.g. due to filters), do log_warn instead of log_error and continue checking LV segments and associated assumed PVs further, just like we do log_warn elsewhere in this situation. This way user will see the warning for each LV which couldn't be checked completely against real PVs used. Before, we logged only the very first occurence of missing device for an LV in a VG and we returned from the function doing this check for all the LVs in VG immediately which may be a bit misleading because it didn't tell user about all the other LVs and whether they could be checked or not. For example, we have this setup: [0] fedora/~ # pvs PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m /dev/vda2 fedora lvm2 a-- 19.49g 0 [0] fedora/~ # lvs -o+devices LV VG Attr LSize Devices root fedora -wi-ao---- 19.00g /dev/vda2(0) swap fedora -wi-ao---- 500.00m /dev/vda2(4864) Before this patch (only the very first LV in a VG is logged to have a problem while checking used and assumed devices): [0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]' WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. Couldn't find device for segment belonging to fedora/root while checking used and assumed devices. PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m [unknown] fedora lvm2 a-m 19.49g 0 With this patch applied (all LVs where we hit problem while checking used and assumed devices are logged and it's warning, not error): [0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]' WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Couldn't find device for segment belonging to fedora/root while checking used and assumed devices. WARNING: Couldn't find device for segment belonging to fedora/swap while checking used and assumed devices. PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m [unknown] fedora lvm2 a-m 19.49g 0
* post-releaseAlasdair G Kergon2016-04-234-2/+8
|
* pre-releasev2_02_151Alasdair G Kergon2016-04-235-5/+15
|
* tests: drop cluster testing with pvmoveZdenek Kabelac2016-04-221-1/+1
| | | | Unwanteadly enabled in previous check-in.