1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

10353 Commits

Author SHA1 Message Date
David Teigland
1248f94a42 pvscan, vgscan: include foreign vgs with --cache
pvscan --cache and vgscan --cache scan devices to refresh lvmetad,
and they should also refresh the lvmetad copy of foreign vgs.
2015-02-25 15:46:27 -06:00
David Teigland
bbaabb8a59 WHATS_NEW: vgimport with lvmetad 2015-02-25 14:59:24 -06:00
David Teigland
2c50cbe8cb tests: fix the system_id tests
That were broken by yesterday's system_id changes.
2015-02-25 14:58:49 -06:00
David Teigland
ebb2205b4c tests: add more systemid tests 2015-02-25 14:58:49 -06:00
David Teigland
dd6a202831 lvchange: deactivate is always possible in foreign vgs
The only realistic way for a host to have active LVs in a
foreign VG is if the host's system_id (or system_id_source)
is changed while LVs are active.

In this case, the active LVs produce an warning, and access
to the VG is implicitly allowed (without requiring --foreign.)
This allows the active LVs to be deactivated.

In this case, rescanning PVs for the VG offers no benefit.
It is not possible that rescanning would reveal an LV that
is active but wasn't previously in the VG metadata.
2015-02-25 14:58:49 -06:00
Jonathan Brassow
dd0ee35378 cmirror: Adjust region size to work around CPG msg limit to avoid hang.
cmirror uses the CPG library to pass messages around the cluster and maintain
its bitmaps.  When a cluster mirror starts-up, it must send the current state
to any joining members - a checkpoint.  When mirrors are large (or the region
size is small), the bitmap size can exceed the message limit of the CPG
library.  When this happens, the CPG library returns CPG_ERR_TRY_AGAIN.
(This is also a bug in CPG, since the message will never be successfully sent.)

There is an outstanding bug (bug 682771) that is meant to lift this message
length restriction in CPG, but for now we work around the issue by increasing
the mirror region size.  This limits the size of the bitmap and avoids any
issues we would otherwise have around checkpointing.

Since this issue only affects cluster mirrors, the region size adjustments
are only made on cluster mirrors.  This patch handles cluster mirror issues
involving pvmove, lvconvert (from linear to mirror), and lvcreate.  It also
ensures that when users convert a VG from single-machine to clustered, any
mirrors with too many regions (i.e. a bitmap that would be too large to
properly checkpoint) are trapped.
2015-02-25 14:42:15 -06:00
Petr Rockai
a88430c6a1 lvcreate.8: Mention --cachepolicy and --cachesettings. 2015-02-25 18:34:01 +01:00
Petr Rockai
0d313282f2 lvmcache.7: add a section on --cachepolicy/--cachesettings 2015-02-25 18:21:30 +01:00
David Teigland
aa30e95271 vgcfgbackup: enable foreign VG access
Backup of a foreign VG is allowed.
2015-02-25 11:01:37 -06:00
David Teigland
8668a9e81c systemid: silently ignore foreign vgs unless named
A foreign VG should be silently ignored by a reporting/display
command like 'vgs'.  If the reporting/display command specifies
a foreign VG by name on the command line, it should produce an
error message.

Scanning commands pvscan/vgscan/lvscan are always allowed to
read and update caches from all PVs, including those that belong
to foreign VGs.

Other non-report/display/scan commands always ignore a foreign
VG, or report an error if they attempt to use a foreign VG.

