Modified RSML to create new file on load; keep only last 10

0 views
Skip to first unread message

Doug Judd

unread,
Sep 6, 2009, 11:26:42 PM9/6/09
to hypertable-...@googlegroups.com

Luke

unread,
Sep 7, 2009, 7:00:14 AM9/7/09
to hypertable-...@googlegroups.com
Writing a buffer to any fs is not guaranteed to be atomic, you might
end up with partial/corrupt RSML with all kinds of failures including
running out disk space. The usual way is to:

1. write everythiing to a tmp file and sync
2. if 1. succeeds, rename tmp file to the final file and sync

The assumption is that rename is atomic, which seems to be true on
posix fs (linux, bsd, solaris etc.) and most other fs, especially when
the final filename is shorter than the tmp file name.

__Luke

On Sun, Sep 6, 2009 at 8:26 PM, Doug Judd<do...@zvents.com> wrote:
> http://github.com/nuggetwheat/hypertable/commit/3b2bf875ed31d5ce61b55ad6758a5c2803ff5f4c
>
> - Doug
>
>
> >
>

Doug Judd

unread,
Sep 7, 2009, 12:02:43 PM9/7/09
to hypertable-...@googlegroups.com
Good point, I'll make the change.

- Doug
Reply all
Reply to author
Forward
0 new messages