]> xenbits.xensource.com Git - xen.git/commit
xenstore: rework of transaction handling
authorJuergen Gross <jgross@suse.com>
Fri, 31 Mar 2017 11:29:19 +0000 (13:29 +0200)
committerWei Liu <wei.liu2@citrix.com>
Mon, 3 Apr 2017 13:04:34 +0000 (14:04 +0100)
commitf2bebf72c4d51aa954aabae468587e626f95ce98
treebfeab8f82729551721beb2370d9a673fb2f13305
parent607dca6a141716630fc87879727195ea1670dcfb
xenstore: rework of transaction handling

The handling of transactions in xenstored is rather clumsy today:

- Each transaction in progress is keeping a local copy of the complete
  xenstore data base
- A transaction will fail as soon as any node is being modified outside
  the transaction

This is leading to a very bad behavior in case of a large xenstore.
Memory consumption of xenstored is much higher than necessary and with
many domains up transactions failures will be more and more common.

Instead of keeping a complete copy of the data base for each
transaction store the transaction data in the same data base as the
normal xenstore entries prepended with the transaction in the single
nodes either read or modified. At the end of the transaction walk
through all nodes accessed and check for conflicting modifications.
In case no conflicts are found write all modified nodes to the data
base without transaction identifier.

Following tests have been performed:
- create/destroy of various domains, including HVM with ioemu-stubdom
  (xenstored and xenstore-stubdom)
- multiple concurrent runs of xs-test over several minutes
  (xenstored and xenstore-stubdom)
- test for memory leaks of xenstored by dumping talloc reports before
  and after the tests

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_core.h
tools/xenstore/xenstored_domain.c
tools/xenstore/xenstored_domain.h
tools/xenstore/xenstored_transaction.c
tools/xenstore/xenstored_transaction.h