[Bug 26773] New: ordering issue for log-manager when tries to sort() messages

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Feb 26 14:49:51 CET 2010


http://bugs.freedesktop.org/show_bug.cgi?id=26773

           Summary: ordering issue for log-manager when tries to sort()
                    messages
           Product: Telepathy
           Version: 0.9
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: logger
        AssignedTo: telepathy-bugs at lists.freedesktop.org
        ReportedBy: cosimo.alfarano at collabora.co.uk


shortly:
messages having the same timestamp in the same logstore should be returned by
the log-manager methods in the stored order.

It for sure affects tpl_log_manager_get_filtered_messages(), maybe other
methods.

explanation:
log-manager sometimes sort logentries, this because it queries multiple
logstores and then merges entries together before returning.

When entries have the same timestamp (granularity is second, so it is possible
to happen), they are returned reversed respect the stored order.

Example:

in logstore those messages are stored in this order (format = timestamp +
text):
time='20100226T12:39:03' 1
time='20100226T12:39:04' 2
time='20100226T12:39:04' 3
time='20100226T12:39:05' 4
time='20100226T12:39:05' 5
time='20100226T12:39:05' 6

if tpl_log_manager_get_filtered_messages() is used getting the last 5 lines (as
empathy does), the result will be:

3
2
6
5
4

which means that the methods sorts '2','3' (TS1=12:39:03) and '4', '5','6'
(TS1=12:39:04), returning them in reverse order within the group, but sorted
correctly chronologically (TS1<TS2)

I'd expect, because of the storing order:
2
3
4
5
6

"time='20100226T12:39:03' 1" is correctly skipped since I wanted only the last
5 messages.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the telepathy-bugs mailing list