LWN: Comments on "XFS: the filesystem of the future?" https://lwn.net/Articles/476263/ This is a special feed containing comments posted to the individual LWN article titled "XFS: the filesystem of the future?". en-us Wed, 17 Sep 2025 19:34:50 +0000 Wed, 17 Sep 2025 19:34:50 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net XFS: the filesystem of the future? https://lwn.net/Articles/750517/ https://lwn.net/Articles/750517/ vcmohans <div class="FormattedComment"> I am trying to achieve the best performance to find a string from the 12 different files with 12 dedicated threads.For that I have configured 120GB of two samsung SSDs in RAID0(striping) configuration with XFS file system.But the result is same as EXT4 file system.Why the performace is not improved?<br> </div> Fri, 30 Mar 2018 07:19:51 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485676/ https://lwn.net/Articles/485676/ XTF <div class="FormattedComment"> <font class="QuotedText">&gt; but their underlying assumption is that moving all this into the kernel will solve all these problems. Well, it doesn't.</font><br> <p> Why not? Some of the issues should be easy to avoid in kernel space.<br> <p> <font class="QuotedText">&gt; For example: how does moving the overwrite into the kernel make it any easier to decide whether we should break hard links or not?</font><br> <p> What does the non-atomic case do? I'd do the same in the atomic case.<br> <p> <font class="QuotedText">&gt; IOWs, the issue here is that nobody has defined what the operations being asked for are supposed to do, the use cases, the expected behaviour, constraints, etc. </font><br> <p> My request was quite clear: Could any of the fsync advocates post real code that does the atomic variant of open, write, close?<br> Isn't that quite well-defined?<br> <p> <font class="QuotedText">&gt; Before asking kernel developers to do something the problem space needs to be scoped and specified</font><br> <p> Before that, we should agree that these are valid issues / assumptions / regressions. <br> <p> <font class="QuotedText">&gt; But what really needs to happen first is that someone asking for this new kernel functionality steps up and takes responsibility for driving this process.....</font><br> <p> That'd be great, but at the moment most (FS) devs (and others) just declare these non-issues and refuse to discuss.<br> </div> Wed, 07 Mar 2012 16:54:09 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485633/ https://lwn.net/Articles/485633/ dgc <div class="FormattedComment"> <font class="QuotedText">&gt; the OP is concerned about rather esoteric situations</font><br> <p> I know. But what was described was a specific set of block and disk cache manipulations. It wasn't a set of requirements; all I was doing is pointing out if I treated it as a set of requirements then it can be implemented with the existing POSIX API.<br> <p> <font class="QuotedText">&gt; These situations do exist, but they are rather rare and the 'right</font><br> <font class="QuotedText">&gt; thing' to do is not always and obvious and consistent thing.</font><br> <p> And that is precisely why the problem can't be solved by some new magic filesystem operation until the desired behaviour is defined and specified. The weird corner cases that make it hard for userspace also make it just as hard to implement it in the kernel. I see lots of people pointing out why using rename is hard, but their underlying assumption is that moving all this into the kernel will solve all these problems. Well, it doesn't. For example: how does moving the overwrite into the kernel make it any easier to decide whether we should break hard links or not?<br> <p> IOWs, the issue here is that nobody has defined what the operations being asked for are supposed to do, the use cases, the expected behaviour, constraints, etc. <br> <p> Before asking kernel developers to do something the problem space needs to be scoped and specified. For the people that want this functionality in the kernel: write a man page for the syscall. Refine it. Implement it as a library function and see if you can use effectively for your use cases. Work out all the kinks in the syscall API. Ask linux-fsdevel for comments and if it can be implemented. Go back to step 1 with all the review comments you receive, then continue looping until there's consensus and somebody implements the syscall with support from a filesystem or two. Once the syscall is done, over time more filesystems will then implement support and then maybe 5 years down the track we can assume this functionality is always available.<br> <p> But what really needs to happen first is that someone asking for this new kernel functionality steps up and takes responsibility for driving this process.....<br> <p> Gesta non verba.<br> </div> Wed, 07 Mar 2012 11:19:29 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485588/ https://lwn.net/Articles/485588/ XTF <div class="FormattedComment"> <font class="QuotedText">&gt; about rather esoteric situations where </font><br> <p> Since when is not reseting meta-data (like file owner, permissions, acls, creation timestamp, etc) an esoteric situation<br> <p> Each case by itself might be insignificant, but all cases together are not, IMO:<br> Assuming the target is not a symlink to a different volume<br> Assuming you are allowed to create the tmp file<br> Assuming you are allowed to overwrite an existing file having the same name as your tmp file<br> Assuming it's ok to reset meta-data, like file owner, permissions, acls, creation timestamp, etc.<br> Assuming the performance regression due to fsync is ok (request was for atomic, not durable)<br> </div> Tue, 06 Mar 2012 22:09:33 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485584/ https://lwn.net/Articles/485584/ nybble41 <div class="FormattedComment"> <font class="QuotedText">&gt; open(tmpfile)</font><br> <font class="QuotedText">&gt; write(tmpfile)</font><br> <font class="QuotedText">&gt; fsync(tmpfile)</font><br> <font class="QuotedText">&gt; rename(tmpfile, destination)</font><br> <p> Now find a way to do that *without* the need for a temporary file, and you might have something relevant to contribute to the thread.<br> <p> A temporary file is not always an acceptable option; it presumes that you know of a directory in which you can create a temporary file guaranteed to be on the same filesystem as the file that it's replacing, so that rename() can be implemented atomically, and that either there are no hard links to the file or that those links should be broken by the rename(). Moreover, the rename() method resets portions of the security context of the original file, including ownership and security labels, which you can't restore without superuser capabilities.<br> <p> This thread exists because people who do know plenty about the POSIX interfaces also know that they don't provide a general solution.<br> </div> Tue, 06 Mar 2012 22:05:09 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485586/ https://lwn.net/Articles/485586/ XTF <div class="FormattedComment"> <font class="QuotedText">&gt; It seems that there are lots of people with ideas of how to "improve" overwrites but few of those people really understand the mechanisms that filesystems already provide via the POSIX interface. If you ever wonder why filesystem developers are a little bit sick of this topic, your post is a perfect example.</font><br> <p> Other people appear to have trouble reading. ;)<br> Your code was posted already and didn't suffice.<br> </div> Tue, 06 Mar 2012 22:00:14 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485580/ https://lwn.net/Articles/485580/ dlang <div class="FormattedComment"> per the other messages in this thread, the OP is concerned about rather esoteric situations where <br> <p> the file is a bind mount<br> <p> the program doesn't have permission to make a new file in the directory (only to modify an existing one)<br> <p> where the file is a special link (symlink, multiple hardlinks, bind mounted, etc) and the 'right thing' is to maintain those links instead of breaking them to have the modified version be a local copy<br> <p> these situations do exist, but they are rather rare and the 'right thing' to do is not always and obvious and consistent thing.<br> </div> Tue, 06 Mar 2012 21:43:41 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485573/ https://lwn.net/Articles/485573/ dgc <div class="FormattedComment"> <font class="QuotedText">&gt; - Write new data to disk blocks which are unallocated on disk, but</font><br> <font class="QuotedText">&gt; allocated in memory.</font><br> <p> open(tmpfile)<br> write(tmpfile)<br> <p> <font class="QuotedText">&gt; - Allocate new blocks on disk.</font><br> <font class="QuotedText">&gt; - Force in-order I/O (e.g. flush the disk cache).</font><br> <p> fsync(tmpfile)<br> <p> <font class="QuotedText">&gt; - Atomically update inode to point to new data blocks, in memory and</font><br> <font class="QuotedText">&gt; on disk.</font><br> <font class="QuotedText">&gt; - Force in-order I/O (e.g. flush the disk cache).</font><br> <font class="QuotedText">&gt; - De-allocate old data blocks on disk.</font><br> <p> rename(tmpfile, destination)<br> <p> It seems that there are lots of people with ideas of how to "improve" overwrites but few of those people really understand the mechanisms that filesystems already provide via the POSIX interface. If you ever wonder why filesystem developers are a little bit sick of this topic, your post is a perfect example.<br> <p> Dave.<br> </div> Tue, 06 Mar 2012 21:36:25 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485450/ https://lwn.net/Articles/485450/ XTF <div class="FormattedComment"> <font class="QuotedText">&gt; In that case, why did you say that on-disk inodes do not fit within one physical sector?</font><br> <p> You're right, inodes typically do fit in a sector.<br> What I wanted to say is that a meta-data transaction usually involves multiple parts / sectors. Providing consistency guarantees after a crash is hard without a journal.<br> <p> <font class="QuotedText">&gt; unless O_ATOMIC is exclusive, of course.</font><br> <p> Having a reader and a writer or multiple writers at the same time is always problematic.<br> <p> </div> Tue, 06 Mar 2012 12:55:48 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485335/ https://lwn.net/Articles/485335/ nybble41 <div class="FormattedComment"> <font class="QuotedText">&gt;&gt; I can only assume you have a particular filesystem in mind</font><br> <font class="QuotedText">&gt; Not really</font><br> <p> In that case, why did you say that on-disk inodes do not fit within one physical sector? That is filesystem-specific, and I certainly know of some where the full inode size is less than or equal to 512 bytes; ext2 is at least capable of being configured that way.<br> <p> <font class="QuotedText">&gt;&gt; True, if you want to implement full copy-on-write semantics. I was going for a simpler approach which can be implemented by almost any filesystem with no on-disk structure changes.</font><br> <font class="QuotedText">&gt; What do you mean by full copy-on-write semantics?</font><br> <font class="QuotedText">&gt; What on-disk structure changes would be required to do this in ext4 for example?</font><br> <p> Perhaps none. I didn't mean to imply that it was impossible to implement atomic replacement of partial files without changing the on-disk structure; I simply hadn't proved to myself that it could be done easily. In retrospect it probably could be done, though you would run into the aforementioned fragmentation issues common to most C.O.W. filesystems.<br> <p> The biggest complication is not on disk but in memory; you would need to modify the filesystem code to account for the shared data blocks, of which there may be as many alternate versions as there are O_ATOMIC file descriptors--unless O_ATOMIC is exclusive, of course.<br> </div> Tue, 06 Mar 2012 00:49:03 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485330/ https://lwn.net/Articles/485330/ nybble41 <div class="FormattedComment"> <font class="QuotedText">&gt; If you aren't allowed to create a new file in the directory of the file, are you sure you have permission to overwrite the file you are trying to modify?</font><br> <p> These are orthogonal permissions. To overwrite the file you need write permission on the file. To create a new file in the same directory you need write permission on the directory. It's easily possible to have one without the other:<br> <p> root# mkdir a<br> root# touch a/b<br> root# chown user a/b<br> <p> user$ echo test &gt; a/b # no error<br> user$ touch a/c<br> touch: cannot touch `a/c': Permission denied<br> <p> <font class="QuotedText">&gt; as for the symlink/hardlink 'issue', in my sysadmin experience, more problems are caused by editors that modify files in place (not using temp files and renaming them) than by breaking links.</font><br> <p> Obviously that would remain an option. The point is that it should be an *option*, alongside the ability to atomically update a file in place. Symlinks are often used to add version control over configuration files (without putting the entire home / etc directory in the repository), while bind mounts are more often used with namespaces and chroot environments. Usually you want the latter to be read-only, but if the file is read/write it makes sense to allow it to be updated without breaking the link. (You can't just delete or rename over a bind target, either; it has to be unmounted.)<br> </div> Tue, 06 Mar 2012 00:28:57 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485328/ https://lwn.net/Articles/485328/ XTF <div class="FormattedComment"> <font class="QuotedText">&gt; I can only assume you have a particular filesystem in mind</font><br> <p> Not really<br> <p> <font class="QuotedText">&gt; True, if you want to implement full copy-on-write semantics. I was going for a simpler approach which can be implemented by almost any filesystem with no on-disk structure changes.</font><br> <p> What do you mean by full copy-on-write semantics?<br> What on-disk structure changes would be required to do this in ext4 for example?<br> </div> Tue, 06 Mar 2012 00:10:14 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485311/ https://lwn.net/Articles/485311/ dlang <div class="FormattedComment"> <font class="QuotedText">&gt; it's not guaranteed that there exists a directory on the same filesystem where you have permission to create a temporary file.</font><br> <p> this sounds like a red hearing to me.<br> <p> If you aren't allowed to create a new file in the directory of the file, are you sure you have permission to overwrite the file you are trying to modify?<br> <p> as for the symlink/hardlink 'issue', in my sysadmin experience, more problems are caused by editors that modify files in place (not using temp files and renaming them) than by breaking links. Editors that break links when modifying a file are referred to as 'well behaved' in this area.<br> </div> Mon, 05 Mar 2012 23:37:02 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485296/ https://lwn.net/Articles/485296/ nybble41 <div class="FormattedComment"> <font class="QuotedText">&gt;&gt; The only part that really needs to be atomic is the metadata update. That's not usually a problem so long as your on-disk inodes, or at least those fields relating to top-level data block allocation, fit within one physical sector:</font><br> <p> <font class="QuotedText">&gt; They don't and that's not how atomicity is guaranteed. Atomicity is guaranteed via the journal.</font><br> <p> I can only assume you have a particular filesystem in mind. It is possible to arrange for inodes (or at least the data block portions) to fit within one sector, and to have atomic metadata updates without a journal. If you have a journal, great; atomic updates shouldn't be a problem. However, this system can also be retrofitted onto filesystem which do not support journals.<br> <p> <font class="QuotedText">&gt;&gt; This does assume _complete_ replacement, i.e. O_ATOMIC implies O_TRUNC.</font><br> <p> <font class="QuotedText">&gt; Not really, actually. You merely have to ensure that the old state / blocks remain valid, so you have to do all writes to new blocks.</font><br> <p> True, if you want to implement full copy-on-write semantics. I was going for a simpler approach which can be implemented by almost any filesystem with no on-disk structure changes.<br> </div> Mon, 05 Mar 2012 22:55:21 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485289/ https://lwn.net/Articles/485289/ nybble41 <div class="FormattedComment"> <font class="QuotedText">&gt;&gt; This does assume _complete_ replacement, i.e. O_ATOMIC implies O_TRUNC.</font><br> <font class="QuotedText">&gt; The process you list will badly fragment the file on disk, destroying performance (***unless you re re-writing the entire file***, in which case just writing a temporary file and renaming it will work)</font><br> <p> Emphasis added. Yes, I assumed the entire file was being rewritten. If not, one could add an online defragmentation step after the metadata update, though online defragmentation introduces atomicity issues of its own.<br> <p> Creating and renaming a temporary file has its own issues, which have already been mentioned, particularly relating to symlinks and hard links. Even for ordinary files, it's not guaranteed that there exists a directory on the same filesystem where you have permission to create a temporary file. Bind mounts (which can apply to individual files) are another potential sore spot. How much work should applications be expected to do just to find a place to put their temporary file such that rename() can be guaranteed atomic?<br> <p> An O_ATOMIC option to open() would ensure that you are really replacing the original file, and that the temporary space comes from the same filesystem.<br> <p> 1) No, there are no obvious solutions yet, but there have been several reasonable proposals.<br> <p> 2) Current applications can do atomic replacement in common but limited circumstances using rename(). They all depend on creating a temporary file on the same filesystem, which assumes both that you can locate that filesystem (see: bind mounts) and that you can create new files there. They also tend to break hard links, which may or may not be a desired behavior. There is no general, straightforward solution to the problem of atomically replacing the data associated with a specific inode.<br> </div> Mon, 05 Mar 2012 22:45:50 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485290/ https://lwn.net/Articles/485290/ XTF <div class="FormattedComment"> <font class="QuotedText">&gt; The only part that really needs to be atomic is the metadata update. That's not usually a problem so long as your on-disk inodes, or at least those fields relating to top-level data block allocation, fit within one physical sector:</font><br> <p> They don't and that's not how atomicity is guaranteed. Atomicity is guaranteed via the journal.<br> <p> <font class="QuotedText">&gt; This does assume _complete_ replacement, i.e. O_ATOMIC implies O_TRUNC. </font><br> <p> Not really, actually. You merely have to ensure that the old state / blocks remain valid, so you have to do all writes to new blocks.<br> </div> Mon, 05 Mar 2012 22:32:42 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485287/ https://lwn.net/Articles/485287/ XTF <div class="FormattedComment"> <font class="QuotedText">&gt; writing the data to the new blocks may not be atomic.</font><br> <p> It doesn't need to be<br> <p> <font class="QuotedText">&gt; writing the metadata to disk may not be atomic.</font><br> <p> That's why you use a journal<br> <p> <font class="QuotedText">&gt; If your writes to disk can't be atomic, how can the entire transaction?</font><br> <p> Heard of TCP? It creates a reliable connection over an unreliable network. <br> Or databases? Atomic transactions on unatomic disks are very possible.<br> <p> <font class="QuotedText">&gt; some of the data you write to a file may be visible before the metadata gets changed, which would make the change overall not be atomic.</font><br> <p> No, because you write the new data to *new* blocks. Blocks not references by any file yet.<br> </div> Mon, 05 Mar 2012 22:18:04 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485274/ https://lwn.net/Articles/485274/ dlang <div class="FormattedComment"> The process you list will badly fragment the file on disk, destroying performance (unless you re re-writing the entire file, in which case just writing a temporary file and renaming it will work)<br> <p> It's also not clear that this is what the original poster was looking for when he said "Linux devs should really provide a proper solution (like O_ATOMIC) instead of blaming app devs for not doing the impossible."<br> <p> I've been trying to make two points in this thread<br> <p> 1. it's not obvious what the "proper solution" that the kernel should provide looks like<br> <p> 2. it's not impossible to do this today (since there are many classes of programs that do this)<br> </div> Mon, 05 Mar 2012 21:36:00 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485256/ https://lwn.net/Articles/485256/ nybble41 <div class="FormattedComment"> The only part that really needs to be atomic is the metadata update. That's not usually a problem so long as your on-disk inodes, or at least those fields relating to top-level data block allocation, fit within one physical sector:<br> <p> - Write new data to disk blocks which are unallocated on disk, but allocated in memory.<br> - Allocate new blocks on disk.<br> - Force in-order I/O (e.g. flush the disk cache).<br> - Atomically update inode to point to new data blocks, in memory and on disk.<br> - Force in-order I/O (e.g. flush the disk cache).<br> - De-allocate old data blocks on disk.<br> <p> Between the "Allocated on disk" and "De-allocate on disk" steps there are potentially two version of the file data, only one of which is connected to a real file. A basic fsck tool or journal feature can clean up the disconnected version in the event that the process is interrupted.<br> <p> This does assume _complete_ replacement, i.e. O_ATOMIC implies O_TRUNC. A copy-on-write filesystem could implement O_ATOMIC efficiently without truncation, but not all filesystems have the necessary flexibility in the on-disk format for copy-on-write.<br> </div> Mon, 05 Mar 2012 21:04:54 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485254/ https://lwn.net/Articles/485254/ dlang <div class="FormattedComment"> <font class="QuotedText">&gt; At the hardware level it's quite simple: write the new data to new blocks, then write the meta-data.</font><br> <p> writing the data to the new blocks may not be atomic.<br> <p> writing the metadata to disk may not be atomic.<br> <p> <p> If your writes to disk can't be atomic, how can the entire transaction?<br> <p> some of the data you write to a file may be visible before the metadata gets changed, which would make the change overall not be atomic.<br> <p> </div> Mon, 05 Mar 2012 20:34:56 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/485182/ https://lwn.net/Articles/485182/ XTF <div class="FormattedComment"> <font class="QuotedText">&gt; depending on how much you want to write, and what your definition of atomic is, what you are asking for may not be possible.</font><br> <p> Why not?<br> At the hardware level it's quite simple: write the new data to new blocks, then write the meta-data.<br> <p> <font class="QuotedText">&gt; it also depends on what you mean about 'tons of regressions'</font><br> <p> Assuming the target is not a symlink to a different volume<br> Assuming you are allowed to create the tmp file<br> Assuming you are allowed to overwrite an existing file having the same name as your tmp file<br> Assuming it's ok to reset meta-data, like file owner, permissions, acls, creation timestamp, etc.<br> Assuming the performance regression due to fsync is ok (request was for atomic, not durable)<br> <p> <font class="QuotedText">&gt; fsync temp file (may require fsync of directory)</font><br> <p> How does one check that requirement in a portable way?<br> <p> <font class="QuotedText">&gt; if you want to be sure the change has taken place, fsync directory.</font><br> <p> <font class="QuotedText">&gt; no, this isn't "real code", but translating it into your language of choice is not that hard.</font><br> <p> But it's far from trivial either.<br> <p> <font class="QuotedText">&gt; There are a lot of programs out there that do this right today. </font><br> <p> But there are even more ones that don't. There's also no tool to detect these ones (AFAIK).<br> <p> <font class="QuotedText">&gt; lookup the lwn.net article on safely saving data from a few months back</font><br> <p> It also failed to address any of the assumptions / regressions.<br> </div> Mon, 05 Mar 2012 14:34:44 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/484990/ https://lwn.net/Articles/484990/ dlang <div class="FormattedComment"> doing an open, write, close on an existing file that is a hardlink may not be able to be atomic (depending on the size of the write, the hardware, etc) in any case.<br> <p> so I think that your requirement results in error O_PONY<br> <p> While something along the lines of what you are talking about may be able to be made to work in some more limited cases, arguing that it's a requirement because the temp-file approach doesn't work in all cases is a bad argument.<br> <p> In fact, in the cases where the file is a symlink or hardlink, it's questionable as to what the 'right' think to do is.<br> <p> In some cases you should follow the link and replace the 'master' file, but in other cases you should not. arguably, breaking the links is the safer thing to do (the system doesn't know what the effect of the changes are ot the other things accessing the file), but there's no question that sometimes you wish it did something different.<br> </div> Fri, 02 Mar 2012 23:33:09 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/484983/ https://lwn.net/Articles/484983/ mathstuf <div class="FormattedComment"> The problem is that if the target is a symlink or a hardlink, it gets clobbered by this process and the link is destroyed. Applications that I use that do this are harder to use with my dotfiles system because of it (finch, gnupg, and others as well). What needs to happen is that the target file has readlink() done to its path to get the *actual* file that is wanted before this process starts.<br> </div> Fri, 02 Mar 2012 22:18:29 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/484975/ https://lwn.net/Articles/484975/ dlang <div class="FormattedComment"> <font class="QuotedText">&gt;Could any of the fsync advocates post real code that does the atomic variant of open, write, close?</font><br> <font class="QuotedText">&gt; </font><br> <font class="QuotedText">&gt; Hint: it's not possible without tons of regressions.</font><br> <p> depending on how much you want to write, and what your definition of atomic is, what you are asking for may not be possible.<br> <p> it also depends on what you mean about 'tons of regressions'<br> <p> but what you can do is<br> <p> open temp file<br> write to temp file<br> close temp file<br> fsync temp file (may require fsync of directory)<br> mv temp file to name of real file<br> if you want to be sure the change has taken place, fsync directory.<br> <p> if you are doing this in a shell script, you have to do 'sync' instead of fsync (on ext3, the result is the same, on other filesystems fsync is significantly faster)<br> <p> no, this isn't "real code", but translating it into your language of choice is not that hard.<br> <p> There are a lot of programs out there that do this right today. Most mail, nntp, and database apps do this right because their users are unwilling to loose data, and they need to work across different flavors of Unix.<br> <p> for the longer answer, lookup the lwn.net article on safely saving data from a few months back<br> </div> Fri, 02 Mar 2012 21:29:37 +0000 XFS: the filesystem of the future? https://lwn.net/Articles/484709/ https://lwn.net/Articles/484709/ XTF <div class="FormattedComment"> Could any of the fsync advocates post real code that does the atomic variant of open, write, close?<br> <p> Hint: it's not possible without tons of regressions.<br> <p> Linux devs should really provide a proper solution (like O_ATOMIC) instead of blaming app devs for not doing the impossible.<br> </div> Thu, 01 Mar 2012 15:35:24 +0000 Shared pain https://lwn.net/Articles/481387/ https://lwn.net/Articles/481387/ nye <div class="FormattedComment"> <font class="QuotedText">&gt;when I have applications that loose config data after a problem happens (which isn't always a system crash, apps that have this sort of problem usually have it after the application crashes as well)</font><br> <p> That can't possibly be the case. You must be talking about applications which do something like truncate+rewrite, which is entirely orthogonal to the discussion (and is pretty clearly a bug).<br> <p> I suspect you haven't understood the issue at hand.<br> </div> Tue, 14 Feb 2012 16:16:59 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480951/ https://lwn.net/Articles/480951/ dlang <div class="FormattedComment"> yes, everything stored in git is compressed, but it only gets deltafied when it gets packed.<br> <p> and it's frequently faster to read a compressed file and uncompress it than it is to read the uncompressed equivalent (especially for highly compressible text like code or logs), I've done benchmarks on this within the last year or so<br> </div> Sun, 12 Feb 2012 18:29:02 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480927/ https://lwn.net/Articles/480927/ nix <div class="FormattedComment"> Actually, even the most recent stuff is compressed. It just might not be deltified in terms of other blobs (which is what you meant, I know).<br> </div> Sun, 12 Feb 2012 15:57:20 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480912/ https://lwn.net/Articles/480912/ Wol <div class="FormattedComment"> Okay, it would need a little bit of coding, but I'd do the following ...<br> <p> Each month, when you run end-of-month statements, you save that info. When you upate an account you keep a running total.<br> <p> If the system crashes you then do "set corruptaccout = true where last-month plus transactions-this-month does not equal running balance". At which point you can do a brute force integrity check on those accunts.<br> <p> (If I've got a 3rd state of that flag, undefined, I can even bring my database back on line immediately I've run a "set corruptaccount to undefined" command!)<br> <p> And in Pick, that query will FLY! If I've got a massive terabyte database that's crashed, it's quite likely going to take a couple of hours to reboot the OS (I just rebooted our server at work - 15-20 mins to come up including disk checks etc). What's another hour running an integrity check on the data? And I can bring my database back on line immediately that query (and others like it) have completed. Tough luck on the customer who's account has been locked ... but 99% of my customers can have normal service resume quickly.<br> <p> Thing is, I now *know* after a crash that my data is safe, I'm not trusting the database company and the hardware. And if my system is so much faster than yours, once the system is back I can clear the backlog faster than you can. Plus, even if ACID saves your data, I've got so much less data in flight and at risk.<br> <p> But this seems to be mirroring the other debate :-) the moan about "fsync and rename" was that fsync was guaranteeing (at major cost) far more than necessary. The programmer wanted consistency, but the only way he could get it was to use fsync, which charged a high price for durability. If I really need ACID I can use BEGIN/END TRANSACTION in Pick. But 99% of the time I don't need it, and can get 90% of its benefits with 10% of its cost, just by being careful about how I program. At the end of the day, Pick gives me moderate ACID pretty much by default. Why should I have to pay the (high) price for strong ACID when 90% of the time, it is of no benefit whatsoever? (And how many SQL programmers actually use BEGIN/END TRANSACTION, even when they should?)<br> <p> Cheers,<br> Wol<br> </div> Sun, 12 Feb 2012 13:38:16 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480755/ https://lwn.net/Articles/480755/ Cyberax <div class="FormattedComment"> git/svn/... use store intermediate versions of the source code, so that applying all patches becomes O(log N) instead of O(N). But that's just an optimization.<br> <p> NoSQL systems work in a similar way - they can store the 'tip' of the data, so that they don't have to reapply all the patches all the time. However, the latest data view can be rebuilt if required.<br> </div> Sat, 11 Feb 2012 13:44:15 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480736/ https://lwn.net/Articles/480736/ dlang <div class="FormattedComment"> what gives you reasonable performance for a version control system with a few updates per minute is nowhere close to being reasonable for something that measures it's transaction rate in thousands per second.<br> <p> besides, git tends to keep the most recent version of a file uncompressed, it's only when the files are combined into packs that things need to be reconstructed, and even there git only lets the chains get so long.<br> </div> Sat, 11 Feb 2012 05:48:49 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480721/ https://lwn.net/Articles/480721/ Cyberax <div class="FormattedComment"> Well, git works exactly the same way. Is it fast enough for you?<br> </div> Sat, 11 Feb 2012 02:30:36 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480659/ https://lwn.net/Articles/480659/ dlang <div class="FormattedComment"> so that means that you don't have any value anywhere in your database that says "this is the amount of money in account A", instead you have to search all transactions by all tellers to find out how much money is in account A<br> <p> that doesn't sound like a performance win to me.<br> </div> Fri, 10 Feb 2012 18:43:29 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480607/ https://lwn.net/Articles/480607/ Wol <div class="FormattedComment"> :-)<br> <p> Look at the comment you're replying to :-) In early Pick systems I believe it was possible for a single item to be larger than available memory ...<br> <p> Okay, it laid the original systems wide open to serious problems if something went wrong, but as far as users were concerned Pick systems didn't have disk. It was just "permanent memory". And Pick was designed to "store all its data in ram and treat the disk as a huge virtual memory". I believe they usually got round any problem by flushing changes from core to disk as fast as possible, so in a crash they could just restore state from disk.<br> <p> Cheers,<br> Wol<br> </div> Fri, 10 Feb 2012 16:25:25 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480586/ https://lwn.net/Articles/480586/ Wol <div class="FormattedComment"> The ever popular "subtract $10, add $10" ...<br> <p> Well, if you define the transaction as an entity, then it gets written to its own FILE. If the system crashes then you get a discrepancy that will show up in an audit. It makes sense to define it as an entity - it has its own "primary key" ie "time X at teller Y". Okay, you'll argue that I have to run an integrity check after a crash (true) while you don't, but I can probably integrity-check the entire database in the time it takes you to scan one big table :-)<br> <p> Consistency? Journalling a transaction? Easily done.<br> <p> And yes, your point about flushing buffers is good, but that really should be the OS's problem, not the app (database) sitting on top. Yes I know, I used the word *should* ...<br> <p> Look at it from an economic standpoint :-) If my database (on equivalent hardware) is ten times faster than yours, and I can run an integrity check after a crash without impinging on my users, and I can guarantee to repair my database in hours, which is the economic choice?<br> <p> Marketing 101 - proudly announce your weaknesses as a strength. The chances of a crash occuring at the "wrong moment" and corrupting your database are much higher with SQL, because any given task will typically require between 10s and 100s more transactions between the db and OS than Pick. So SQL needs ACID. With Pick, the chances of a crash happening at the wrong moment and corrupting data are much, much lower. So expensive strong ACID actually has a prohibitive cost. Especially if you can get 90% of the benefits for 10% of the effort.<br> <p> I'm not saying ACID isn't a good thing. It's just that the cost/benefit equation for Pick says strong ACID isn't worth it - because the benefits are just SO much less. (Like query optimisers. Pick doesn't have an optimiser because it's pretty much a dead cert the optimser will save less than it costs!)<br> <p> Cheers,<br> Wol<br> </div> Fri, 10 Feb 2012 16:17:28 +0000 Shared pain https://lwn.net/Articles/480415/ https://lwn.net/Articles/480415/ khim <blockquote><font class="QuotedText">so you don't _really_ want the computer doing exactly what the programmer tells it to, you only want it to do so some of the time, not the rest of the time.</font></blockquote> <p>Sure. YMMV as I've <a href="http://lwn.net/Articles/478147/">already noted</a>. Good filesystem for USB sticks must flush on close(2) call. Good general purpose filesystem must guarantee rename(2) atomicity in the face of system crash.</p> <p>You can use whatever you want for your own system - it's you choice. But when question is about replacement of extX… it's other thing entirely. To recommend filesystem which likes to eat user's data is simply irresponsible.</p> Thu, 09 Feb 2012 21:13:13 +0000 Shared pain https://lwn.net/Articles/480407/ https://lwn.net/Articles/480407/ dlang <div class="FormattedComment"> it is badly written because you did not tell the computer that you wanted to make sure that the data was written to the drive in a particular order.<br> <p> If the system does not crash, the view of the filesystem presented to the user is absolutely consistent, and the rename is atomic.<br> <p> The problem is that there are a lot of 'odd' situations that you can have where data is written to a file while it is being renamed that make it non-trivial to "do the right thing" because the system is having to guess at what the "right thing" is for this situation.<br> <p> try running a system with every filesystem mounted with the sync option, that will force the computer to do exactly what the application programmers told it to do, writing all data exactly when they tell it to, even if this means writing the same disk sector hundreds of times as small writes happen. The result will be un-usable.<br> <p> so you don't _really_ want the computer doing exactly what the programmer tells it to, you only want it to do so some of the time, not the rest of the time.<br> <p> </div> Thu, 09 Feb 2012 20:52:23 +0000 Shared pain https://lwn.net/Articles/480403/ https://lwn.net/Articles/480403/ Wol <div class="FormattedComment"> And what is "badly written" about an app that expects the computer to do what was asked of it?<br> <p> I know changing things around for the sake of it doesn't matter when everything goes right, but if I tell the computer "do this, *then* that, *followed* by the other", well, if I told an employee to do it and they did things in the wrong order and screwed things up as a *direct* *result* of messing with the order, they'd get the sack.<br> <p> The only reason we're in this mess, is because the computer is NOT doing what the programmer asked. It thinks it knows better. And it screws up as a result.<br> <p> And the fix isn't that hard - just make sure you flush the data before the metadata (or journal the data too), which is pretty much (a) sensible, and (b) what every user would want if they knew enough to care.<br> <p> Cheers,<br> Wol<br> </div> Thu, 09 Feb 2012 20:44:43 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480401/ https://lwn.net/Articles/480401/ dlang <div class="FormattedComment"> if a single item is larger than the track size of a drive, it is physically impossible for the write to be atomic. You don't need to get this large to run in to problems though, any write larger than a block runs the possibility of being split across different tracks (or in a RAID setup, across different drives). If you don't tell the filesystem that you care about this, the filesystem will write these blocks in whatever order is most efficient for it.<br> </div> Thu, 09 Feb 2012 20:38:47 +0000 The entire noSQL family of servers is based on relaxing the reliability constraints of the classic ACID protections that SQL databases provided. https://lwn.net/Articles/480398/ https://lwn.net/Articles/480398/ dlang <div class="FormattedComment"> atomic, your scheme won't work if you need to make changes to two records (the ever popular "subtract $10 from account A, add $10 to account B" example)<br> <p> consistency, what if part of your updates get to disk and other parts don't? what if the OS (or drive) re-orders your updates so that the write to the record for person happens before the write to building?<br> <p> As far as durability goes, if you don't tell the OS to flush it's buffers (which is what fsync does), then in a crash you have no idea what may have made it to disk and what didn't.<br> </div> Thu, 09 Feb 2012 20:36:38 +0000