Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| transactions [2007/09/18 11:42] – Get transaction id is incompatible with nested transactions. Although we don't support them currently, lets keep the interface open for it. DiomidisSpinellis | transactions [2021/03/28 08:35] (current) – Unlink Kirks surname KubilayKocak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| This page is for sharing the design and progress of the project to add transaction support to %%FreeBSD%%. | This page is for sharing the design and progress of the project to add transaction support to %%FreeBSD%%. | ||
| - | |||
| - | [[TableOfContents(3)|TableOfContents(3)]] | ||
| ====== Overview ====== | ====== Overview ====== | ||
| The objective of this project is to allow a process to start a transaction that can be later committed or aborted. | The objective of this project is to allow a process to start a transaction that can be later committed or aborted. | ||
| - | ====== Design ====== | + | ====== |
| - | Transactions are based on snapshots. | + | Transactions are based on snapshots. |
| - | * if the process modifying the block is not part of a transaction, | + | * if the process modifying the block is not part of a transaction, |
| - | * if the block has already been copied in the transaction' | + | * if the block has already been copied in the transaction' |
| - | * the corresponding call is blocked, waiting for the transaction to complete, | + | * the corresponding call is blocked, waiting for the transaction to complete, |
| * otherwise (or when the call unblocks) the block is written to the live filesystem, without making a copy of the old contents to the snapshot file, | * otherwise (or when the call unblocks) the block is written to the live filesystem, without making a copy of the old contents to the snapshot file, | ||
| * otherwise, the old block is copied to the snapshot file as usual. | * otherwise, the old block is copied to the snapshot file as usual. | ||
| When the transaction terminates (through a commit or abort) the transaction id of all processes of that transaction is cleared. | When the transaction terminates (through a commit or abort) the transaction id of all processes of that transaction is cleared. | ||
| - | | + | |
| - | * all the snapshot' | + | |
| - | * the snapshot file is released, and | + | * all the snapshot' |
| + | * the snapshot file is released, and | ||
| * then waiting processes are notified. | * then waiting processes are notified. | ||
| When a process whose process id is the same as its transaction id terminates, the process id of the first of the remaining transaction processes is selected as a new transaction id, and it is assigned to all remaining transaction processes. | When a process whose process id is the same as its transaction id terminates, the process id of the first of the remaining transaction processes is selected as a new transaction id, and it is assigned to all remaining transaction processes. | ||
| + | ZFS already provides support for rolling back to a snapshot (sys/ | ||
| + | |||
| + | ====== Three-Way Merge Design ====== | ||
| + | A snapshot (A) is created at the start of the transaction. | ||
| ====== API ====== | ====== API ====== | ||
| ===== System Level ===== | ===== System Level ===== | ||
| * int transaction(int request, ...) | * int transaction(int request, ...) | ||
| - | * TR_BEGIN, char %%**%%transacted_filesystems | + | * TR_BEGIN, int pid, char %%**%%transacted_filesystems |
| - | * TR_COMMIT | + | * TR_COMMIT, int tid |
| - | * TR_ABORT | + | * TR_ABORT, int tid |
| * All gated system calls can return E_TRVIOL (Transaction violation): a transaction attempted to modify data on a filesystem that is not under transaction control. | * All gated system calls can return E_TRVIOL (Transaction violation): a transaction attempted to modify data on a filesystem that is not under transaction control. | ||
| ===== User level ===== | ===== User level ===== | ||
| - | transaction -b filesystem ... | -a | -g | + | transaction -b filesystem ... |
| ====== Progress ====== | ====== Progress ====== | ||
| * Rough design overview (dds - 2007-06-22) | * Rough design overview (dds - 2007-06-22) | ||
| * API documentation, | * API documentation, | ||
| + | * Commit API skeleton (dds - 2007-09-18) | ||
| ====== TODO ====== | ====== TODO ====== | ||
| * Any issues with deleted and allocated blocks? | * Any issues with deleted and allocated blocks? | ||
| + | * Nested transactions? | ||
| + | * Jails? | ||
| ====== References ====== | ====== References ====== | ||
| - | * [http:// | + | * [[http:// |
| - | * Marshall Kirk McKusick and George V. Neville-Neil. //The Design and Implementation of the %%FreeBSD%% Operating System//. Addison-Wesley, | + | * Marshall Kirk %%McKusick%% and George V. Neville-Neil. //The Design and Implementation of the %%FreeBSD%% Operating System//. Addison-Wesley, |
| - | * [http:// | + | * [[http:// |
| - | * [http:// | + | * [[http:// |
| - | * [http:// | + | * [[http:// |
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | |||
| + | ---- | ||
| + | |||
| + | {{tag> | ||