vgimport should always invalidate the lvmetad cache because
lvmetad likely holds a pre-vgexported copy of the VG.
(This is unrelated to using foreign VGs; the pre-vgexported
VG may have had no system_id at all.)
2015-02-25 10:53:52 -06:00
Alasdair G Kergon
4ff9abd01f toolcontext: Fix lvmlocal.conf load fail path. 2015-02-25 16:36:47 +00:00
Alasdair G Kergon
1e59c0346a example.conf: Update systemid comments.
Avoid using 'cluster' (ambiguous).
Add holding ref for machine-id source.
2015-02-25 14:22:24 +00:00
Alasdair G Kergon
809a5e142e systemid: Improve concurrent warning. 2015-02-25 14:17:35 +00:00
Alasdair G Kergon
ac6a4cd707 systemid: Allow empty systemid with warnings.
Add warning messages when empty system ID is set.
2015-02-25 14:12:24 +00:00
Petr Rockai
7d615a3fe5 cache: Fix a segfault when passing --cachepolicy without --cachesettings. 2015-02-24 11:39:35 +01:00
Alasdair G Kergon
5793ecd165 systemid: Extend --foreign to reporting commands.
Add --foreign to the remaining reporting and display commands plus
vgcfgbackup.
Add a NEEDS_FOREIGN_VGS flag for vgimport to always set --foreign.
If lvmetad is being used with --foreign, scan foreign VGs (currently
implemented as a full PV scan).
Handle these things centrally in lvmcmdline.c.
Also allow lvchange and vgchange -an/-aln to deactivate any foreign
LVs that happen to be active if something went wrong.
Remember to set the system ID when creating a new VG in vgsplit.
2015-02-23 23:41:38 +00:00
Alasdair G Kergon
b18feb98e5 systemid: Fix access restrictions.
When checking whether the system ID permits access to a VG, check for
each permitted situation first, and only then issue the appropriate
error message.  Always issue a message for now.  (We'll try to
suppress some of those later when the VG concerned wasn't explicitly
requested.)
Add more messages to try to ensure every return code is checked and
every error path (and only an error path) contains a log_error().
Add self-correction to vgchange -c to deal with situations where
the cluster state and system ID state are out-of-sync (e.g. if
old tools were used).
2015-02-23 23:19:36 +00:00
Alasdair G Kergon
df227be37c lvm1: Reenable sys ID.
Move the lvm1 sys ID into vg->lvm1_system_id and reenable the #if 0
LVM1 code.  Still display the new-style system ID in the same
reporting field, though, as only one can be set.
Add a format feature flag FMT_SYSTEM_ON_PVS for LVM1 and disallow
access to LVM1 VGs if a new-style system ID has been set.
Treat the new vg->system_id as const.
2015-02-23 23:03:52 +00:00
Alasdair G Kergon
2fc2928978 config: Rename allow_system_id to extra_system_ids.
Add warnings to the config file templates and briefly document
each value.
Configure lvmlocal.conf and install in /etc/lvm.
2015-02-23 22:19:08 +00:00
Alasdair G Kergon
3d406e5a8d config: Adjust system_id defaults.
Allow cmd->unknown_system_id to be cleared during toolcontext
refresh.
Set a default value of "none" for global/system_id_source.
Allow local/system_id to be empty so it's not impossible for
a later config file to remove it.
2015-02-23 21:20:51 +00:00
Alasdair G Kergon
e15b439bf3 systemid: Define file content more precisely.
In a file containing a system ID:
  Any whitespace at the start of a line is ignored;
  Blank lines are ignored;
  Any characters after a # are ignored along with the #.
  The system ID is obtained by processing the first line with
non-ignored characters.
  If further lines with non-ignored characters follow, a warning is
