aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2022-01-21 09:56:06 +0000
committerGitHub <noreply@github.com>2022-01-21 09:56:06 +0000
commit2c581377a5f6b243300445947fd0fd38a919873d (patch)
tree4aa9948333bbd5f64c1cf0af8294789cfae7a2e9 /cmd
parentdb7d9cba8ad28c300dd66c01b9b0ce2414e8cbe0 (diff)
Remodel how device list change IDs are created (#2098)
* Remodel how device list change IDs are created Previously we made them using the offset Kafka supplied. We don't run Kafka anymore, so now we make the SQL table assign the change ID via an AUTOINCREMENTing ID. Redesign the `keyserver_key_changes` table to have `UNIQUE(user_id)` so we don't accumulate key changes forevermore, we now have at most 1 row per user which contains the highest change ID. This needs a SQL migration. * Ensure we bump the change ID on sqlite * Actually read the DeviceChangeID not the Offset in synapi * Add SQL migrations * Prepare after migration; fixup dendrite-upgrade-test logging * Use higher version numbers; fix sqlite query to increment better * Default 0 on postgres * fixup postgres migration on fresh dendrite instances
Diffstat (limited to 'cmd')
-rw-r--r--cmd/dendrite-upgrade-tests/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/dendrite-upgrade-tests/main.go b/cmd/dendrite-upgrade-tests/main.go
index 35852e8a..3241234a 100644
--- a/cmd/dendrite-upgrade-tests/main.go
+++ b/cmd/dendrite-upgrade-tests/main.go
@@ -189,7 +189,9 @@ func buildDendrite(httpClient *http.Client, dockerClient *client.Client, tmpDir,
if err := decoder.Decode(&dl); err != nil {
return "", fmt.Errorf("failed to decode build image output line: %w", err)
}
- log.Printf("%s: %s", branchOrTagName, dl.Stream)
+ if len(strings.TrimSpace(dl.Stream)) > 0 {
+ log.Printf("%s: %s", branchOrTagName, dl.Stream)
+ }
if dl.Aux != nil {
imgID, ok := dl.Aux["ID"]
if ok {
@@ -425,8 +427,10 @@ func cleanup(dockerClient *client.Client) {
// ignore all errors, we are just cleaning up and don't want to fail just because we fail to cleanup
containers, _ := dockerClient.ContainerList(context.Background(), types.ContainerListOptions{
Filters: label(dendriteUpgradeTestLabel),
+ All: true,
})
for _, c := range containers {
+ log.Printf("Removing container: %v %v\n", c.ID, c.Names)
s := time.Second
_ = dockerClient.ContainerStop(context.Background(), c.ID, &s)
_ = dockerClient.ContainerRemove(context.Background(), c.ID, types.ContainerRemoveOptions{