[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: 'svnadmin verify' failed after hotcopy with 'svnadmin: E160004: Revision file (r2255) lacks trailing newline'

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 12 Jan 2012 16:17:11 +0000

D D <ddwa09_at_gmail.com> writes:

> I'd be interested to know if svnadmin employs some memory buffer to
> hot-copy.
> The offsets where data corruption starts look like multiples of 0x1000
> which is 4K.
> The NTFS cluster size on the disk is exactly 4K.
> If svnadmin just calls the OS to copy each file the problem should either
> be in the OS
> or the disk.

Hotcopy uses libsvn_subr/io.c:copy_contents where SVN__STREAM_CHUNK_SIZE
is 16384:

  /* Copy bytes till the cows come home. */
  while (1)
    {
      char buf[SVN__STREAM_CHUNK_SIZE];
      apr_size_t bytes_this_time = sizeof(buf);
      apr_status_t read_err;
      apr_status_t write_err;

      /* Read 'em. */
      read_err = apr_file_read(from_file, buf, &bytes_this_time);
      if (read_err && !APR_STATUS_IS_EOF(read_err))
        {
          return read_err;
        }

      /* Write 'em. */
      write_err = apr_file_write_full(to_file, buf, bytes_this_time, NULL);
      if (write_err)
        {
          return write_err;
        }

      if (read_err && APR_STATUS_IS_EOF(read_err))
        {
          /* Return the results of this close: an error, or success. */
          return APR_SUCCESS;
        }
    }

-- 
Philip
Received on 2012-01-12 17:17:56 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.