issued.
2015-02-23 20:49:15 +00:00
Alasdair G Kergon
c2ed5feee5 systemid: Add warnings if invalid.
Add WARNING messages if there are problems setting the requested
system ID.
Ban "localhost" as a prefix regardless of the system_id_source.
Use cmd->hostname instead of calling uname again.
Make system_id_source values case-insensitive (as with new settings like
log_debug_classes) and also accept machine-id to match the filename.
2015-02-23 20:36:27 +00:00
Alasdair G Kergon
6b6934b009 toolcontext: Include system_id in refresh.
Move _init_system_id() into _process_config() so it's also called when
refreshing the toolcontext.  Add WARNING to log_warn messages.
2015-02-23 20:21:00 +00:00
Alasdair G Kergon
72e6888dc3 toolcontext: Move lvmlocal.conf loading.
Load lvmlocal.conf after basic initialisation from lvm.conf.
2015-02-23 20:11:00 +00:00
Alasdair G Kergon
0551d1c56e systemid: Require alphanumeric 1st character.
Require system ID to begin with an alphanumeric character.
Rename fn to make clear it's only validation for systemid
and always terminate result rather than imposing this on the caller.
2015-02-23 19:47:03 +00:00
Alasdair G Kergon
a5df78e0f0 format_text: Fix creation_host_system_id.
Don't escape quotes - forbidden characters.
2015-02-23 19:19:48 +00:00
Alasdair G Kergon
cc5e3dbf24 format_text: Store creation_host_system_id.
Record the current system ID at the time of writing out VG metadata
in the outer section of it alongside the hostname and time.
2015-02-23 17:54:47 +00:00
Alasdair G Kergon
2a1189ebc3 config: Reinstate recursive tags setting.
In 2.02.99, _init_tags() inadvertently began to ignore the
dm_config_tree struct passed to it.  "tags" sections are not
merged together, so the "tags" section in the main config file was
being processed repeatedly and other "tags" sections were ignored.
2015-02-23 17:40:58 +00:00
Alasdair G Kergon
36a6c0df46 systemid: Add built-in systemid command.
Make it easy to find the system ID when testing.
Also show in general debug output.
2015-02-23 17:26:50 +00:00
Alasdair G Kergon
fcebf27a9f lvm-string: Fix HYPEN typo. 2015-02-23 17:09:35 +00:00
Alasdair G Kergon
4847836310 lvmetad: Add fn to scan only foreign VGs.
Not implemented yet - just a wrapper.
2015-02-23 17:03:03 +00:00
David Teigland
42ba7974c5 man lvmsystemid: update changing the system_id 2015-02-20 16:55:27 -06:00
David Teigland
cfd1b8eae2 man lvm: document --foreign option 2015-02-20 16:26:04 -06:00
David Teigland
37a47c0eec vgchange, vgcreate: add systemid option to command help 2015-02-20 15:31:17 -06:00
David Teigland
3361e662f4 man: systemid option for vgcreate and vgchange 2015-02-20 14:58:01 -06:00
David Teigland
55dd45239a tests: skip system_id machineid case when not available
instead of creating a fake /etc/machine-id file on the
system to test with.
2015-02-20 13:12:38 -06:00
David Teigland
e0946dca69 man lvmsystemid: expanded limitations and warnings 2015-02-20 12:21:23 -06:00
David Teigland
6bc35a351a report: fix foreign reporting without lvmetad 2015-02-19 15:24:31 -06:00
David Teigland
b896bf8f5a tests: add system_id test 2015-02-19 14:42:39 -06:00
David Teigland
0c6faaab43 doc: explanation of caching foreign VGs 2015-02-19 11:33:23 -06:00
David Teigland
97e3e84c2c man: update lvmthin about repair and recovery
Explain the thin metadata repair might not work.
Clarify that a full thin pool won't require fsck for journaled fs.
2015-02-19 10:49:39 -06:00
Peter Rajnoha
f80e7bb61b configure: typo in configure --with-default-raid10-segtype causing it to be unrecognized
AC_ARG_WITH(default-raid10r-segtype --> AC_ARG_WITH(default-raid10-segtype

(...raid10r... --> ...raid10... - extra "r")
2015-02-19 16:19:15 +01:00
Zdenek Kabelac
af395e61d5 cleanup: drop unused header file 2015-02-19 14:44:04 +01:00
Zdenek Kabelac
a18d789684 cleanup: simplify error path code
Mempool needs to free only with first alllocated element,
everything allocated afterwards is released as well.
2015-02-19 14:44:04 +01:00
Zdenek Kabelac
4c184e9d6b cleanup: drop unused value assign
Dop unused value assignments.

Unknown is detected via other combination
(!linear && !striped).

Also change the log_error() message into a warning,
since the function is not really returning error,
but still keep the INTERNAL_ERROR.

Ret value is always set later.
2015-02-19 14:43:25 +01:00
Peter Rajnoha
ed420fb691 pvcreate: switch to "none" dev-ext source during pvcreate
The dev ext source must be reset for the dev_cache_get call
(which evaluates filters), not lvmcache_label_scan - so fix
original commit 727c7ff85d.

Also, add comments in _pvcreate_check fn explaining why
refresh filter and rescan is needed and exactly in which
situations.
2015-02-19 14:34:55 +01:00
Peter Rajnoha
69b1e32c8a wiping: blkid: do not count skipped signatures in final number of wipes
We exclude some signatures from being wiped when using blkid wiping.
These are signatures which we simply overwrite. For example, the
LVM2_member signature which denotes a PV - if we call pvcreate on
existing PV, we just overwrite the PV header, no need to wipe it.

Previously, we counted such signatures as if they were wiped
and they were counted in the final number of wiped signatures
that _wipe_known_signatures_with_blkid fn returned in the "wiped"
output arg. Then the code checking this output arg could be
mislead that wiping happened while no wiping took place in real
and we could fire some code uselessly based on this information
(e.g. refreshing filters/rescanning - see also
commit 6b4066585f).
2015-02-19 13:30:05 +01:00
Petr Rockai
373f855684 clvmd: Fix BZ 1140095 by updating lastfd upon EINTR. 2015-02-18 12:45:43 +01:00
Petr Rockai
88411fb6f9 test: Avoid a race in pvmove-restart.sh. 2015-02-18 12:27:47 +01:00
Petr Rockai
733e3f6f98 test: Make pvmove0 device removal more robust, in pvmove-restart.sh. 2015-02-18 10:21:06 +01:00