This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Identical folders have different sizes

Tags: None
(comma "," separated)
krystalcode
Registered Member
Posts
11
Karma
0
OS
Hello,

I made a copy of my Inbox into a local folder. After copying had (apparently) finished, I moved the mouse over the 2 folders. Kmail showed the same number of emails and the same size for each folder (1.9 GiB). I noticed there was some activity by akonadi, mysqld and akonadi_baloo_indexer after that.

Later on, the original folder shows the same size, as expected, but the identical local folder shows a size 3.2 GiB. The original folder (in an IMAP resource) is not indexed properly or fully, I believe. For example, when I use the attachments quick filter only a few emails show as having an attachment, while the copy displays probably all of them. There is probably a bug with the indexer as it does not detect attachments properly for most folders.

If any disk space used by indexing operations count towards the storage size reported by Kmail, that could explain the difference, even though it's quite large. Otherwise, where should I look to find out why this difference?
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
Are you using IMAP without offline storage (e.g., not downloading messages for offline use)?


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
krystalcode
Registered Member
Posts
11
Karma
0
OS
No, offline storage is on and all mail is downloaded locally.

Some more detail that I don't think should matter.

1. This is the All Mail folder of a Gmail account.
2. Trying to figure out the best way to handle Gmail due to its labels feature, I copied the folder over 2-3 times before finalising the setup, using the "Copy folder to" functionality. E.g. copied the folder once, tried some things out, deleted the copy, then tried again. I waited enough time between the operations, so I believe the copy should be completely removed, and disk space was released, before trying again. Also, even though the name and location of the folder was the same across copies, I believe Kmail would assign a different ID each time (haven't checked), so there shouldn't be a mix up e.g., although it's a remote possibility if there's a bug.

I'll try copying the same folder to a different location, and see if I can reproduce this.
krystalcode
Registered Member
Posts
11
Karma
0
OS
I have been able to reproduce the issue by copying the same folder on a different location (local foler). The copy originally showed the same size (1.9 GiB). Now that a few hours have passed by, it shows as 3.2 GiB.

This strengthens my suspicion that this has something to do with indexing. When the folder displayed a size of 1.9 GiB, the folder had not been fully indexed yet. For example only a small portion of emails with attachments would be listed via a quick filter search. When it was fully indexed, the size displayed as 3.2 GiB and all emails with attachments were listed via quick filter search.

For some reason the original folder is not properly indexed. And either the indexing data contribute to the folder size, or the size of the folder is properly calculated only after it has been fully indexed.
User avatar
progdan
KDE Developer
Posts
90
Karma
0
OS
Hi,

the folder size is calculated independently of the index (Akonadi stores size of each email internally). Could you please do the following:

1) open Akonadi Console
2) go to Browser tab
3) right-click the original folder
4) go to Folder Properties tab, write down the "Identifier" number
5) repeat steps 2) - 4) for the copied folder
6) go to "DB Console" tab
7) run the following query: SELECT CAST(SUM(size) AS BIGINT) FROM PimItemTable WHERE collectionId = IDENTIFIER_OF_THE_ORIGINAL_FOLDER;
8) write down the result number
9) run the same query again, just replace the identifier with identifier of the copied folder
10) write down the result number

Now in theory the two result numbers should be the same. If they are, then the problem is probably somewhere in how we represent or update the size counter (IIRC the updates are incremental, so maybe we add some email twice to the sum or something like that). If they are different, then there is a biggerr problem somewhere in the COPY or in the maildir resource, probably some emails are getting duplicated in the database.


Daniel Vrátil | www.dvratil.cz | dvratil@kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]