http://bugzilla.meego.com/show_bug.cgi?id=725

           Summary: sort session directories by increasing sequence number
    Classification: MeeGo Projects
           Product: SyncEvolution
           Version: unspecified
          Platform: Netbook
        OS/Version: IA
            Status: ASSIGNED
          Severity: enhancement
          Priority: Medium
         Component: SyncEvolution
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
                CC: [email protected],
                    [email protected]
   Estimated Hours: 0.0


This is from http://bugzilla.moblin.org/show_bug.cgi?id=9759

   Description  From  pohly   2010-02-18 05:03:33 PST   (-) [reply]

Our current approach of putting a date/time and (if necessary) sequence number
into the directory name is useful because it ensures sorting when looking at
the dirs.

But for correct sorting it is not sufficient:
- we use local time, which might change as the user moves between timezones
- clocks might get set back

We should assign a sequence number to each logdir. This can be stored in the
status.ini file. When creating a new entry, find the highest sequence number
and increase it by one. Do the same directory name mangling as we do now (to
keep the nice names nice).

Then when we have to sort from oldest to newest, do it based on the sequence
number.

------- Comment #1 From pohly 2010-02-18 05:25:18 PST (-) [reply] -------

LogDirTest::testExpire() has to sleep(), because otherwise it creates so many
sessions per second that we end up with -9 and -10 sequence suffices, which no
longer sorts correctly. Remove the sleep() once this issue is resolved.

------- Comment #2 From pohly 2010-02-18 06:32:07 PST (-) [reply] -------

We use hour and minute as part of the name. Sleeping for a minute just to reset
the sequence number is too slow, so I split the test functions into two halves.

------- Comment #3 From pohly 2010-02-26 01:23:51 PST (-) [reply] -------

Patch below in "pohly" branch. Yongsheng, can you review? Does that solve the
problem well enough so that we can close this issue?

commit b5ed5ec60a5f5b97a8eacafa9d25235730b05117
Author: Patrick Ohly <[email protected]>
Date:   Fri Feb 26 10:08:02 2010 +0100

    LogDir: use a-z instead of number to make session dirs unique (MB #9759)

    Using numbers 1..9..10.. as suffix had the problem that sorting
    puts -10 in front of -2. Because we use hh-mm as base name, this
    limited us to 9 sessions per minute, which is easily reached
    when doing local testing.

    By switching to -a to -z as suffix, we get 27 sessions per minute
    before moving on to less nice characters (possible, but might
    make file names unusuable eventually). That should be enough.
    In local tests I got as far as -q.

    With this change, the LogDir expire tests can be merged back
    into one function.

    An additional benefit is that the suffix is visually different
    from the base name, which makes it a bit easier to identify
    yyyy-mm-dd-hh-mm manually.

------- Comment #4 From yongsheng zhu 2010-02-28 23:20:53 PST (-) [reply]
-------

(In reply to comment #3)
> Patch below in "pohly" branch. Yongsheng, can you review? Does that solve the
> problem well enough so that we can close this issue?
so it is supposed that the number of sessions in one minute is less than 26,
right?
If yes, please go on.

-- 
Configure bugmail: http://bugzilla.meego.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
_______________________________________________
Syncevolution-issues mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution-issues

Reply via email to