feature: every write of an instance's variable files is kept as a revision with the schema version of their layout and the application that wrote them.
Release / release (push) Successful in 1m8s

This commit is contained in:
slawek committed 2026-11-06 22:22:35 +01:00
1 parent 7c335c7ed2
commit 5e62e143b6
11 files changed
+286 -37

No files matched your search

+22
View File
@@ -135,3 +135,25 @@ exporting them too.
Consequences: An application's shared API types import from `/shared` without the code of either
side. A type added to `shared/` is exported from `/shared` as well as from the side that uses it.
## ADR-7: Every write of an instance's variable files is a revision with its schema and producer
Status: Accepted
Context: A configurator changes the layout of the variable files it writes from one version to
the next, and Cloud Platform has to tell whether an instance's files are of the layout its
module's configurator writes before it runs Terraform with them. The files written earlier have
to stay available, to restore or compare them.
Decision: `tf_variable_revisions` holds every write of an instance's files: all files after the
write, the schema version of their layout as the writer gives it, null when it does not know it,
the producer, the writing application with its version, and the time. `write` and `remove` take
the schema and the producer and record the revision in the transaction of the change, under the
lock of the files; a write of no file records none. The current files stay in `tf_variable_files`,
so reading them and their version is unchanged. Revisions are kept until removed by hand with
SQL. Files without revisions are recorded as revision 1 of an unknown producer and schema when the
store is first used.
Consequences: The schema of an instance's files is the schema of its newest revision; files
imported without a schema, or written before revisions, have none until a configurator writes
them. Revisions grow with every write; the README describes the SQL that removes them.