forked from mirage/ocaml-xenstore
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
store: add a second transaction merge algorithm
The existing transaction merge algorithm keeps track of the least upper bound of all the nodes which have been read and written, and will re-combine two stores which have disjoint upper bounds. This works well for small transactions but the larger ones such used in * VM start: creates /vm/... /vss/... /local/domain/... The least upper bound of this transaction is / and so all these transactions conflict with everything * Device hotplug: creates /local/domain/n /local/domain/m The least upper bound of this transaction is /local/domain so all these transactions conflict with each other If the existing merge algorithm cannot merge and commit, we attempt a /replay/ of the failed transaction against the new store. During the first run through of a transaction we store both the request received and the response sent to the client. When we replay the requests we check whether the response sent to the client is the same. If the responses are all the same then the transaction replay can be committed. If any differ then the transaction replay must be aborted and the client must retry. This algorithm uses the intuition that the transactions made by the toolstack are designed to be for separate domains, and should fundamentally not conflict in the sense that they don't read or write any shared keys. By replaying the transaction on the server side we do what the client would have to do anyway, only we can do it quickly without allowing any other requests to interfere. Performing 300 parallel simulated VM start and shutdowns without this code: djs@ely:~/ocaml-xenstore$ ./_build/bench/xsbench -path /tmp/socket -n 300 300 parallel starts and shutdowns: 395.47 Performing 300 parallel simulated VM start and shutdowns with this code: djs@ely:~/ocaml-xenstore$ ./_build/bench/xsbench -path /tmp/socket -n 300 300 parallel starts and shutdowns: 4.33
- Loading branch information
David Scott
committed
Aug 10, 2012
1 parent
3b05317
commit 0735988
Showing
10 changed files
with
336 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ To-do list | |
|
||
11. Add mirage domain frontend | ||
|
||
12. Remove exceptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.