Skip to content

Commit bfa5051

Browse files
committed
Add a migration to use a temporary state subdirectory
1 parent 7958742 commit bfa5051

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

atr/docs/storage-interface.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Only a small number of subdirectories of the state directory are written to by t
151151
* `downloads`, configured by `DOWNLOADS_STORAGE_DIR`
152152
* `finished`, configured by `FINISHED_STORAGE_DIR`
153153
* `subversion`, configured by `SVN_STORAGE_DIR`
154-
* `tmp`, which is unconfigurable
154+
* `temporary`, which is unconfigurable
155155
* `unfinished`, configured by `UNFINISHED_STORAGE_DIR`
156156

157157
And the purposes of these directories is as follows. Note that "immutable" here means that existing files cannot be modified, but does not preclude new files from being added.
@@ -160,14 +160,14 @@ And the purposes of these directories is as follows. Note that "immutable" here
160160
* `downloads` [**mutable**] are hard links to released artifacts in the `finished` directory. The `finished` directory contains the files exactly as they were arranged by the release managers upon announcing the release, separated strictly into one directory per release. The `downloads` folder, on the other hand, has no restrictions on its organisation and can be rearranged.
161161
* `finished` [**immutable**, except for moving to external archive] contains, as mentioned above, all of the files of a release as they were when announced. This therefore constitutes an historical record and allows us to rewrite the hard links in the `downloads` directory without having to consider not accidentally deleting files by removing all references, etc.
162162
* `subversion` [**mutable**] is designed to mirror two subdirectories, `dev` and `release`, of `https://dist.apache.org/repos/dist`. This is currently unused.
163-
* `tmp` [**mutable**] holds temporary files during operations where the data cannot be modified in place. One important example is when creating a staging directory of a new revision. A subdirectory with a random name is made in this directory, and then the files in the prior version are hard linked into it. The modifications take place in this staging area before the directory is finalised and moved to `unfinished`.
163+
* `temporary` [**mutable**] holds temporary files during operations where the data cannot be modified in place. One important example is when creating a staging directory of a new revision. A subdirectory with a random name is made in this directory, and then the files in the prior version are hard linked into it. The modifications take place in this staging area before the directory is finalised and moved to `unfinished`.
164164
* `unfinished` [**immutable**, except for moving to `finished`] contains all of the files in a release before it is announced. In other words, when the release managers compose a release, when the committee votes on the release, and when the release has been voted on but not yet announced, the files for that release are in this directory.
165165

166166
This list does not include any configuration files, logs, or log directories.
167167

168168
## How should the filesystem be backed up?
169169

170-
Only the `attestable`, `downloads`, `finished`, and `unfinished` directories need to be backed up. The `subversion` directory is unused, and the `tmp` directory is for temporary staging.
170+
Only the `attestable`, `downloads`, `finished`, and `unfinished` directories need to be backed up. The `subversion` directory is unused, and the `temporary` directory is for temporary staging.
171171

172172
The structure of the directories that need backing up is as follows. An ellipsis, `...`, means any number of further files or subdirectories containing subdirectories or files recursively.
173173

atr/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
("ssh_host_key", "secrets/generated/ssh_host_key"),
8585
# Subversion
8686
("svn", "subversion"),
87+
# Temporary
88+
("tmp", "temporary"),
8789
]
8890

8991
_SWAGGER_UI_TEMPLATE: Final[str] = """<!DOCTYPE html>

atr/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ async def get_release_stats(release: sql.Release) -> tuple[int, int, str]:
487487

488488
def get_tmp_dir() -> pathlib.Path:
489489
# This must be on the same filesystem as the other state subdirectories
490-
return pathlib.Path(config.get().STATE_DIR) / "tmp"
490+
return pathlib.Path(config.get().STATE_DIR) / "temporary"
491491

492492

493493
def get_unfinished_dir() -> pathlib.Path:

0 commit comments

Comments
 (0)