diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2024-11-03 12:30:18 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2024-11-03 12:30:18 -0300 |
| commit | 1f4a38355e33ae8fec6bcc82d12ac8c42831e636 (patch) | |
| tree | eafea05ac1fc6b68f7026b3fc75b0d8e7dac7255 | |
| parent | b2bdbce941256a8ffc52af09023bb75b4372276d (diff) | |
| download | Sakura-1f4a38355e33ae8fec6bcc82d12ac8c42831e636.tar.gz Sakura-1f4a38355e33ae8fec6bcc82d12ac8c42831e636.zip | |
add transaction doc
| -rw-r--r-- | docs/transaction-algo.org | 12 | ||||
| -rw-r--r-- | lib/transaction.ml | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/docs/transaction-algo.org b/docs/transaction-algo.org new file mode 100644 index 0000000..22903ec --- /dev/null +++ b/docs/transaction-algo.org @@ -0,0 +1,12 @@ +* Check if temporary file with the command hash with exists +To hash the command, we must hash its bytes without the timestamp, +since it will always vary given it's a transactional time, and add +instead the commit HEAD of the state of the database. + +If such file exists, load the transaction and storage offsets +alongside the command and attempt to write it as a recovery. +* Get the transaction offset of the transaction graph file AND storage file +* Write the offsets to a tmp file +* Write the command with a flag **flushed** set to false to a tmp file +* Attempt to execute the command +* Delete the temporary file diff --git a/lib/transaction.ml b/lib/transaction.ml new file mode 100644 index 0000000..7ae98ab --- /dev/null +++ b/lib/transaction.ml @@ -0,0 +1,2 @@ +let transaction () = + () |
