Opened 2 years ago

Last modified 17 months ago

#15915 assigned bug

Old package states should be cleaned up by the package_daemon

Reported by: leavengood Owned by: leavengood
Priority: normal Milestone: Unscheduled
Component: Servers/package_daemon Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All


I fixed the slow boot times issue related to old package states: #12498

But the old states still consume excessive disk space.

My idea to fix this is just to keep the number of old states to some maximum, like 10 or 20. I thought about considering time (AKA the age of the states), but after thinking about it more I don't think that really should matter.

Relevant forum threads:

Some feedback from users in the above thread indicates that maybe some states should be marked in some way so they aren't deleted. That seems to potentially really complicate things.

More users are complaining about it here:

Change History (7)

comment:1 by humdinger, 2 years ago

In a comment of ticket #12498, axeld mentions that it' s not necessarily trivial, because states may be 'interdependent', if I understand that right.

comment:2 by nephele, 2 years ago

The easiest solution would be to start deleting old states when the entire dir is over some arbitrary size limit, if size is the problem. No matter what mechanism is picked I don't want it to delete any old states for me, I am not that tied for space and without the old states it makes figuring out since when a problem exists potentially much harder.

maybe an opt-out or so could be nice then.

comment:3 by leavengood, 2 years ago

I will have to look into how states can depend on each seems that generally the older states can be deleted with little bad affect since that is what people do on their own for this problem.

nephele: There will definitely be an opt-in setting for this, I guess in SoftwareUpdater?

As for size versus number of states maybe considering size is a better way to go...

Also I have a simple idea for keeping specific states when someone turns this on: drop a keep file in whatever state directories you want kept.

comment:4 by nephele, 2 years ago

The dependance is probably because packages get moved into state dirs when they get upgraded, thus older states would need to grab the package from there. (and if you delete that middle state the older might not work anymore?) (if the package names are unique i fail to see why they aren't in a archive/ dir or something though)

comment:5 by pulkomandy, 2 years ago

Yes, older states depend on newer ones. Each state stores a transaction rollback and can be applied only from the correct starting point.

As for where to put this, preferences->repositories would make sense, I guess. But I would merge that with SoftwareUpdater, anyway.

comment:6 by leavengood, 2 years ago

I need to spend more time using Haiku, installing packages and looking at how the states work. There was some good feedback in the forums but it also makes this sound more complicated that I thought and that saps my motivation a bit.

I don't mind trying to help on the package system since it seems no one else has the time, and I want to learn it, but there may be easier or more pressing issues for me to work on before this.

comment:7 by kallisti5, 17 months ago


  1. Some pkgman cleanup tool
  2. Only keep the last 15 states, FIFO

#1 is likely more idea since there is not "fixed" size for a previous state. #2 is good because it's "automatic".

I think the best approach may be a mix of the two :-)

Note: See TracTickets for help on using tickets.