You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because timestamps depend on a monotonic timestamp that depends on boot, files
need to be renamed to ensure future writes have higher timestamps to be
considered newer and be uploaded to xapi.
On top of this, allows to report about remnant temporary files, delete invalid
files and remove empty directories.
Signed-off-by: Pau Ruiz Safont <[email protected]>
Copy file name to clipboardExpand all lines: doc/content/xapi-guard/_index.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,9 @@ This situation usually happens when xapi is being restarted as part of an update
35
35
SWTPM, the vTPM daemon, reads the contents of the TPM from xapi-guard on startup, suspend, and resume.
36
36
During normal operation SWTPM does not send read requests from xapi-guard.
37
37
38
+
Structure
39
+
---------
40
+
38
41
The cache module consists of two Lwt threads, one that writes to disk, and another one that reads from disk.
39
42
The writer is triggered when a VM writes to the vTPM.
40
43
It never blocks if xapi is unreachable, but responds as soon as the data has been stored either by xapi or on the local disk, such that the VM receives a timely response to the write request.
@@ -82,3 +85,14 @@ stateDiagram-v2
82
85
Engaged --> Engaged : Writer receives TPM, queue is not full
83
86
Engaged --> Disengaged : Writer receives TPM, queue is full
84
87
```
88
+
89
+
Startup
90
+
------
91
+
92
+
At startup, there's a dedicated routine to transform the existing contents of the cache.
93
+
This is currently done because the timestamp reference change on each boot.
94
+
This means that the existing contents might have timestamps considered more recent than timestamps of writes coming from running events, leading to missing content updates.
95
+
This must be avoided and instead the updates with offending timestamps are renamed to a timestamp taken from the current timestamp, ensuring a consistent
96
+
ordering.
97
+
The routine is also used to keep a minimal file tree: unrecognised files are deleted, temporary files created to ensure atomic writes are left untouched, and empty directories are deleted.
98
+
This mechanism can be changed in the future to migrate to other formats.
0 commit comments