Repository/ostree cleanup

Dan Nicholson nicholson at endlessm.com
Wed Jan 11 21:30:11 UTC 2017


On Wed, Jan 11, 2017 at 2:44 PM, Alexander Larsson <alexl at redhat.com> wrote:
> On Wed, 2017-01-11 at 21:41 +0100, Alexander Larsson wrote:
>> On Wed, 2017-01-11 at 14:39 -0600, Dan Nicholson wrote:
>> > On Tue, Jan 10, 2017 at 4:53 AM, Alexander Larsson <alexl at redhat.co
>> > m>
>> > wrote:
>> > >
>> > > I don't think it is ever unsafe to delete old versions, or am I
>> > > missing
>> > > something? I mean, clearly you can't install the versions being
>> > > deleted, or
>> > > be in the process of downloading it. However, if you have an old
>> > > version
>> > > locally installed, removing it from the remote should be ok (i.e.
>> > > keep
>> > > working locally and still be able to pull the latest version).
>> >
>> > The problem I'm thinking of is that an old commit gets pruned and
>> > removes an object that the concurrent pull into the repo requires.
>> > As
>> > far as I know, there's no guard against that in ostree. Normally I
>> > don't think this would happen, but I think it's entirely possible
>> > that
>> > an app could ship a file 2 versions ago, remove it in the previous
>> > version because it was not thought to be needed, and then added
>> > back
>> > with the same content in the current version when it was determined
>> > that it was needed. I.e., an overagressive cleanup list in the
>> > builder
>> > manifest.
>> >
>> > If you're pruning v-2 while pulling/committing v, it's entirely
>> > possible that the commit will think the object exists and not
>> > commit
>> > it again, right? I think that's what
>> > https://bugzilla.gnome.org/show_bug.cgi?id=759442 is all about,
>> > isn't
>> > it?
>>
>> Well, thats a slightly different case though. Pruning a repo while
>> commitíng to it, and yes, that is not safe for that reason.
>>
>> It should be safe to prune an old commit from a repo while at the
>> same
>> time pulling another commit *from* that repo.
>
> In other words, if you make sure that your modifications to the repo
> are not in parallel, it is safe to purge old commits while having users
> downloading the latest versions.

Ah, right. I had read the original email and interpreted "installing
or updating" as commits/pulls happening on the repo host. Certainly if
you can guarantee that nothing commits to the repo while pruning, then
it's completely safe.

--
Dan



More information about the xdg-app mailing list