存储系统如何在同一位置处理不同的写入流?
通常,如果两个应用程序向磁盘的同一位置(lba)发送两个写请求,应用程序或文件系统会为其添加锁,因此一次只会处理一个请求。
但现在有一个难题。可能有多个写入请求应该写入同一个位置,但应用程序不处理锁。没有文件系统,因为数据直接写入原始磁盘。我能做的就是修改存储系统的代码。现在事情非常复杂。假设有两个请求,A和B,那么最终对应的lba中的数据可能是以下三种结果之一:
- 全部数据来自A。全部
- 数据来自B。
- 部分数据来自A;部分数据来自A。部分数据来自B。
在我看来,结果1& 2 可以接受,但结果 3 不可以接受。但有人不这么认为。你的意见又如何呢?
Normally, if two applications send two write requests to the same place (lba) of the disk, applications or file systems will add lock for it, so only one request will be handled at a time.
But now there is a difficult problem. There may be multiple write requests that should be written to the same place, but applications don't handle the lock. There is no file system, because the data are directly written to the raw disk. What I can do is to modify the code of the storage system. Things are very complicated now. Suppose there are two requests, A and B. Then finally the data in the corresponding lba may be one of the three results:
- All data are from A.
- All data are from B.
- Parts of data are from A; parts of data are from B.
In my opinion, result 1 & 2 are acceptable, but result 3 is not acceptable. But someone doesn't think so. How about you opinions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我同意它应该是全部之一或两者都不是。通过使用某种形式的存储系统管理器并以足够大的块写入管理器,可以很容易地完成此操作。管理器可以在内部进行适当的锁定,以便一次只写入一个请求的一个块,并且不会出现重叠。
I agree that it should be all of one or none of either. This can be done quite easily by using a form of storage system manager, and writing to the manager in large enough chunks. The manager can do appropriate locking internally so that only one block from one request is written at a time, and you don't get overlaps.