1. 28 May, 2017 1 commit
  2. 28 Feb, 2017 1 commit
  3. 25 Feb, 2017 1 commit
  4. 13 Jan, 2017 1 commit
  5. 06 Jan, 2017 1 commit
  6. 13 Oct, 2016 1 commit
  7. 14 Sep, 2016 1 commit
    • Daniel Vrátil's avatar
      Reduce collection statistics queries · c7944585
      Daniel Vrátil authored
      For certain cases we can now update the cached statistics in
      CollectionStatistics incrementally instead of invalidating the
      cache and querying DB to calculate it again. The calculation is
      rather expensive (one of the most expensive queries we have) and
      the time we spent recalculating the stats quickly adds up to secons.
      
      Currently we only support incremental stats update for flags change
      within a single collection and for appending new items which,
      especially in the second case, should notably reduce the amount of
      the super-heavy statistics queries.
      
      In any other case we currently fall-back to invalidating the cache
      and calculating the stats on demand.
      c7944585
  8. 08 Sep, 2016 1 commit
  9. 17 Dec, 2015 1 commit
    • P. Christeas's avatar
      Release idle connections to the database · 289c775d
      P. Christeas authored
      For Postgres, each DB client connection corresponds to a process
      being spawn and kept alive. May even mean some SHM allocated for
      it, on pre-9.3 versions of postgres.
      On a system (desktop) with many akonadi resources, we may end up
      occupying most/all available Postgres backends just keeping idle
      agents.
      This patch tries to address that, by releasing the DB connection
      for those idle agents. This comes to the expense of some wake-up
      latency (connect, setup db and prepare queries again). It is not
      limited to QPSQL DBs yet, as to explore its effects on the other
      storage engines.
      
      Note that I had to change the `DataStore::database()` API from a
      const to a regular method, because it would wake-up a connection.
      
      With the help of Daniel Vrátil <dvratil@redhat.com> , who showed
      me the way.
      
      REVIEW: 121120
      289c775d
  10. 17 Nov, 2015 1 commit
  11. 16 Sep, 2015 1 commit
  12. 27 Jul, 2015 1 commit
  13. 18 Jun, 2015 1 commit
  14. 22 May, 2015 1 commit
  15. 27 Aug, 2014 1 commit
  16. 10 Aug, 2014 3 commits
    • Daniel Vrátil's avatar
      MERGE: Only emit change notification if something has really changed · 94be488b
      Daniel Vrátil authored
      The MERGE request does not have to contain all data (like GID, for instance),
      so instead of overwriting existing GID with an empty GID, we ignore this
      "change". The same applies for flags: I noticed that when syncing a folder,
      KMail was eating about 50% CPU, because ETM generated dataChanged() for every
      item in the synced folder. It was because the Server assumed that non-incremental
      flags change must always generate a change, which is not true of course.
      94be488b
    • Daniel Vrátil's avatar
      Fix and optimize DataStore::virtualCollections() · 4e7b35ee
      Daniel Vrátil authored
      The method now returns QMap<Entity::Id, QList<PimItem> > instead of being a
      multimap, and the PimItem now correctly contains mime type.
      4e7b35ee
    • Daniel Vrátil's avatar
      Introduce some Fake classes to allow unit-testing of internal parts · b61af18f
      Daniel Vrátil authored
      Namely we have FakeDataStore, which records all calls and calls the actual
      implementation, FakeConnection, which allows injecting specific handlers and
      specifying commands to process as a QByteArray (so no need to use socket) and
      finally FakeAkonadiServer, which when started sets up the entire environment
      in /tmp, intializes and populates database and cleans up everything again when
      destroyed.
      b61af18f
  17. 31 Jul, 2014 1 commit
  18. 24 Jun, 2014 1 commit
    • Daniel Vrátil's avatar
      MERGE: Only emit change notification if something has really changed · f00d8e57
      Daniel Vrátil authored
      The MERGE request does not have to contain all data (like GID, for instance),
      so instead of overwriting existing GID with an empty GID, we ignore this
      "change". The same applies for flags: I noticed that when syncing a folder,
      KMail was eating about 50% CPU, because ETM generated dataChanged() for every
      item in the synced folder. It was because the Server assumed that non-incremental
      flags change must always generate a change, which is not true of course.
      f00d8e57
  19. 23 Jun, 2014 1 commit
  20. 12 May, 2014 1 commit
    • Daniel Vrátil's avatar
      Introduce some Fake classes to allow unit-testing of internal parts · 2fb1ad3b
      Daniel Vrátil authored
      Namely we have FakeDataStore, which records all calls and calls the actual
      implementation, FakeConnection, which allows injecting specific handlers and
      specifying commands to process as a QByteArray (so no need to use socket) and
      finally FakeAkonadiServer, which when started sets up the entire environment
      in /tmp, intializes and populates database and cleans up everything again when
      destroyed.
      2fb1ad3b
  21. 06 May, 2014 2 commits
    • Christian Mollekopf's avatar
      Incremental changes for MERGE and tag support for MERGE and APPEND. · 8f8abc1a
      Christian Mollekopf authored
      Incremental changes make it possible to i.e. only update the flags.
      
      Tag support allows clients to create a new item with tags specified via
      \Tag['tagRemoteId'] flag (the flag can be repeated with different
      remote IDs to assign multiple tags. The tags MUST exist.
      
      When SILENT is specified on MERGE, the resulting item won't be sent in the response
      of MERGE, instead just an UID is sent.
      
      Daniel Vratil is of course responsible for writing the patch ;-)
      8f8abc1a
    • Christian Mollekopf's avatar
      Incremental changes for MERGE and tag support for MERGE and APPEND. · bcae0961
      Christian Mollekopf authored
      Incremental changes make it possible to i.e. only update the flags.
      
      Tag support allows clients to create a new item with tags specified via
      \Tag['tagRemoteId'] flag (the flag can be repeated with different
      remote IDs to assign multiple tags. The tags MUST exist.
      
      When SILENT is specified on MERGE, the resulting item won't be sent in the response
      of MERGE, instead just an UID is sent.
      
      Daniel Vratil is of course responsible for writing the patch ;-)
      bcae0961
  22. 06 Apr, 2014 1 commit
    • Daniel Vrátil's avatar
      Disable global transaction mutex for QSQLITE3 and enable transaction recording · 24413dc4
      Daniel Vrátil authored
      Our QSQLITE3 driver now supports concurrency, so we don't need to serialize
      transactions in DataStore anymore. It is however still needed for the
      QSQLITE driver shipped with Qt.
      
      Secondary, concurrency support also means possible transactions deadlocks and
      timeouts, so we also need to enable transaction recording and replaying for
      the QSQLITE3 backend.
      24413dc4
  23. 29 Mar, 2014 1 commit
    • Daniel Vrátil's avatar
      Don't emit flagsChanged notifications from AKAPPEND handler · 50495dcb
      Daniel Vrátil authored
      We use DataStore::appendItemsFlags() to append flags to the newly created
      item, but we don't want it to send out change notification, because it's
      called before we actually send out the itemAdded notification, which can
      confuse clients (and resources).
      50495dcb
  24. 28 Feb, 2014 1 commit
    • Daniel Vrátil's avatar
      Handle database transaction deadlocks · 86dc7bc3
      Daniel Vrátil authored
      Two concurrent database transactions can cause a database deadlock under
      certain conditions. Both MySQL and PostgreSQL can detect the deadlock and
      will automatically rollback one of the offending transactions. Very often
      we've seen atime update in ItemRetriever to cause a deadlock with a
      large transaction updating or inserting items, especially from maildir
      resource.
      
      According to documentation of both databases, transaction deadlocks are
      nothing dangerous and applications should be able to handle them by trying
      to replay the rolled-back transaction again.
      
      For that reason we now store all QSqlQueries executed within a single
      transaction into DataStore, so that in case of error we can ask DataStore
      to execute them all again within a new transaction. After each transaction
      is committed or rolled back, DataStore will clear it's query cache.
      
      Queries executed outside transactions are not recorded. Also when using
      SQLite, the queries are not recorded either, because SQLite does not support
      concurrent transaction and we serialize them through a global lock in
      DataStore, so no deadlock can occur.
      
      This commit does not solve the actual problem that we somewhere generate a
      huge and slow transaction that causes the deadlock but makes Akonadi able
      to handle it without errors. So far I was not able to find where the big
      transaction comes from.
      86dc7bc3
  25. 17 Feb, 2014 1 commit
    • Daniel Vrátil's avatar
      Wrap all classes in /server to Akonadi::Server namespace · c90b946d
      Daniel Vrátil authored
      Since we now support loading of plugins, having only Akonadi namespace
      might not be enough, as plugins can easily clash (like Akonadi::TagAttribute
      from Akonadi and from kdepimlibs). It will also make it easier to differentiate
      classes once both server and client libs are in the same repo in KF5.
      c90b946d
  26. 08 Feb, 2014 1 commit
  27. 06 Nov, 2013 1 commit
    • Guy Maurel's avatar
      coding style · 548dc6b2
      Guy Maurel authored
      REVIEWS: 113559 113590 113651 113652 113653 113617 113654 113655 113656
      548dc6b2
  28. 27 Aug, 2013 1 commit
  29. 14 Aug, 2013 1 commit
    • Daniel Vrátil's avatar
      Send dummy queries to MySQL to keep the connection alive · a2ada719
      Daniel Vrátil authored
      MySQL server will drop connection when there's no query for longer
      period of time. The timeout does not seem to be configurable and
      QSqlDatabase is unable to detect that the connection has been dropped
      and isValid() and isOpen() will still return true.
      
      To work around this problem, we send a dummy SQL query to MySQL
      every hour. It has been confirmed by long-term testing that
      this is enough.
      a2ada719
  30. 29 Jul, 2013 1 commit
  31. 27 Jul, 2013 1 commit
    • Christian Mollekopf's avatar
      Support for Gid (globally unique identifier). · 534af325
      Christian Mollekopf authored
      This patch adds a new column for the gid of an item to the pimitemtable.
      Support for:
      * append commands
      * store command
      * fetch command
      
      We ignore the collection/resource context for now.
      Otherwise fetch jobs may silently fail due to a selected collection
      (apparently the selection is not reset by a new fetchjob).
      
      Increased the protocol version to 34.
      534af325
  32. 16 Jul, 2013 1 commit
    • Daniel Vrátil's avatar
      Improve DataStore::appendItemsFlags() · 9a873b99
      Daniel Vrátil authored
      Fixes a bug that failed the entire batch if one of the items already had
      the flag the batch tried to append.
      
      Secondly it optimizes the operation to perform only 2 big queries per each
      flag being appended rather than doing 2 queries per each item. Notifications
      with empty addedFlags and removedFlags fields are not emitted anymore as well.
      
      REVIEW: 110766
      9a873b99
  33. 07 Mar, 2013 1 commit
    • Daniel Vrátil's avatar
      Initial port of Akonadi server to new notifications · 69f57ef2
      Daniel Vrátil authored
      Internally, Akonadi server now uses NotificationMessageV2 which can,
      for specific operations, handle multiple items.
      
      The code needs to be optimized on several places and compression is
      not yet implemented, but legacy clients (i.e. clients that don't
      support the new format) work perfectly. There is no client that would
      support the new format, so that is not yet tested :-)
      69f57ef2
  34. 21 Dec, 2012 1 commit
  35. 02 Aug, 2012 1 commit
    • Volker Krause's avatar
      Split cleanupCollection() into a slow and optimized version. · 7dd8d107
      Volker Krause authored
      We still need the slow one for database backends without working foreign
      key constraints (not support, like in Sqlite, or not yet implemented in
      Akonadi, like PostgreSQL).
      
      The fast version now also uses a fast path for external payload part
      removal and thus only performs O(1) queries, while the slow one needs
      O(n) (with n being the amount of items in the deleted folder).
      
      Notifications can still be optimized here (not requiring generation of
      one per item on the server side), but that'll require some more changes
      on the client side first.
      7dd8d107
  36. 27 Jul, 2012 1 commit
  37. 17 Feb, 2012 1 commit