Hello community, here is the log from the commit of package akonadi-runtime for openSUSE:Factory checked in at 2014-03-18 17:16:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/akonadi-runtime (Old) and /work/SRC/openSUSE:Factory/.akonadi-runtime.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "akonadi-runtime" Changes: -------- --- /work/SRC/openSUSE:Factory/akonadi-runtime/akonadi-runtime.changes 2013-12-12 11:16:26.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.akonadi-runtime.new/akonadi-runtime.changes 2014-03-18 17:16:44.000000000 +0100 @@ -1,0 +2,27 @@ +Fri Mar 14 15:25:04 UTC 2014 - tittiatc...@gmail.com + +- Add upstream patch janitor-move-parts-as-required-during-check.diff + to increase performance of akonadictl fsck + +------------------------------------------------------------------- +Wed Mar 12 14:29:11 UTC 2014 - tittiatc...@gmail.com + +- Add upstream patch fix-postgresql-query.diff to fix the issue + when migrating an existing PostgreSQL database +- Add upstream patch fix-mailrefresh.diff to fix the issue around + automatically refreshing emails + +------------------------------------------------------------------- +Fri Mar 7 09:26:41 UTC 2014 - tittiatc...@gmail.com + +- Update to 4.12.80 + * KDE 4.13 Beta 1 release + * See http://www.kde.org/announcements/announce-4.13-beta1.php + +------------------------------------------------------------------- +Sat Feb 15 22:52:39 UTC 2014 - hrvoje.sen...@gmail.com + +- Remove sles checks +- Use kde4 macros + +------------------------------------------------------------------- Old: ---- akonadi-1.11.0.tar.bz2 New: ---- akonadi-1.11.80.tar.bz2 fix-mailrefresh.diff fix-postgresql-2.diff fix-postgresql-query.diff janitor-move-parts-as-required-during-check.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ akonadi-runtime.spec ++++++ --- /var/tmp/diff_new_pack.RW3XAT/_old 2014-03-18 17:16:45.000000000 +0100 +++ /var/tmp/diff_new_pack.RW3XAT/_new 2014-03-18 17:16:45.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package akonadi-runtime # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: akonadi-runtime -Version: 1.11.0 +Version: 1.11.80 Release: 0 %define rversion %{version} %define rname akonadi @@ -26,35 +26,31 @@ Group: System/GUI/KDE Url: http://akonadi-project.org Source: http://download.kde.org/stable/%{rname}/src/%{rname}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM Fix wrong query statement for migration of a PostgreSQL DB +Patch1: fix-postgresql-query.diff +# PATCH-FIX-UPSTREAM Fix issue that folders are not automatically refreshed/checked for new emails +Patch2: fix-mailrefresh.diff +# PATCH-FIX-UPSTREAM Fix another issue with the PostgreSQL DB migration +Patch3: fix-postgresql-2.diff +# PATCH-FIX-UPSTREAM Akonadi 1.13 -- Move parts to/from database when SizeTreshold is changed +Patch4: janitor-move-parts-as-required-during-check.diff BuildRequires: boost-devel BuildRequires: cmake >= 2.8.8 BuildRequires: fdupes BuildRequires: kde4-filesystem -BuildRequires: libsoprano-devel +BuildRequires: libqt4-devel BuildRequires: libxml2 BuildRequires: libxslt -BuildRequires: shared-mime-info -#There is a warning, but it's not needed at all, but for completness -%if !0%{?sles_version} BuildRequires: mariadb -%else -BuildRequires: mysql -%endif +BuildRequires: shared-mime-info BuildRoot: %{_tmppath}/%{name}-%{version}-build - -# rename from 10.3, which had 4.x version -Provides: akonadi = %{version} -Obsoletes: akonadi < 4.1 Requires(post): shared-mime-info Requires(postun): shared-mime-info - Requires: libakonadiprotocolinternals1 = %{version} Requires: libqt4-sql-mysql Requires: mysql Requires: libqt4 >= %(rpm -q --queryformat '%{VERSION}' libqt4) -%if !0%{?sles_version} Suggests: mariadb -%endif %description This package contains the data files of Akonadi, the KDE PIM storage @@ -64,11 +60,7 @@ Summary: PIM Storage Service: Build Environment Group: Development/Libraries/X11 Requires: libakonadiprotocolinternals1 = %{version} -Requires: libsoprano-devel Requires: libqt4-devel >= %( echo `rpm -q --queryformat '%{VERSION}' libqt4-devel`) -# rename from 10.3, which had 4.x version -Provides: akonadi-devel = %{version} -Obsoletes: akonadi-devel < 4.1 %description -n libakonadiprotocolinternals-devel This package contains development files of Akonadi, the KDE PIM storage @@ -85,23 +77,26 @@ %prep %setup -q -n %{rname}-%{rversion} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build - %cmake_kde4 -d build -- -DCONFIG_INSTALL_DIR=/etc -DINSTALL_QSQLITE_IN_QT_PREFIX=TRUE + %cmake_kde4 -d build -- -DCONFIG_INSTALL_DIR=/etc -DINSTALL_QSQLITE_IN_QT_PREFIX=TRUE -DWITH_SOPRANO=FALSE %make_jobs %install - cd build - make DESTDIR=%{buildroot} install - %fdupes -s %{buildroot}%{_prefix}/include + %kde4_makeinstall -C build + %fdupes -s %{buildroot}%{_kde4_includedir} %post /sbin/ldconfig -/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : +%{_kde4_bindir}/update-mime-database %{_kde4_datadir}/mime &> /dev/null || : %postun /sbin/ldconfig -/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : +%{_kde4_bindir}/update-mime-database %{_kde4_datadir}/mime &> /dev/null || : %post -n libakonadiprotocolinternals1 -p /sbin/ldconfig @@ -109,29 +104,28 @@ %files %defattr(-,root,root) -%{_bindir}/asapcat -%{_bindir}/akonadi* -%dir %{_sysconfdir}/akonadi -%config %{_sysconfdir}/akonadi/mysql-global.conf -%config %{_sysconfdir}/akonadi/mysql-global-mobile.conf -%{_datadir}/dbus-1/services/org.freedesktop.Akonadi.Control.service -%{_datadir}/mime/packages/akonadi-mime.xml +%{_kde4_bindir}/asapcat +%{_kde4_bindir}/akonadi* +%dir %{_kde4_sysconfdir}/akonadi +%config %{_kde4_sysconfdir}/akonadi/mysql-global.conf +%config %{_kde4_sysconfdir}/akonadi/mysql-global-mobile.conf +%{_kde4_datadir}/dbus-1/services/org.freedesktop.Akonadi.Control.service +%{_kde4_datadir}/mime/packages/akonadi-mime.xml # A database access plugin, not a development file -%dir %{_libdir}/qt4/plugins/sqldrivers -%{_libdir}/qt4/plugins/sqldrivers/libqsqlite3.so +%dir %{_kde4_libdir}/qt4/plugins/sqldrivers +%{_kde4_libdir}/qt4/plugins/sqldrivers/libqsqlite3.so %files -n libakonadiprotocolinternals-devel %defattr(-,root,root) -%dir %{_includedir}/akonadi -%{_includedir}/akonadi/private -%dir %{_libdir}/cmake -%{_libdir}/cmake/Akonadi -%{_datadir}/dbus-1/interfaces/org.freedesktop.Akonadi.*.xml -%{_libdir}/libakonadiprotocolinternals.so -%{_libdir}/pkgconfig/akonadi.pc +%{_kde4_includedir}/akonadi/ +%dir %{_kde4_libdir}/cmake +%{_kde4_libdir}/cmake/Akonadi +%{_kde4_datadir}/dbus-1/interfaces/org.freedesktop.Akonadi.*.xml +%{_kde4_libdir}/libakonadiprotocolinternals.so +%{_kde4_libdir}/pkgconfig/akonadi.pc %files -n libakonadiprotocolinternals1 %defattr(-,root,root) -%{_libdir}/libakonadiprotocolinternals.so.1* +%{_kde4_libdir}/libakonadiprotocolinternals.so.1* %changelog ++++++ akonadi-1.11.0.tar.bz2 -> akonadi-1.11.80.tar.bz2 ++++++ ++++ 19651 lines of diff (skipped) ++++++ fix-mailrefresh.diff ++++++ commit 68480a5d0b2e53ad24bc13b79e1eeb4c4147bcb0 Author: Dan Vrátil <dvra...@redhat.com> Date: Wed Mar 12 15:20:29 2014 +0100 Fix CollectionScheduler not re-scheduling collections after change diff --git a/server/src/collectionscheduler.cpp b/server/src/collectionscheduler.cpp index cc9eb94..b404bcc 100644 --- a/server/src/collectionscheduler.cpp +++ b/server/src/collectionscheduler.cpp @@ -65,7 +65,8 @@ void CollectionScheduler::setMinimumInterval( int intervalMinutes ) void CollectionScheduler::collectionAdded( qint64 collectionId ) { - const Collection collection = Collection::retrieveById( collectionId ); + Collection collection = Collection::retrieveById( collectionId ); + DataStore::self()->activeCachePolicy( collection ); if ( shouldScheduleCollection( collection ) ) { QMetaObject::invokeMethod( this, "scheduleCollection", Qt::QueuedConnection, @@ -79,6 +80,7 @@ void CollectionScheduler::collectionChanged( qint64 collectionId ) Q_FOREACH ( const Collection &collection, mSchedule ) { if ( collection.id() == collectionId ) { Collection changed = Collection::retrieveById( collectionId ); + DataStore::self()->activeCachePolicy( changed ); if ( hasChanged( collection, changed ) ) { if ( shouldScheduleCollection( changed ) ) { locker.unlock(); ++++++ fix-postgresql-2.diff ++++++ From: Dan Vrátil <dvra...@redhat.com> Date: Thu, 13 Mar 2014 19:02:09 +0000 Subject: PostgreSQL: Update PK sequence after migrating data from PartTable to PartTable_new in Update 25 X-Git-Url: http://quickgit.kde.org/?p=akonadi.git&a=commitdiff&h=5ce597615ea4a53ec1a25e3905f18ae2bcf47d45 --- PostgreSQL: Update PK sequence after migrating data from PartTable to PartTable_new in Update 25 INSERT INTO ... SELECT does not update the sequence in PostgreSQL, so next INSERT will try to use ID 1, which fails. We have to manually update the sequence to MAX(PartTable.id) + 1 to prevent conflicts. Big thanks for klando and tigerfoot for debugging this and suggesting solution. --- --- a/server/src/storage/dbupdater.cpp +++ b/server/src/storage/dbupdater.cpp @@ -361,7 +361,7 @@ " PartTable.datasize, PartTable.version, PartTable.external " "FROM PartTable " "LEFT JOIN PartTypeTable ON " - " PartTable.name = CONCAT(PartTypeTable.ns, ':', PartTypeTable.name)" ); + " PartTable.name = CONCAT(PartTypeTable.ns, ':', PartTypeTable.name)" ); } else if ( dbType == DbType::MySQL ) { queryString = QLatin1String( "INSERT INTO PartTable_new (id, pimItemId, partTypeId, data, datasize, version, external) " "SELECT PartTable.id, PartTable.pimItemId, PartTypeTable.id, PartTable.data, " @@ -390,28 +390,30 @@ if ( dbType == DbType::PostgreSQL || dbType == DbType::Sqlite ) { if ( dbType == DbType::PostgreSQL ) { - DataStore::self()->database().transaction(); + DataStore::self()->beginTransaction(); } if ( !query.exec( QLatin1String( "ALTER TABLE PartTable RENAME TO PartTable_old" ) ) ) { akError() << query.lastError().text(); - DataStore::self()->database().rollback(); + DataStore::self()->rollbackTransaction(); return false; } // If this fails in SQLite (i.e. without transaction), we can still recover on next start) if ( !query.exec( QLatin1String( "ALTER TABLE PartTable_new RENAME TO PartTable" ) ) ) { akError() << query.lastError().text(); - DataStore::self()->database().rollback(); + if ( DataStore::self()->inTransaction() ) { + DataStore::self()->rollbackTransaction(); + } return false; } if ( dbType == DbType::PostgreSQL ) { - DataStore::self()->database().commit(); + DataStore::self()->commitTransaction(); } } else { // MySQL cannot do rename in transaction, but supports atomic renames - if ( !query.exec( QLatin1String( "RENAME TABLE PartTable TO PartTable_old," - " PartTable_new TO PartTable" ) ) ) { + if ( !query.exec( QLatin1String( "RENAME TABLE PartTable TO PartTable_old," + " PartTable_new TO PartTable" ) ) ) { akError() << query.lastError().text(); return false; } @@ -428,6 +430,20 @@ } } + // Fine tuning for PostgreSQL + akDebug() << "Final tuning of new PartTable"; + { + QSqlQuery query( DataStore::self()->database() ); + if ( dbType == DbType::PostgreSQL ) { + query.exec( QLatin1String( "ALTER TABLE PartTable RENAME CONSTRAINT parttable_new_pkey TO parttable_pkey" ) ); + query.exec( QLatin1String( "ALTER SEQUENCE parttable_new_id_seq RENAME TO parttable_id_seq" ) ); + query.exec( QLatin1String( "SELECT setval('parttable_id_seq', MAX(id) + 1) FROM PartTable") ); + } else if ( dbType == DbType::MySQL ) { + // 0 will automatically reset AUTO_INCREMENT to SELECT MAX(id) + 1 FROM PartTable + query.exec( QLatin1String( "ALTER TABLE PartTable AUTO_INCREMENT = 0" ) ); + } + } + akDebug() << "Update done in" << ttotal.elapsed() << "ms"; // Foreign keys and constraints will be reconstructed automatically once ++++++ fix-postgresql-query.diff ++++++ commit 85df6620848ed4d1222fb068b3aad1a3dcc2b1d3 Author: Dan Vrátil <dvra...@redhat.com> Date: Wed Mar 12 14:49:41 2014 +0100 Fix PostgreSQL query in database update 25 The columns are already TEXT and not bytea, so we can't use encode() on them. This was probably written before we migrated our string columns in PostgreSQL to TEXT. The conversion from bytea to TEXT happens in update 24, so before this one. BUG: 331995 FIXED-IN: 1.12.0 diff --git a/server/src/storage/dbupdater.cpp b/server/src/storage/dbupdater.cpp index 3eab726..c9ddfc5 100644 --- a/server/src/storage/dbupdater.cpp +++ b/server/src/storage/dbupdater.cpp @@ -361,7 +361,7 @@ bool DbUpdater::complexUpdate_25() " PartTable.datasize, PartTable.version, PartTable.external " "FROM PartTable " "LEFT JOIN PartTypeTable ON " - " PartTable.name = CONCAT(encode(PartTypeTable.ns, 'escape'), ':', encode(PartTypeTable.name, 'escape'))" ); + " PartTable.name = CONCAT(PartTypeTable.ns, ':', PartTypeTable.name)" ); } else if ( dbType == DbType::MySQL ) { queryString = QLatin1String( "INSERT INTO PartTable_new (id, pimItemId, partTypeId, data, datasize, version, external) " "SELECT PartTable.id, PartTable.pimItemId, PartTypeTable.id, PartTable.data, " ++++++ janitor-move-parts-as-required-during-check.diff ++++++ commit ca452b4903d89b848e88202261d74af2076106fe Author: Dan Vrátil <dvra...@redhat.com> Date: Fri Mar 14 15:32:47 2014 +0100 Janitor: Move parts to/from database when SizeTreshold is changed Check whether there are external parts smaller than SizeTreshold or non-external parts larger than SizeTreshold and move them to or from the database, as needed. This is performed only when running akonadictl fsck. diff --git a/server/src/storagejanitor.cpp b/server/src/storagejanitor.cpp index ebe7a24..7373732 100644 --- a/server/src/storagejanitor.cpp +++ b/server/src/storagejanitor.cpp @@ -24,6 +24,7 @@ #include "storage/datastore.h" #include "storage/selectquerybuilder.h" #include "storage/parthelper.h" +#include "storage/dbconfig.h" #include "resourcemanager.h" #include "entities.h" @@ -109,6 +110,9 @@ void StorageJanitor::check() // implementation of `akonadictl fsck` inform( "Verifying external parts..." ); verifyExternalParts(); + inform( "Checking size treshold changes..." ); + checkSizeTreshold(); + inform( "Looking for dirty objects..." ); findDirtyObjects(); @@ -470,6 +474,93 @@ void StorageJanitor::vacuum() } } +void StorageJanitor::checkSizeTreshold() +{ + { + QueryBuilder qb( Part::tableName(), QueryBuilder::Select ); + qb.addColumn( Part::idFullColumnName() ); + qb.addValueCondition( Part::externalFullColumnName(), Query::Equals, false ); + qb.addValueCondition( Part::datasizeFullColumnName(), Query::Greater, DbConfig::configuredDatabase()->sizeThreshold() ); + qb.exec(); + + QSqlQuery query = qb.query(); + inform( QString::fromLatin1( "Found %1 parts to be moved to external files" ).arg( query.size() ) ); + + while ( query.next() ) { + Transaction transaction( DataStore::self() ); + Part part = Part::retrieveById( query.value( 0 ).toLongLong() ); + const QByteArray name = PartHelper::fileNameForPart( &part ).toUtf8() + "_r" + QByteArray::number( part.version() ); + const QString partPath = PartHelper::resolveAbsolutePath( name ); + QFile f( partPath ); + if ( f.exists() ) { + akDebug() << "External payload file" << name << "already exists"; + // That however is not a critical issue, since the part is not external, + // so we can safely overwrite it + } + if ( !f.open( QIODevice::WriteOnly | QIODevice::Truncate ) ) { + akError() << "Failed to open file" << name << "for writing"; + continue; + } + if ( f.write( part.data() ) != part.datasize() ) { + akError() << "Failed to write data to payload file" << name; + f.remove(); + continue; + } + + part.setData( name ); + part.setExternal( true ); + if ( !part.update() || !transaction.commit() ) { + akError() << "Failed to update database entry of part" << part.id(); + f.remove(); + continue; + } + + inform( QString::fromLatin1( "Moved part %1 from database into external file %2" ).arg( part.id() ).arg( QString::fromLatin1( name ) ) ); + } + } + + { + QueryBuilder qb( Part::tableName(), QueryBuilder::Select ); + qb.addColumn( Part::idFullColumnName() ); + qb.addValueCondition( Part::externalFullColumnName(), Query::Equals, true ); + qb.addValueCondition( Part::datasizeFullColumnName(), Query::Less, DbConfig::configuredDatabase()->sizeThreshold() ); + qb.exec(); + + QSqlQuery query = qb.query(); + inform( QString::fromLatin1( "Found %1 parts to be moved to database" ).arg( query.size() ) ); + + while ( query.next() ) { + Transaction transaction( DataStore::self() ); + Part part = Part::retrieveById( query.value( 0 ).toLongLong() ); + const QString partPath = PartHelper::resolveAbsolutePath( part.data() ); + QFile f( partPath ); + if ( !f.exists() ) { + akError() << "Part file" << part.data() << "does not exist"; + continue; + } + if ( !f.open( QIODevice::ReadOnly ) ) { + akError() << "Failed to open part file" << part.data() << "for reading"; + continue; + } + + part.setExternal( false ); + part.setData( f.readAll() ); + if ( part.data().size() != part.datasize() ) { + akError() << "Sizes of" << part.id() << "data don't match"; + continue; + } + if ( !part.update() || !transaction.commit() ) { + akError() << "Failed to update database entry of part" << part.id(); + continue; + } + + f.close(); + f.remove(); + inform( QString::fromLatin1( "Moved part %1 from external file into database" ).arg( part.id() ) ); + } + } +} + void StorageJanitor::inform( const char *msg ) { inform( QLatin1String( msg ) ); diff --git a/server/src/storagejanitor.h b/server/src/storagejanitor.h index af4e292..a0e98a4 100644 --- a/server/src/storagejanitor.h +++ b/server/src/storagejanitor.h @@ -111,6 +111,14 @@ class StorageJanitor : public QObject */ void findDirtyObjects(); + /** + * Check whether part sizes match what's in database. + * + * If SizeTreshold has change, it will move parts from or to database + * where necessary. + */ + void checkSizeTreshold(); + private: QDBusConnection m_connection; qint64 m_lostFoundCollectionId; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org