Re: [PATCH v2] git-svn: avoid filling up the disk with temp files.
- From
Björn Steinbrink <b.steinbrink@gmx.de>
- Date
- Jun 29, 2008, 02:24 UTC
- Message-ID
- <20080629022400.GA12112@atjola.homenet>
- In-Reply-To
- <20080629005858.GA2036@atjola.homenet>
On 2008.06.29 02:58:58 +0200, Björn Steinbrink wrote:
Show 24 quoted lines
> On 2008.06.28 19:33:56 -0400, Avery Pennarun wrote:
> > Commit ffe256f9bac8a40ff751a9341a5869d98f72c285 ("git-svn: Speed up fetch")
> > introduced changes that create a temporary file for each object fetched by
> > svn. These files should be deleted automatically, but perl apparently
> > doesn't do this until the process exits (or perhaps when its garbage
> > collector runs).
> >
> > This means that on a large fetch, especially with lots of branches, we
> > sometimes fill up /tmp completely, which prevents the next temp file from
> > being written completely. This is aggravated by the fact that a new temp
> > file is created for each updated file, even if that update produces a file
> > identical to one already in git. Thus, it can happen even if there's lots
> > of disk space to store the finished repository.
> >
> > We weren't adequately checking for write errors, so this would result in an
> > invalid file getting committed, which caused git-svn to fail later with an
> > invalid checksum.
> >
> > This patch adds a check to syswrite() so similar problems don't lead to
> > corruption in the future. It also unlink()'s each temp file explicitly
> > when we're done with it, so the disk doesn't need to fill up.
>
> I'm running another import of the coq repo that failed earlier, just to
> make sure, ...Import completed successfully, so:
Tested-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Thanks, Björn