From e963977424d5a790c2bd7d1e28911ea4266e9be4 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Thu, 10 Oct 2019 20:58:46 +0100 Subject: [PATCH] Add information from #2 to README about being race-safe Signed-off-by: Olivier Wilkinson (reivilibre) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index e12cbf9..7c925f3 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,14 @@ given file that would change the tables to match the calculated state. (Note that if `-t` is given then each change to a particular state group is wrapped in a transaction). +The SQL generated by the `-o` option is safe to apply against the database with +Synapse running. This is because the `state_groups` and `state_groups_state` +tables are append-only: once written to the database, they are never modified. +There is therefore no danger of a modification racing against a running synapse. +Further, this script makes its changes within atomic transactions, and each +transaction should not affect the results from any of the queries that synapse +performs. + The tool will also ensure that the generated state deltas do give the same state as the existing state deltas.