From af4521650753f31939af6f3475e99d0554ee6cc2 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 27 Dec 2021 14:50:08 +0100 Subject: [PATCH] Added documentation for some fuse-operations --- .../sequence/fuse_operations/fallocate.puml | 40 ++++++++++++++ .../sequence/fuse_operations/init.puml | 22 ++++++++ .../sequence/fuse_operations/open-r.puml | 19 +++++++ .../open-rw_local_not-owner.puml | 50 +++++++++++++++++ .../fuse_operations/open-rw_local_owner.puml | 44 +++++++++++++++ .../open-rw_not-local_not-owner.puml | 54 +++++++++++++++++++ .../sequence/fuse_operations/read.puml | 33 ++++++++++++ .../sequence/fuse_operations/write.puml | 39 ++++++++++++++ docs/diagrams/sequence/heartbeat.puml | 25 +++++++++ 9 files changed, 326 insertions(+) create mode 100644 docs/diagrams/sequence/fuse_operations/fallocate.puml create mode 100644 docs/diagrams/sequence/fuse_operations/init.puml create mode 100644 docs/diagrams/sequence/fuse_operations/open-r.puml create mode 100644 docs/diagrams/sequence/fuse_operations/open-rw_local_not-owner.puml create mode 100644 docs/diagrams/sequence/fuse_operations/open-rw_local_owner.puml create mode 100644 docs/diagrams/sequence/fuse_operations/open-rw_not-local_not-owner.puml create mode 100644 docs/diagrams/sequence/fuse_operations/read.puml create mode 100644 docs/diagrams/sequence/fuse_operations/write.puml create mode 100644 docs/diagrams/sequence/heartbeat.puml diff --git a/docs/diagrams/sequence/fuse_operations/fallocate.puml b/docs/diagrams/sequence/fuse_operations/fallocate.puml new file mode 100644 index 0000000..b0ce4f5 --- /dev/null +++ b/docs/diagrams/sequence/fuse_operations/fallocate.puml @@ -0,0 +1,40 @@ +@startuml +autonumber +hide footbox + +footer "LTDFS | Ruakij" + +title "Allocate space for opened file" + +participant Client +control SiteA +boundary SiteB +boundary "Other Sites" as Others + +Client -> SiteA ++ : fallocate +SiteA -> SiteA : Check owner +alt SiteA is owner + + SiteA -> SiteA : Allocate space + alt No space left + + SiteA --> Client : No space left\non device + + end + + SiteA ->> Others : Section changed + +else SiteB is owner + + SiteA -> SiteB ++ : Allocate space + + SiteB -> SiteB : Allocate space + SiteB ->> Others : Section changed + SiteB --> SiteA -- : Done + + SiteA ->> SiteA : Update cache + +end +SiteA --> Client -- : Done + +@enduml \ No newline at end of file diff --git a/docs/diagrams/sequence/fuse_operations/init.puml b/docs/diagrams/sequence/fuse_operations/init.puml new file mode 100644 index 0000000..b321627 --- /dev/null +++ b/docs/diagrams/sequence/fuse_operations/init.puml @@ -0,0 +1,22 @@ +@startuml +autonumber +hide footbox + +footer "LTDFS | Ruakij" + +title "Initialize FS" + +control SiteA +boundary "Other Sites" as Others + +SiteA ++ +SiteA -> Others ++ : TCP-Connect + +SiteA -> Others : Get Indexes +Others --> SiteA : Indexes +note right +Indexes without +entries from SiteA +end note + +@enduml \ No newline at end of file diff --git a/docs/diagrams/sequence/fuse_operations/open-r.puml b/docs/diagrams/sequence/fuse_operations/open-r.puml new file mode 100644 index 0000000..b51ba69 --- /dev/null +++ b/docs/diagrams/sequence/fuse_operations/open-r.puml @@ -0,0 +1,19 @@ +@startuml +autonumber +hide footbox + +footer "LTDFS | Ruakij" + +title "Open Read" + +participant Client +control SiteA + + +Client -> SiteA ++ : Open [r] + + SiteA -> SiteA : Check availablility + +SiteA --> Client -- : File opened + +@enduml \ No newline at end of file diff --git a/docs/diagrams/sequence/fuse_operations/open-rw_local_not-owner.puml b/docs/diagrams/sequence/fuse_operations/open-rw_local_not-owner.puml new file mode 100644 index 0000000..c13bbb2 --- /dev/null +++ b/docs/diagrams/sequence/fuse_operations/open-rw_local_not-owner.puml @@ -0,0 +1,50 @@ +@startuml +autonumber +hide footbox + +footer "LTDFS | Ruakij" + +header "Local\nNot Owner" +title "Open Read&Write" + +participant Client +control SiteA +boundary SiteB +boundary "Other Sites" as Others + + +Client -> SiteA ++ : Open [rw] + + SiteA -> SiteA : Check owner + alt SiteB is owner + + SiteA -> SiteA : Check availablility + alt File is locally available + + SiteA -> SiteB ++ : Transfer ownership + + SiteB -> SiteB : Lock file + alt Already locked + + SiteB --> SiteA : File is locked + SiteA --> Client : File is locked + + else Locked + + SiteB ->> Others : File locked &\nOwnership changed + note left + Distribute Info + about Lock & Ownership + end note + + SiteB --> SiteA -- : Ready + + SiteA --> Client -- : File opened + + end + + end + + end + +@enduml \ No newline at end of file diff --git a/docs/diagrams/sequence/fuse_operations/open-rw_local_owner.puml b/docs/diagrams/sequence/fuse_operations/open-rw_local_owner.puml new file mode 100644 index 0000000..61d5d36 --- /dev/null +++ b/docs/diagrams/sequence/fuse_operations/open-rw_local_owner.puml @@ -0,0 +1,44 @@ +@startuml +autonumber +hide footbox + +footer "LTDFS | Ruakij" + +header "Local\nOwner" +title "Open Read&Write" + +participant Client +control SiteA +boundary "Other Sites" as Others + + +Client -> SiteA ++ : Open [rw] + + SiteA -> SiteA : Check owner + alt Client is owner + + SiteA -> SiteA : Lock file + alt Already locked + + SiteA --> Client : File is locked + + else Locked + + SiteA ->> Others : File locked + note left + Distribute Info + about Lock + end note + + end + + end + + SiteA -> SiteA : Check availablility + alt Locally available + + SiteA --> Client -- : File opened + + end + +@enduml \ No newline at end of file diff --git a/docs/diagrams/sequence/fuse_operations/open-rw_not-local_not-owner.puml b/docs/diagrams/sequence/fuse_operations/open-rw_not-local_not-owner.puml new file mode 100644 index 0000000..e92c79f --- /dev/null +++ b/docs/diagrams/sequence/fuse_operations/open-rw_not-local_not-owner.puml @@ -0,0 +1,54 @@ +@startuml +autonumber +hide footbox + +footer "LTDFS | Ruakij" + +header "Not Local\nNot Owner" +title "Open Read&Write" + +participant Client +control SiteA +boundary SiteB +boundary "Other Sites" as Others + + +Client -> SiteA ++ : Open [rw] + + SiteA -> SiteA : Check owner + alt SiteB is owner + + SiteA -> SiteA : Check availablility + alt File is not locally available + + SiteA -> SiteB ++ : Lock file + + SiteB -> SiteB : Lock file + alt Already locked + + SiteB --> SiteA : File is locked + SiteA --> Client : File is locked + + else Locked + + SiteB ->> Others : File locked + note left + Distribute Info + about Lock + end note + + SiteB --> SiteA -- : Ready + SiteA --> Client -- : File opened + + note right + When reading or writing, + data will now be streamed. + > See read.puml for more Info + end note + end + + end + + end + +@enduml \ No newline at end of file diff --git a/docs/diagrams/sequence/fuse_operations/read.puml b/docs/diagrams/sequence/fuse_operations/read.puml new file mode 100644 index 0000000..ef354f2 --- /dev/null +++ b/docs/diagrams/sequence/fuse_operations/read.puml @@ -0,0 +1,33 @@ +@startuml +autonumber +hide footbox + +footer "LTDFS | Ruakij" + +title "Read from opened file" + +participant Client +control SiteA +boundary SiteB + + +Client -> SiteA ++ : Read Section + + SiteA -> SiteA : Check availablility + alt Not locally available + + SiteA -> SiteB ++ : Read Section + SiteB --> SiteA -- : Section-Data + note right + Section-Data is + being streamed + end note + + SiteA ->> SiteA ++ : Save in cache + SiteA -- + + end + +SiteA --> Client -- : Section-Data + +@enduml \ No newline at end of file diff --git a/docs/diagrams/sequence/fuse_operations/write.puml b/docs/diagrams/sequence/fuse_operations/write.puml new file mode 100644 index 0000000..b034ce5 --- /dev/null +++ b/docs/diagrams/sequence/fuse_operations/write.puml @@ -0,0 +1,39 @@ +@startuml +autonumber +hide footbox + +footer "LTDFS | Ruakij" + +title "Write to opened file" + +participant Client +control SiteA +boundary SiteB +boundary "Other Sites" as Others + +Client -> SiteA ++ : Section-Data +SiteA -> SiteA : Check owner +alt SiteA is owner + + SiteA -> SiteA ++ : Save Data + SiteA --> SiteA -- : Done + + SiteA ->> Others : Section changed + +else SiteB is owner + + SiteA -> SiteA ++ : Save in cache + note right : Write-Back Cache + + SiteA ->> SiteB ++ : Write Section-Data + + SiteB -> SiteB ++ : Save Data + SiteB-- + SiteB ->> Others -- : Section changed + + SiteA --> SiteA -- : Done + +end +SiteA --> Client -- : Done + +@enduml \ No newline at end of file diff --git a/docs/diagrams/sequence/heartbeat.puml b/docs/diagrams/sequence/heartbeat.puml new file mode 100644 index 0000000..f749a0b --- /dev/null +++ b/docs/diagrams/sequence/heartbeat.puml @@ -0,0 +1,25 @@ +@startuml +autonumber +hide footbox + +footer "LTDFS | Ruakij" + +header "Every few seconds" +title "Heartbeat" + +control SiteA +boundary "Other Sites" as Others + +SiteA ++ +SiteA -> SiteA : Get latest changes\nin local cache +note right +Changes since +last heartbeat +end note + +SiteA ->> Others ++ : Distribute changed\nlocal-cache-indexes +SiteA-- + +Others -> Others : Apply changes to\navailability-index + +@enduml \ No newline at end of file