rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rdiff-backup-users] rdiff-backup features?


From: address@hidden
Subject: Re: [rdiff-backup-users] rdiff-backup features?
Date: Wed, 11 Jul 2007 16:55:43 -0700 (PDT)

Good idea.  Graceful recovery after out-of-disk and kill-9 (power failure)
conditions would be nice too; perhaps this your forward increment idea
would allow for this by deleting the forward increments and keeping a
consistent backup tree at all times if this were to happen.  Currently,
rdiff-backup does not always recover from a power failure/kill-9.


If we want to be really careful, we'll probably want to make sure we
flush/sync when we are in a consistent state and, in other cases, know
when we aren't.  We shouldn't assume that just because something was
handed off to the OS that it was written to disk.  I'm not sure what
the best way to do that would be -- perhaps recognize when we had a
less than graceful termination and verify the hash in the metadata?

As you noted, sync() is usually the method used to tell the OS to force the data to disk (baring RAID write caches w/o battery). I'm not much for python, but the C equivalent might be something like below. The OS guarantees that the file dirty_flag has the content "dirty" or "clean" when it completes.

You might fsync the meta_data at appropriate times as well. Either way, using sync() appropriately can help accomplish this. Backups are critical enough that a fsync of each forward/backward increment and the mirror copy should be sync()d to disk before close()ing the file as well.

-Eric

write_dirty()
{
  fd = open("dirty_flag", O_WRONLY);
  write(fd, "dirty", strlen("dirty"));
  fsync(fd);
  close(fd);
}

write_clean()
{
  fd = open("dirty_flag", O_WRONLY);
  write(fd, "clean", strlen("clean"));
  fsync(fd);
  close(fd);
}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]