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 BUG: 322083 FIXED-IN: 4.12
parent
34e6b695
Please register or sign in to comment