Summary: | Sudden write interruption during akonadictl vacuum causes database corruption | ||
---|---|---|---|
Product: | [Frameworks and Libraries] Akonadi | Reporter: | Martin Steigerwald <Martin> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED NOT A BUG | ||
Severity: | critical | CC: | dvratil |
Priority: | NOR | ||
Version: | GIT (master) | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Martin Steigerwald
2014-06-22 13:22:17 UTC
There's very little we can do during power-loss or kernel panic. Also this is obviously not an Akonadi problem, but a MySQL and Btrfs one, as you explicitly mentioned database corruption while running Btrfs. The reality is, that even when kernel requests fsync, many modern HDDs (especially in laptops) will report the data as written, while in fact they will keep them in internal memory and schedule for writeback later, potentially leading to data corruption on power loss. Per documentation of innodb_flush_log_at_trx_commit: .... A value of 1 is required for ACID compliance. You can achieve better performance by setting the value different from 1, but then you can lose at most one second worth of transactions in a crash. With a value of 0, any mysqld process crash can erase the last second of transactions. With a value of 2, then only an operating system crash or a power outage can erase the last second of transactions. However, InnoDB's crash recovery is not affected and thus crash recovery does work regardless of the value. Losing "up to last second of transactions" can only result in Akonadi cache being inconsistent with server data and which should be automatically fixed during next sync. This does not lead to database (table datafile) corruption. Same applies for sync_binlog - it does not affect the table datafiles, only journals. |