[systemd-devel] Fragile journal interleaving

Lennart Poettering lennart at poettering.net
Wed Dec 13 17:40:20 UTC 2017


On Mi, 13.12.17 00:43, Uoti Urpala (uoti.urpala at pp1.inet.fi) wrote:

> On Tue, 2017-12-12 at 21:38 +0100, Lennart Poettering wrote:
> > Maybe the approach needs to be that we immedately increase the read
> > record ptr of a specific file by one when we read it, so that we know
> > we monotonically progress through the file. And then change the logic
> > that looks for the next entry across all files to honour that, and
> > then simply skip over fully identical entries, but not insist on
> > monotonic timers otherwise.
> 
> Isn't this pretty much what the code already does (except for the
> "fully identical entries" part)? The next_beyond_location() function
> already gives the next entry from a given file, and seems to use the
> internal order of the file when doing that. So the only change would be
> making the duplicate check only discard actually identical entries. And
> now that I checked the surrounding code, it looks like even in the new-
> file-added case you mentioned next_beyond_location() would call
> find_location_with_matches(), which should seek the new file to the
> correct position, so I don't see why the monotonicity discard would be
> needed for that case either?

I figure you are right.

Any chance you can prep a patch for this change?

I'd lie if I'd claim that I fully see the full effect of such a
change, but I think what you propose should work.

Thanks,

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list