github.com/swiftstack/ProxyFS@v0.0.0-20210203235616-4017c267d62f/docs/source/architecture/uml/flush.uml (about) 1 @startuml 2 3 skinparam sequenceTitleFontSize 40 4 skinparam sequenceTitleFontStyle bold 5 6 skinparam sequenceParticipantBackgroundColor #darkgrey 7 skinparam sequenceParticipantFontSize 8 8 9 skinparam sequenceGroupHeaderFontSize 9 10 11 title Flush 12 13 participant fs.Flush as "fs/api_internal.go::Flush()" 14 participant dlm 15 participant inode.Access as "inode/inode.go::Access()" 16 participant inode.Flush as "inode/file.go::Flush()" 17 participant inode.fetchInodeType as "inode/inode.go::fetchInodeType()" 18 participant inode.fetchInode as "inode/inode.go::fetchInode()" 19 participant inode.fetchOnDiskInode as "inode/inode.go::fetchOnDiskInode()" 20 participant headhunter.GetInodeRec as "headhunter/api_swift.go::GetInodeRec()" 21 participant cstruct.Unpack as "cstruct.Unpack()" 22 participant json.Unmarshal as "json.Unmarshal()" 23 participant sortedmap.OldBPlusTree as "sortedmap.OldBPlusTree()" 24 participant inode.flush as "inode/file.go::flush()" 25 participant inode.flushInode as "inode/inode.go::flushInode()" 26 participant inode.flushInodes as "inode/inode.go::flushInodes()" 27 participant inode.doFileInodeDataFlush as "inode/file_flusher.go::doFileInodeDataFlush()" 28 participant inode.fileInodeFlusherDaemon as "inode/file_flusher.go::fileInodeFlusherDaemon()" 29 participant inode.inFlightLogSegmentFlusher as "inode/file_flusher.go::inFlightLogSegmentFlusher()" 30 participant swiftclient.Close as "swiftclient.Close()" 31 participant inode.convertToOnDiskInodeV1 as "inode/inode.go::convertToOnDiskInodeV1()" 32 participant sortedmap.Flush as "sortedmap.Flush()" 33 participant json.Marshal as "json.Marshal()" 34 participant headhunter.PutInodeRecs as "headhunter/api_swift.go::PutInodeRecs()" 35 participant inode.deleteLogSegmentAsync as "inode/file.go::deleteLogSegmentAsync()" 36 participant swiftclient.ObjectDeleteAsync as "swiftclient.ObjectDeleteAsync()" 37 38 fs.Flush->dlm: obtain WriteLock 39 dlm->fs.Flush 40 fs.Flush->inode.Access: check for existence 41 inode.Access->fs.Flush 42 fs.Flush->inode.Access: check for write access 43 inode.Access->fs.Flush 44 fs.Flush->inode.Flush: request flush 45 inode.Flush->inode.fetchInodeType: fetch in-memory file inode object 46 inode.fetchInodeType->inode.fetchInode: fetch in-memory inode object 47 group if not in inode cache 48 inode.fetchInode->inode.fetchOnDiskInode: construct in-memory inode object 49 inode.fetchOnDiskInode->headhunter.GetInodeRec: fetch serialized inode 50 headhunter.GetInodeRec->inode.fetchOnDiskInode 51 inode.fetchOnDiskInode->cstruct.Unpack: unpack corruption field 52 cstruct.Unpack->inode.fetchOnDiskInode 53 inode.fetchOnDiskInode->cstruct.Unpack: unpack version field 54 cstruct.Unpack->inode.fetchOnDiskInode 55 inode.fetchOnDiskInode->json.Unmarshal: unpack json-encoded in-memory inode object 56 json.Unmarshal->inode.fetchOnDiskInode 57 inode.fetchOnDiskInode->sortedmap.OldBPlusTree: page in root of extent map 58 sortedmap.OldBPlusTree->inode.fetchOnDiskInode 59 inode.fetchOnDiskInode->inode.fetchInode 60 inode.fetchInode->inode.fetchInode: insert inode object in inode cache 61 end 62 inode.fetchInode->inode.fetchInodeType 63 inode.fetchInodeType->inode.Flush 64 inode.Flush->inode.flush 65 inode.flush->inode.flushInode 66 inode.flushInode->inode.flushInodes 67 group loop for each flushed inode 68 inode.flushInodes->inode.doFileInodeDataFlush: flush in-flight log segments 69 inode.doFileInodeDataFlush-->inode.fileInodeFlusherDaemon: ask daemon to collect log segment PUT completions 70 inode.fileInodeFlusherDaemon-->inode.inFlightLogSegmentFlusher: ask individual log segment PUT to complete 71 inode.inFlightLogSegmentFlusher->swiftclient.Close 72 swiftclient.Close->inode.inFlightLogSegmentFlusher 73 inode.inFlightLogSegmentFlusher-->inode.fileInodeFlusherDaemon 74 inode.fileInodeFlusherDaemon-->inode.doFileInodeDataFlush 75 inode.doFileInodeDataFlush->inode.flushInodes 76 inode.flushInodes->inode.flushInodes: append any newly unreferenced log segments 77 inode.flushInodes->inode.convertToOnDiskInodeV1 78 inode.convertToOnDiskInodeV1->sortedmap.Flush: flush extent map 79 sortedmap.Flush->inode.convertToOnDiskInodeV1 80 inode.convertToOnDiskInodeV1->inode.flushInodes 81 inode.flushInodes->json.Marshal 82 json.Marshal->inode.flushInodes 83 end 84 inode.flushInodes->headhunter.PutInodeRecs: atomically update headhunter for all flushed inodes 85 headhunter.PutInodeRecs->inode.flushInodes 86 group loop for any newly unreferenced log segments 87 inode.flushInodes->inode.deleteLogSegmentAsync 88 inode.deleteLogSegmentAsync->swiftclient.ObjectDeleteAsync 89 swiftclient.ObjectDeleteAsync->inode.deleteLogSegmentAsync 90 inode.deleteLogSegmentAsync->inode.flushInodes 91 end 92 inode.flushInodes->inode.flushInode 93 inode.flushInode->inode.flush 94 inode.flush->inode.Flush 95 inode.Flush->fs.Flush 96 fs.Flush->dlm: release WriteLock 97 dlm->fs.Flush 98 99 @enduml