Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25499 - emerge sync/webrsync destroys /usr/portage when tmp filesystem is full during sync
Summary: emerge sync/webrsync destroys /usr/portage when tmp filesystem is full during...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All All
: High critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 61398 (view as bug list)
Depends on: 35535
Blocks:
  Show dependency tree
 
Reported: 2003-07-29 04:05 UTC by Andreas Kobara
Modified: 2011-10-30 22:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kobara 2003-07-29 04:05:06 UTC
When running a emerge sync or emerge-webrsync with less than 16 MB
free filesystem space for the tmp partition, the portage sync will
abort syncing and continue with deleting the rest of /usr/portage
which will leave the system in a broken condition.
You'll have to manually copy a /usr/portage tree from a stage-image
to get your system working(updateable by emerge sync) again.

Reproducible: Always
Steps to Reproduce:
1. Lower free space on /var/tmp or /tmp filesystem to less than 16 MB.
   (e.g. dd a big file for filling your filesystem to emulate that)
2. Sync the portage tree either by emerge sync or emerge-webrsync
   (big updates will will use more tempspace, so try to update a more
    outdated /usr/portage tree)
3. See the rsync failing due to out of filesystem space and it will
   move over to deleting the rest of your /usr/portage tree.
4. Enlarge your free filesystem space again.
  (e.g. remove your dd-file from step1)
5. Try to emerge sync (or emerge-webrsync) your system again now.
6. It fails after updating a few directories which where left in /usr/portage.

Actual Results:  
You'll have to copy a complete /usr/portage tree from a backup or stage image
to get your portage sync working again.


Expected Results:  
emerge sync or emerge-webrsync should check for at least 64MB free filesystem
space, or a commandline switch or config-parameter should be added somewhere
to check for this.

It's extremly nasty for people using an internal /usr/portage(rw)-nfs-export
where everyone should be allowed to do a sync to update it.
But if one of those users doesn't watch the local filesystem space, they might
kill this original tree on the NFS-server.
So noone can use /usr/portage anymore.
Comment 1 Benjamin Judas (RETIRED) gentoo-dev 2004-08-25 01:21:20 UTC
Portage team - any comments about this one?
Comment 2 Brian Harring (RETIRED) gentoo-dev 2004-08-25 11:10:31 UTC
Err... that sounds more like a rsync bug then portage bug.
Comment 3 Andreas Kobara 2004-08-25 14:23:10 UTC
Yes, might be a rsync issue...

I did find this:
http://groups.google.com/groups?selm=aqda8b%24oii%241%40FreeBSD.csie.NCTU.edu.tw&output=gplain

It was suggested to change code in receiver.c
to raise an ENOSPC instead of RERR_FILEIO at some places.
This was Nov/2002, and now in 2004 with rsync 2.6.x we
still have the same code/bug ?


Comment 4 John Davis (zhen) (RETIRED) gentoo-dev 2004-10-25 13:56:29 UTC
this is definitely not a release bug...
Comment 5 Andreas Kobara 2004-10-26 01:08:14 UTC
Fact is that webrsync will kill your portage tree when running out of diskspace.

IMHO rsync should handle this, at least we need a patch for gentoo to ensure
that it doesn't get its portage-tree destroyed that way.

(This also happens when the portage snapshot is incomplete as on 10242004, as
rsync just does its job and deletes everything not inside the snapshot.)
Comment 6 Brian Harring (RETIRED) gentoo-dev 2005-02-27 23:03:02 UTC
No way to handle when the snapshot is incomplete, and the md5sum of the snapshot is correct (in other words, if our mirrors are daft and release an incomplete snapshot, you're screwed and portage cannot detect it).

Besides that, tar returns should be checked... for the sync refactoring, I know it is.  For stable, the tar exit code is checked also.
Comment 7 Brian Harring (RETIRED) gentoo-dev 2005-02-28 00:50:45 UTC
*** Bug 61398 has been marked as a duplicate of this bug. ***