From 04d166f9a90db05958a3f2ed713244724d2b9004 Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Fri, 1 Jul 2022 07:50:48 +0900 Subject: Add README to describe librefop algorithm This patch add README, that have overview of this library and algorithm. Bug-AGL: SPEC-4500 Signed-off-by: Naoto Yamaguchi Change-Id: I6eed0d004e7cebddbd3a3b08da07ebdbf1a3048c --- README | 208 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..35b4557 --- /dev/null +++ b/README @@ -0,0 +1,208 @@ +Redundancy file operation library (librefop) + +Redundancy file operation library is a another implementation for the backup +manager of AGL base system. It aim to tiny implementation. + + +File operation algorithm + +New data write - case 1.. + +1-0. Initial state. + + -------- +| latest | +| file | + -------- + +1-1. Create new file. + + -------- +| New | +| file | + -------- + + -------- +| latest | +| file | + -------- + +1-2. Rename from latest file to backup file. + + -------- +| New | +| file | + -------- + + -------- + --> | backup | + rename | file | + -------- + +1-3. Create new data file. + + | rename from new to latest + -------- -------- +| latest | | backup | +| file | | file | + -------- -------- + +1-4. Done. + + +New data write - case 2. + +2-0. Initial state. + + -------- -------- +| latest | | backup | +| file | | file | + -------- -------- + +2-1. Create new file. + + -------- +| New | +| file | + -------- + + -------- -------- +| latest | | backup | +| file | | file | + -------- -------- + +2-2. Remove backup file. + + -------- +| New | +| file | + -------- + + -------- +| latest | remove +| file | backup file + -------- + +2-3. Rename from latest file to backup file. + + -------- +| New | +| file | + -------- + + -------- + --> | backup | + rename | file | + -------- + +2-4. Create new data file. + + | rename from new to latest + -------- -------- +| latest | | backup | +| file | | file | + -------- -------- + +2-5. Remove oldest backup file. + + -------- -------- +| New | | backup | +| file | | file | + -------- -------- + +2-6. Done. + + +Recovery from abnormal conditions. + +Note. 'p1,p2' is a file selection priority. [High pri.] p1 > p2 [Low pri.] + +ac1. Nodata + +Return a no data. + + +ac2. Latest file only. + + -------- +| latest | +| file | + -------- + p1 + +Return data from a latest file. + + +ac3. Backup file only. + + -------- + | backup | + | file | + -------- + p1 + +Return data from a backup file. + + +ac4. Have a two file (normal condition). + + -------- -------- +| latest | | backup | +| file | | file | + -------- -------- + p1 p2 + +Return data from a latest file. + + +ac5. Latest file and new file. + + -------- +| New | +| file | + -------- + + -------- +| latest | +| file | + -------- + p1 + +Return data from a new file. Typically new file may not completed write operation. + + +ac6. Backup file and new file. + + -------- +| New | +| file | + -------- + + -------- + | backup | + | file | + -------- + p1 + +Return data from a backup file. Typically new file may not completed write operation. + + +ac7. Latest file and backup file and new file. + + -------- +| New | +| file | + -------- + + -------- -------- +| latest | | backup | +| file | | file | + -------- -------- + p1 p2 + +Return data from a latest file. Typically new file may not completed write operation. + +When the data block of high priority file was broken, this library select next priority file. + + + -- cgit