TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

File consistency (2015)

127 点作者 navinsylvester大约 7 年前

8 条评论

josephg大约 7 年前
This entire situation is a barely contained disaster. Doing all the steps listed at the top of the article is not only exhausting and error prone, it also dramatically lowers write performance.<p>The most frustrating part is that (as I understand it) SSD and NVME hardware exposes strict read and write ordering to the OS anyway. That would allow file modification code to be written in a way thats both fast and correct. After all, these are the primitives we already know how to use for memory concurrency which enable fast lockless libraries like ConcurrencyKit. But for files, posix only exposes an inconsistently-implemented, coarse, heavyweight fsync() implementation. End users are forced to navigate weird, undocumented, imprecise hoops that are hard to understand, hard to test, and have poor performance just to do the one job the filesystem was supposed to have in the first place.<p>I&#x27;m curious how much better you could do by skipping the OS entirely and making a userspace disk API, similar to DPDK. If your database code stores data in a single data file anyway, you wouldn&#x27;t lose much by ditching the filesystem. (You would need specialised tools to do backups and figure out how much space you have free, but it might be worth it.)<p>I&#x27;ve been writing my own tiny implementation of Kafka recently. I was reading through Kafka&#x27;s design docs to figure out how they solved this problem. Kafka basically gives up on trusting the OS to store files safely. Instead they figure any fault tolerant kafka deployment will be a cluster of machines, so kafka stores all messages (+checksums) across all cluster instances. It hopes at least one of the machines in the cluster will survive without corruption when power goes out.
评论 #16714963 未加载
评论 #16716881 未加载
评论 #16715838 未加载
评论 #16714937 未加载
评论 #16717455 未加载
评论 #16715463 未加载
评论 #16716265 未加载
评论 #16716562 未加载
pletnes大约 7 年前
Looks to me like yet another reason to use sqlite instead of «flat files». E.g postgres seems like a many orders of magnitude increase in complexity.<p>Possibly related: We’ve been using hdf5 for a lot of data storage at work (raw image data). I often discover corrupt files, even though we (think we) are flushing files etc. I’d love to see some work on reliability there, but it’s hard to know if the article is relevant to those issues.<p>Also, what happens when you’re on RAID? Even more assumptions out the window I’d imagine?
评论 #16714979 未加载
evrydayhustling大约 7 年前
This was a cool read. I&#x27;d be interested in a perspective on how the increasing focus on distributed consistency is impacting design and research at this local consistency level. In particular, given the findings about frequency of errors, I wonder if there are guidelines for coordinating local filesystem settings along with distributed system settings to maximize performance at the distributed scale. Anybody out there doing this?
mjw1007大约 7 年前
In linux, renameat2() with RENAME_EXCHANGE on directories ought to be a very helpful primitive.<p>Does anyone know what the state of glibc support is? The last thing I saw was this thread: <a href="https:&#x2F;&#x2F;sourceware.org&#x2F;ml&#x2F;libc-alpha&#x2F;2015-11&#x2F;msg00459.html" rel="nofollow">https:&#x2F;&#x2F;sourceware.org&#x2F;ml&#x2F;libc-alpha&#x2F;2015-11&#x2F;msg00459.html</a>
评论 #16714971 未加载
dis-sys大约 7 年前
I am wondering what is the easy way to run tests for such file consistency issues say how the system react to power loss? Unplugging the power cable is not that automated for most people.
评论 #16719325 未加载
评论 #16718796 未加载
notduncansmith大约 7 年前
Are there no filesystems which address this issue? What challenges are involved? Does hardware support safe append-write filesystems? Why&#x2F;why not?
dang大约 7 年前
Discussed at the time: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10725859" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10725859</a>
zeveb大约 7 年前
It&#x27;s interesting that IBM&#x27;s JFS is so broken. Was the Linux version written by IBM, or is it a reimplementation by a third party?