Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

synapse_port_db assumes events is append-only, but it is not #12007

Open
richvdh opened this issue Feb 16, 2022 · 3 comments
Open

synapse_port_db assumes events is append-only, but it is not #12007

richvdh opened this issue Feb 16, 2022 · 3 comments
Labels
A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@richvdh
Copy link
Member

richvdh commented Feb 16, 2022

synapse_port_db has a list of tables that it believes to be "append-only". That is to say, if the script is re-run on an updated copy of the input database, it will not clear these tables, but just add new rows that have arrived since last time.

Included in this list is events, which is generally read-only, but we do sometimes update existing rows - for example, when we convert an outlier to a non-outlier.

This means that any event that is de-outliered between runs of synapse_port_db may still be marked as an outlier in the target database, even though we have full state for it.

I'm not entirely sure if this has any measurable impact. It's possible that it simply means we will redundantly de-outlier it again.

@erikjohnston
Copy link
Member

Bah, that is awkward. I guess the correct method would be to add a trigger to the events table to record all updates, which the port script could then read and re-copy those rows across?

@erikjohnston erikjohnston added S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels Feb 23, 2022
@richvdh
Copy link
Member Author

richvdh commented Feb 23, 2022

maybe? Part of me wonders if the outlier flag should be in a separate table.

@richvdh
Copy link
Member Author

richvdh commented Feb 23, 2022

(or just implied from the lack of an events_to_state_groups (?) row)

@MadLittleMods MadLittleMods added the A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db label Apr 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

3 participants