element-hq / element-hq/matrix-authentication-service

syn2mas: reconstruction of indices and constraints is not atomic

Open
#3,940 0 comments 0 reactions 0 assignees View on GitHub
A-Migration
Dominant language
Rust
Stars
280
Forks
111
Avg merge
3d 1h
Merged PRs (30d)
25

Description

If syn2mas is interrupted whilst rebuilding indices and constraints, you end up with some of them left on the database.

When you next run syn2mas, it truncates all the tables but does not remove those indices/constraints.

I also suspect if you left it run through to the end at that point, that it will try to double-create them.

Solution suggestion:

- when recreating an index, delete the row from the restore table (in the same transaction!)
- when restarting a migration, it should drop indices again and append the definitions to the restore table, so that it works as it did before.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.