Hammer: Transactional file updates

Michael Neumann mneumann at ntecs.de
Fri Aug 1 04:09:25 PDT 2008


Hi,

So Hammer does not guarantee "transctional consistency" of data in case
of a crash, only that of meta-data, right?
Is there a method to guarantee the write to be transactional, so that
I either have the previous "version" of the file or the version that I
wrote? Like this:
  fd = open(file);  // behaves like START TRANSACTION
  read(fd, ...);
  write(fd, ...);
  close(fd);        // behaves like COMMIT
That would be incredible cool (and very useful!) and could play well due
to Hammers historical nature.
I know I could probably solve this issue by creating a new file,
fsyncing it and then doing a "rm old_file; mv new_file old_file" (or
something like that), but that would give me a new inode number, which
I'd like to avoid.
Regards,

  Michael





More information about the Users mailing list