1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/libdm
Zdenek Kabelac a900d150e4 thin: move pool messaging from resume to suspend
Existing messaging intarface for thin-pool has a few 'weak' points:

* Message were posted with each 'resume' operation, thus not allowing
activation of thin-pool with the existing state.

* Acceleration skipped suspend step has not worked in cluster,
since clvmd resumes only nodes which are suspended (have proper lock
state).

* Resume may fail and code is not really designed to 'fail' in this
phase (generic rule here is resume DOES NOT fail unless something serious
is wrong and lvm2 tool usually doesn't handle recovery path in this case.)

* Full thin-pool suspend happened, when taken a thin-volume snapshot.

With this patch the new method relocates message passing into suspend
state.

This has a few drawbacks with current API, but overal it performs
better and gives are more posibilities to deal with errors.

Patch introduces a new logic for 'origin-only' suspend of thin-pool and
this also relates to thin-volume when taking snapshot.

When suspend_origin_only operation is invoked on a pool with
queued messages then only those messages are posted to thin-pool and
actual suspend of thin pool and data and metadata volume is skipped.

This makes taking a snapshot of thin-volume lighter operation and
avoids blocking of other unrelated active thin volumes.

Also fail now happens in 'suspend' state where the 'Fail' is more expected
and it is better handled through error paths.

Activation of thin-pool is now not sending any message and leaves upto a tool
to decided later how to finish unfinished double-commit transaction.

Problem which needs some API improvements relates to the lvm2 tree
construction. For the suspend tree we do not add target table line
into the tree, but only a device is inserted into a tree.
Current mechanism to attach messages for thin-pool requires the libdm
to know about thin-pool target, so lvm2 currently takes assumption, node
is really a thin-pool and fills in the table line for this node (which
should be ensured by the PRELOAD phase, but it's a misuse of internal API)
we would possibly need to be able to attach message to 'any' node.

Other thing to notice - current messaging interface in thin-pool
target requires to suspend thin volume origin first and then send
a create message, but this could not have any 'nice' solution on lvm2
side and IMHO we should introduce something like 'create_after_resume'
message.

Patch also changes the moment, where lvm2 transaction id is increased.
Now it happens only after successful finish of kernel transaction id
change. This change was needed to handle properly activation of pool,
which is in the middle of unfinished transaction, and also this corrects
usage of thin-pool by external apps like Docker.
2015-07-03 16:13:14 +02:00
..
datastruct Use void pointer instead of char for binary key 2011-03-10 12:48:40 +00:00
ioctl libdm: Add dm_task_get_errno to return ioctl errno. 2015-05-26 15:13:49 +01:00
misc libdm: Add DM_INTERNAL_SUSPEND_FLAG. 2015-04-23 18:39:04 +01:00
mm cleanup: indents comments backtraces 2014-11-10 22:05:49 +01:00
regex cleanup: add braces for if() 2014-07-02 10:45:43 +02:00
.exported_symbols libdm: new dm_task_get_info with internal_suspend 2015-05-15 16:48:22 +02:00
.exported_symbols.Base libdm: new dm_task_get_info with internal_suspend 2015-05-15 16:48:22 +02:00
.exported_symbols.DM_1_02_97 libdm: new dm_task_get_info with internal_suspend 2015-05-15 16:48:22 +02:00
.exported_symbols.DM_1_02_98 libdm: Add dm_task_get_errno to return ioctl errno. 2015-05-26 15:13:49 +01:00
.exported_symbols.DM_1_02_99 libdm: add dm_tree_node_set_thin_pool_read_only 2015-06-18 15:15:39 +02:00
.exported_symbols.DM_1_02_100 config: add support for config value formatting flags 2015-06-24 11:13:37 +02:00
.exported_symbols.DM_1_02_101 report: add infrastructure to recognize fuzzy reserved names and returning dynamic reserved values 2015-07-03 10:47:09 +02:00
libdevmapper.h report: add infrastructure to recognize fuzzy reserved names and returning dynamic reserved values 2015-07-03 10:47:09 +02:00
libdevmapper.pc.in Switch to use Requires.private for devmapper.pc and lvm2app.pc 2010-05-11 08:54:11 +00:00
libdm-common.c libdm-common.c: remove trailing whitespace 2015-05-12 17:16:49 +02:00
libdm-common.h libdm: introduce and use DEV_UUID macro 2012-10-10 17:16:15 +02:00
libdm-config.c config: also clone associated id when cloning node using dm_config_clone_node{_with_mem} 2015-06-25 10:21:07 +02:00
libdm-deptree.c thin: move pool messaging from resume to suspend 2015-07-03 16:13:14 +02:00
libdm-file.c debug: show sys errors 2015-05-08 15:15:10 +02:00
libdm-report.c report: select: add handler to recognize fuzzy time specification 2015-07-03 10:51:31 +02:00
libdm-string.c cleanup: libdm simplier error comparation 2014-07-02 10:45:42 +02:00
Makefile.in makefiles: better clean 2015-05-18 12:45:42 +02:00