4 ms·
The assumption that you can "fix" the database and proceed as if nothing had happened is naive, IMNSHO. Firstly, there's usually non-trivial amount of time unt
by pgaddict 11y ago
The assumption that you can "fix" the database and proceed as if nothing had happened is naive, IMNSHO.
Firstly, there's usually non-trivial amount of time until the inconsistency is discovered, that one modification may be easily followed by many additional modifications that are not simply commutative and "diffuse" the inconsistency to other records. For example if we're talking about bank accounts, you often get interests from that, which is not commutative with simple transfers (multiplication vs. addition). So you can't just compensate for that one error, you'd have to revert all the actions on all the involved accounts.
Secondly, databases are rarely isolated. If you're handling money, chances are you've already submitted the payments to an external payment processor, or perhaps sent data somewhere else (to a different system within the bank, for example). You can't (simply) fix this.
This is why people use constraints or higher transaction isolation levels, and also why the Galera response is amusing and also scary at the same time.
- bakhy 11y agoi am not saying it's not a problem, nor that it's always easy to fix. but it is fixable. banks will keep double records, and solutions will be found for corner cases (in the end, even write-offs). but it's simply a very different mode of failure. a corrupt database will typically fail to work, or? a system may fail due to this. this definitely costs money and nerves of all involved. but yes, the response here is bad.