Small update which confirms (in regard to Fix corrupted / malformed SQLite database (home-assistant_v2.db) - #27 by e-raser) that backing up the SQLite database nowadays is quite safe because of
- Allow to lock SQLite database during backup by agners · Pull Request #60874 · home-assistant/core · GitHub and
- Refactor recorder queue handling by emontnemery · Pull Request #61161 · home-assistant/core · GitHub
Observations:
- When running a backup (HA only) I discovered, that entities states are updated in the UI. But when opening their history (graph e. g. for sensors), there’s a “flat line” right from the start of the backup until it finishes.
After the backup is done, opening the same history shows all information, the “flat line” is gone. - Same with other write attempts: I was trying to remove wrong statistics using the dev-tools / statistics section. That created an error for every request/attempt/click on “remove entity” (*).
After the backup process finished, those actions were performed automatically. - I also noticed, that after the process has finished, load (load-1/-5/-15) went up significantly for some time.
So I guess HA simply
- locks the database for write access during backup,
- collects all database write attempts to a queue and
- performs them after the backup has finished (database has been unlocked).
(*)
Logger: frontend.js.latest.202207071
Source: components/system_log/__init__.py:190
First occurred: 00:01:08 (33 occurrences)
Last logged: 14:15:33
:0:0 Script error.
http://my.home-assistant/frontend_latest/18edb15a.js:269:10429 RangeError: number argument must be finite
:0:0 ResizeObserver loop completed with undelivered notifications.