Summary: | CollectionSync always start a database transaction, even when no update needs to be done | ||
---|---|---|---|
Product: | [Frameworks and Libraries] Akonadi | Reporter: | Alessandro Pignotti <alexpigna.dev> |
Component: | libakonadi | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kdepimlibs/f7bf8bd51a4e03771419c91ff2cd155b56445073 | Version Fixed In: | 4.12 |
Description
Alessandro Pignotti
2013-07-07 19:25:24 UTC
For info on mysql read-only performance and transactions see http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html section 14.2.4.2.3. Git commit f7bf8bd51a4e03771419c91ff2cd155b56445073 by Dan Vrátil, on behalf of Alessandro Pignotti. Committed on 22/08/2013 at 12:17. Pushed by dvratil into branch 'master'. Avoid starting a database transaction in CollectionSync when no updates are needed Unconditionally starting a transaction on every collection sync as an high overhead on disk activity since transaction bookkeping on the database requires writing to disk. Most often collection sync are unnecessary since collection are rarely modified, so we end up causing a write to disk on an operation which would be read-only. The proposed solution is two run the collection sync in 2 phases: 1) Without starting a transaction, the currently known local collections are loaded and are compared against the received remote ones. If no difference is found update is stopped right away 2) If there are differences a transaction is started, local collections are loaded again to guarantee consistency and the update is applied inside the transaction REVIEW: 111885 FIXED-IN: 4.12 M +1 -1 CMakeLists.txt M +167 -17 akonadi/collectionsync.cpp M +7 -1 akonadi/collectionsync_p.h http://commits.kde.org/kdepimlibs/f7bf8bd51a4e03771419c91ff2cd155b56445073 |