chiark / gitweb /
journal: fix skipping of duplicate entries in iteration
authorMichal Schmidt <mschmidt@redhat.com>
Fri, 19 Dec 2014 14:05:30 +0000 (15:05 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Fri, 19 Dec 2014 14:37:10 +0000 (15:37 +0100)
commit487d37209b30a536636c95479cfeba931fea25c5
tree50652620030ff521d9744d6bd45e806eb2e0da20
parentbfcdba8d565041275319e5b1605c543d243ad7c4
journal: fix skipping of duplicate entries in iteration

I accidentally broke the detection of duplicate entries in 7943f42275
"journal: optimize iteration by returning previously found candidate
entry".

When we have a known location of a candidate entry, we must not return
from next_beyond_location() immediately. We must go through the
duplicates detection to make sure the candidate differs from the
already iterated entry.

This fix slows down iteration a bit, but it's still faster than it
was before the rework.

$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null

real    0m4.448s
user    0m4.298s
sys     0m0.149s

(Compare with results from commit 7943f42275, where real was 5.3s before
the rework.)
src/journal/sd-journal.c