В одной из моих таблиц на сайте Django пропала строка. Куда она делась?
В одной из моих таблиц на сайте Django отсутствует строка.
There is absolutely nothing in django_admin_log table mentioning that it was deleted. There were other deletions performed on that day and they were saved. Also, I checked Django's admin code and it looks like it tries logging the deletion first, so even if the deletion was made in a non-transaction manner, in the worst case I'd have log entry and a non-deleted record.
There are no logs in the web log, neither nginx nor my web app log, that suggest that it was removed by Django-admin. There are logs of another deletion made on that day, so I guess deletions were logged.
The database in question is PostgreSQL. I've just read about
pg_dirtyread, unfortunately, I've just vacuumed the database a moment ago.
Мои дубли:
Delete query typed from command-line utility - nope, nobody was logged-in on that day.
Hacker? Come on, why would a hacker delete a single record from a table of a custom CMS-like software?
Hardware fault? Memory problems would manifest in other, random ways. Disk problems - probably too. I have found an anecdotal mention of a record missing from an index in PostgreSQL because of overheating CPU, which would also give other issues, I guess. This is too narrow issue to be causes by hardware faults, I think. On the other hand, the record was "cleanly" dropped, taking some other records with it, as per CASCADE rules in the database.
Есть ли у вас идеи, как эта единственная строка могла пропасть?
Есть предложения, как предотвратить повторение подобных проблем? Регистрировать все запросы DELETE в PostgreSQL? Или просто все запросы? Записывать в журнал все команды оболочки/доступ? Записывать все?