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

[Feature request] Room state database integrity check #12489

Open
ShadowJonathan opened this issue Apr 18, 2022 · 2 comments
Open

[Feature request] Room state database integrity check #12489

ShadowJonathan opened this issue Apr 18, 2022 · 2 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-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@ShadowJonathan
Copy link
Contributor

Description:

A background (and/or admin-submittable) task that will walk state groups, outliers, and other calculated information of relevant rooms, and validate it.

This will then rewrite, fetch, deny or invalidate any incorrect state, and tolerantly rebuild a state group table for a particular room.

Reasoning:

This would be a “last resort” button for administrators to push, to fix any inconsistencies in their database.

(Hypothesis) It could possibly also work with state resets, “revalidating” a room, or provide insightful information about some internal fault or bug that would lead to state resets.

@reivilibre
Copy link
Contributor

It seems like a fun idea, but I'm also not sure that it makes much sense, or at least not when considering priority against other things.

If we think we have a problem causing this state to be corrupted, we should try and fix the root cause rather than paper over it with a repair tool.

If we think the cause is database (e.g. Postgres) corruption, then we could certainly run some sanity checks... but I doubt it is possible to fix any inconsistencies in the database; we'd be limited to a few that we can, and maybe even some of those would be pretty sketchy (since after all, the repair process is ingesting the same corrupt database to rebuild its state).

@reivilibre reivilibre added S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. labels Apr 19, 2022
@richvdh
Copy link
Member

richvdh commented Apr 19, 2022

this sort of thing has come up in the past, eg as a result of #9595, where we've fixed the underlying bug, but we still have databases in a mess. There is certainly merit to such a "rebuild a room" tool.

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-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

No branches or pull requests

4 participants