[Kde-pim] Status of calender ical directory resource
Martin Steigerwald
Martin at lichtvoll.de
Thu Mar 27 13:04:14 GMT 2014
Hi!
I always liked the approach of the contacts resource, to use a directory of
vcf files instead of a single file, but found that my calendar was still using a
single file in the traditional location ~/.kde/share/apps/korganizer/std.ics
which was about 7 MiB already. I do journal entries in my calendar as well and
sometimes attach files to appointments I like to include within the calendar
itself.
I thought that it would be nice to have this as folder of ics files as well.
And found this to be possible with akonadi_icaldir_resource.
Now I have a few question regarding this:
1) Why isn´t it used? It avoids writing a complete 7 MB file on adding an
appointment (even if its delayed somewhat by internal caching). I think its
also safer as modifying an event just write to one single event file and there
is no risk to loose other events (due to incomplete writing of std.ics file).
2) What is the status of it, is it considered supported and stable? More on my
findings about this in a moment.
3) Why can I not set a name for it like with ical file resource? I can set a
name in Korganizer, but not in Akonadiconsole via "Configure Natively".
Consequently it shows as akonadi_icaldir_resource_0 in Akonadiconsole instead
of the name I set for it in Korganizer. Is this just a missing feature?
As regarding the stability, I tried to migrate my old calender to the new, as
I found in Akonadiconsole that I can move or copy items between collections in
the "Browser" tab.
First I moved on item. It immediately got removed from the std.ics and added
as libical-file to ~/.local/share/calender directory I selected for it for
storage.
Then I was bold and moved 10 items. These got removed from std.ics file, but
only the first of it got added to the calender directory. The others seemed to
appear in file_db_data and Akonadi displayed the items in the new icaldir
collection and not in the old one. I waited for minutes, but they didn´t
appear in the calender folder. I bet this is due to the caching within
Akonadi, but I expected it to act after 15 minutes or so. For mail folders its
possible to set a cache policy, I didn´t find it for icaldir resource folder.
Then I was crazy and did Ctrl-A of the 4173 items and moved them all.
Akonadiconsole was thinking about itself for a while, still then nothing got
removed from std.ics, and nothing got added to calendar. Well maybe the first
item got moved, I didn´t check that closely. However items appeared to be
moved within Akonadiconsole after a while and appeared in file_db_data. Nothing
seemed to happen for about half an hour of me reading stuff about Akonadi and
trying to find out more how file_db_data behaves. I was puzzled cause I expected
Akonadi to at least remove the stuff from std.ics, when it has stored it in
file_db_data already.
I tried to find ways to trigger any action and did "Synchronize Folder" and
"Synchronize Folder Recursively" on ical dir resource. It worked a bit, yet
still no files appeared in calender directory. Then I tried the same to the old
ical file resource to see whether it removes the stuff from std.ics. It didn´t.
Instead it appeared to rescan std.ics and added all entries in it to the
resource again. I think it should have known that I moved them already :).
Then I went bold knowing that nice handy BTRFS snapshot and a manual backup of
the old std.ics in place and deleted that newly added items to have it
truncate the the std.ics. This did work.
Yet still in calendar folder no new ical files appeared. Then I read about
"Clear Akonadi Cache" regarding how to correct incorrect information in some
mail folders. I wondered already that this may destroy may calender items, but
tried it nonetheless in the slight hope that clearing akonadi cache would mean
that icaldir resource takes those file in file_db_data and writes them out in
the calender directory finally.
Well it didn´t and on Akonadiconsole restart only the few items that Akonadi
actually really moved were still there.
So it seems that moving items from an ical file resource to an ical dir
resource is somewhat broken. Is it supposed to work at all?
Then I tried the saner approach of copying the items:
Then quitted Akonadi, made sure mysql got quitted to, was still running after
akonadictl stop completed with a popup. I bet this might be due to the case I
had a mysql client running on its socket. I´d expect MySQL to disconnect the
client in that case.
Put the backup of the std.ics file in place and started Akonadi again. It
immediately picked up the contents of the file and I had my calender back.
I unselected both calendar resource in Korganizer so it doesn´t get too crazy.
And then I Ctrl-A on the ical file resource items and just copied them all over
to the icaldir resource. The copy operation went smoothly and nicely. I told
Korganizer to display the icaldir resource calender and voila there it was.
I now have a nice:
martin at merkaba:~/.local/share> find calendar -type f | wc -l
4156
martin at merkaba:~/.local/share> du -sh calendar
21M calendar
Hmm, du seems to count each file in 4 KiB blocks, unless I use:
martin at merkaba:~/.local/share> du --apparent-size -sh calendar
11M calendar
Instead of a
martin at merkaba:~/.kde/share/apps/korganizer> ls -l std.ics
-rw-r--r-- 1 martin martin 7540714 Mär 27 13:29 std.ics
I wonder a bit about the size difference tough. Why is the calender folder 11
MiB instead of about 7 MiB?
Well, I expect this to be some overhead of ical format, header information
duplicated in each file. I am fine with that.
Another observation: It is a nice idea to disable showing calender items in
Digital Clock, if I intend to use plasma-desktop during such an operation. It
was blocked for minutes :)
There are some possible bug reports in there and I am willing to report those,
just first I wanted to get some feedback about the state of the resource.
I think I did a bit deeper in some stuff and do some more analysis. I saw some
huge amounts of stat("/etc/localtime")... on each access of a maildir mail file
or somewhat…
But for now I leave it at that. I will test icaldir resource for now. I am
quite confident that it will work as contacts resource works nicely as well.
I learned some more about Akonadiconsole and Akonadi behaviour…
Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list