Zdenek Kabelac [Thu, 10 Nov 2011 12:40:29 +0000 (12:40 +0000)]
Thin move _read_activation_params check
Since we finaly recognize thin creation only after
_determine_snapshot_type() - move _read_activation_params()
after it - so we can support lvcreate -an thin snapshot.
Petr Rockai [Mon, 7 Nov 2011 17:11:23 +0000 (17:11 +0000)]
Correctly handle concurrent read (CR) locks in singlenode clvmd. This means
that we can also test clustered volume groups (vgcreate -c y) in the test
suite. Unfortunately we can't make this the testing default since cluster
mirrors require further infrastructure, and snapshots probably don't work at
all. I'll eventually add a few test cases that create clustered VGs
specifically.
Zdenek Kabelac [Thu, 3 Nov 2011 14:59:20 +0000 (14:59 +0000)]
Thin removing limitation on activation of pool device.
Since activation of pool is now independent on thin activation,
user may do whatever he needs - thought preferable thin should stay alive,
but it it will be found inactivate, update_pool will bring the pool up.
Zdenek Kabelac [Thu, 3 Nov 2011 14:56:20 +0000 (14:56 +0000)]
Thin using update_pool_lv
Replace detach_pool_messages with update_pool_lv.
Move creation code from to 'if' condition into 1.
Ensure creation has finished all previous message operations.
Zdenek Kabelac [Thu, 3 Nov 2011 14:52:09 +0000 (14:52 +0000)]
Add -tpool layer in activation tree
Let's put the overlay device over real thin pool device.
So we can get the proper locking on cluster.
Overwise the pool LV would be activate once implicitely
and in other case explicitely, confusing locking mechanism.
This patch make the activation of pool LV independent on
activation of thin LV since they will both implicitely use
real -thin pool device.
Zdenek Kabelac [Thu, 3 Nov 2011 14:43:21 +0000 (14:43 +0000)]
Thin api change for dm_tree_node_add_thin_target
A little code shuffling and adding support for
DM_THIN_ERROR_DEVICE_ID which might be eventually be used
for activation of thin which is going to be deleted.
For now we do not need it lvm.
Peter Rajnoha [Mon, 31 Oct 2011 12:22:49 +0000 (12:22 +0000)]
Add "ExecReload" to dm-event.service for systemd to reload dmeventd properly.
Normally, restart simply means "stop and start" for systemd. However, if
we're installing new versions of the dmeventd binary/libdevmapper, we need
to restart dmeventd. This fails if we have some devices monitored - we need
to call "dmeventd -R" instead.
The "ExecReload" did not work quite well in some old versions of systemd,
systemd assumed that only the configuration is reloaded on "ExecReload",
not the whole binary itself so it lost track of dmeventd daemon (it lost new
dmeventd PID). This is fixed and seems to be working fine now with recent
versions of dmeventd.
Zdenek Kabelac [Sun, 30 Oct 2011 22:07:38 +0000 (22:07 +0000)]
Thin creation without activation
All thins are created with the next activation and VG is updated
without messages. Only some basic commands works.
(i.e. lvcreate -an -V10 -T mvg/pool)
There can be some combination to confuse this system.
This functionality for snapshots is going to be interesting.
Zdenek Kabelac [Sun, 30 Oct 2011 22:02:18 +0000 (22:02 +0000)]
Cleanup unsuccessfully created thin LV
If something fails during creation of thin LV remove such LV
and deactivate in case it's been already tried to activate
(i.e. thin kernel driver fails for some reason.)
Zdenek Kabelac [Fri, 28 Oct 2011 20:28:00 +0000 (20:28 +0000)]
Thin pool activation change
To ensure we properly handle LV cluster locking - explicitely do
not allow to change the availability of the thin pool that is in use
for some thin LV.
As soon as the thin volume is created the only way to activate pool
is via implicit dependency.
Ignore thinpool open count for lv/vgchange operations.
Zdenek Kabelac [Fri, 28 Oct 2011 20:17:55 +0000 (20:17 +0000)]
Extend virtual segment instead of adding new one
Before adding a new virtual segment to LV, check first whether
the last segment isn't already of the same type. In this case
extend last segment instead of creating the new one.
Thin volumes should have always only 1 virtual segment, but it
helps also to virtual snapshot or error segtype..
Zdenek Kabelac [Fri, 28 Oct 2011 20:11:21 +0000 (20:11 +0000)]
Trying to fix the retry logic
There should be no need for retry for our internal devices - it would be hinding
our own bug in the tree processing.
Update error messages to show also also device name.
No WHATS_NEW - in release fix.
Git commit ID 0864378250956c310cb81608978d091fcdcc97d8 was meant to disallow
'mirrored' logs for cluster mirrors. However, when add_mirror_log is used
to create the log (as is now the case when using 'lvcreate' or converting only
the log) the check is bypassed.
Zdenek Kabelac [Mon, 24 Oct 2011 10:24:39 +0000 (10:24 +0000)]
Don't print char type[8] as a plain string
pvck prints 'extra' character from the label since there is no '\0'
after the struct label entry and just uint64_t follows directly.
So avoid it by limiting 8 chars to be printed.
Zdenek Kabelac [Sat, 22 Oct 2011 16:44:23 +0000 (16:44 +0000)]
Recoded way to insert thin pool into vg
Code in _lv_insert_empty_sublvs was not able to provide proper
initialization order for thin pool LV.
New function extend_pool() first adds metadata segment to pool LV which
is still visible. Such LV is activate and cleared.
Then new meta LV is created and metadata segments are moved there.
Now the preallocated pool data segment is attached to the pool LV
and layer _tpool is created. Finaly segment is marked as thin_pool.
Alasdair Kergon [Fri, 21 Oct 2011 15:49:45 +0000 (15:49 +0000)]
Pass exclusive LV locks to all nodes in the cluster.
This was the intended behaviour, as described in the lvchange man page, so you
have complete control through volume_list in lvm.conf, but the code seems to
have been treating -ae as local-only for a very long time.
Zdenek Kabelac [Thu, 20 Oct 2011 13:39:57 +0000 (13:39 +0000)]
Mark chunk memory for free as defined again for valgrind
When DEBUG_MEM is used, the memory is trashed with extra pattern before real
free() is called, and as this memory was marked as non accessible when used with
valgrind, make it again usable.