《Google File System》阅读总结

goals and assumptions

Google file system shares the same goals as previous distributed file systems:

  1. scalability

  2. performance

  3. reliability

  4. availability

However, it has special assumptions about application workloads and technological environment:

  1. Component fails are the normal other than the exception.

    system bugs, application bugs, user operation errors, hardware failures etc.

  2. Files are huge by traditional standards.

  3. File append operations are the most frequence operation.

arch overview

Master keeps all the meta data of the file system, while all the files are stored in chunk servers.

All the heavy operations(read, write, append) are performed directly between chunk servers and clients. Each chunk server serves some replicas of file system, thus pressures are balanced across the chunk server group(the key secret for building high-performance systems).

master

  data structure

  garbage collection

  Look at the above 2nd picture(GFS file system namespace), where there‘s a "delete timestamp". When a file/folder is deleted, gfs records the timestamp. Master‘s background‘s gc process will scan, discover and remove these files/folders, and all the related meta data(chunk handles, chunk locations).

  operation log and check point

  All the mutations on the file system are ensured sequenced(syncronized, no concurrent mutation) by master. The mutations are recorded into operation log. When master restarts, operation logs are used to rebuild the file system meta data. Check points are "snap shots" of meta data structures; it‘s used for building metas quickly, as operation logs can become quite large.

chunk server

  data structure

read

write

  mutation order

Look at above diagram, step 6 "send write order". When multiple clients write to a file concurrently(step 1~5), the primary chunk server decides a mutation order. It performs these mutations according to this order, then sends it to all other replica servers.

  normal mutation fail

If write failed on one replica, the whole write operation is considered failed(although others are successful). Write will be retried on all replicas. Because applying the same mutation on the same replica more than once will not produce a diffrent replica, so the retry operation will not affect the successful replicas.

  record append fail

check-sum

Disk data may be corrupted for various reasons. Gfs uses check-sums to check data integrity. As we can see from the chunk server data structure diagram, a chunk server stores check-sums of replica‘s blocks. During read/write/append operations, check-sums are compared to detect data corruption.

When data corruption is raised, the corrupted replica will be discarded. Master will re-replicate to ensure enough replicas.

replica balance

Pressure distribution is key to high performance. So replica balance is very important. Master should have a topology graph of all its chunk servers and do replica balancing across machines, racks, swithces and diffrent network regions.

snap shot

stale replica

时间: 2024-08-28 15:53:04

《Google File System》阅读总结的相关文章

微信小程序(5)--阅读器

最近用微信小程序写了一个图书阅读器,可以实现左右滑动翻页,按钮翻页,上下滚动,切换背景,控制字体大小.以及记住设置好的状态,如页面再次进来保留上次的背景色和字体大小. 由于暂时没有真实的数据接口,所以我用了静态数据. <!-- 文本 --> <view class="container" style="background:{{bodyColor}}"> <!-- 中间层,点击,头部底部显示 --> <view class=

阅读笔记二2017.1.27

之前看了前三章对软件工程有了大致认识,对个人开发的流程及软件工程师的成长过程有了比以前更清晰的了解. 这一周重点阅读了第四章,本章讲了两人合作的前提是代码要规范(包括代码风格规范及代码设计规范)及代码复审,然后才能结对开发. 大学一年交了很多代码作业,但质量仅仅是完成了而已,对于缩进.行宽.括号.与大括号.分行等都没太注意过,觉着有了结果就好了.而对于命名更是越短越好,过后也就知道写过的代码是什么意思了.以前,写代码时,很多时候是上手就写,一个大括号包含所有内容,虽然大一时学过函数.类等知识,

如何阅读源代码(7)

第七章: 编码规范和约定 +++++++++++++++++++ 137.了解了给定代码库所遵循的文件组织方式后, 就能更有效率地浏览它的源代码. 138.阅读代码时, 首先要确保您的编辑器或优美打印程序的tab设置, 与代码遵循的风格规范一致. 139.可以使用代码块的缩进, 快速地掌握代码的总体结构. 140.对编排不一致的代码, 应该立即给予足够的警惕. 141.分析代码时, 对标记为XXX, FIXME和TODO的代码序列要格外注意: 错误可能就潜伏在其中. 142.常量使用大写字母命名

第一篇阅读笔记

编写有效用例,首先要清楚用例是什么.用例是代表系统中各个项目相关人员之间就系统的行为所达成的契约,描述了在不同条件下,系统对某一项目相关人员的请求所做出的响应.一个好的用例很容易阅读,但是要写出一个好的用例很不容易.而且用例不是要写的多正式.完整.漂亮,而是尽可能得充分,就足够了.还有在书写用例之前最好弄清楚客户真正需求是什么?是安全,还是使用等,弄清楚客户的真正的需求有助于自己尽可能的写出满足客户并且足够充分的用例,还能增加客户对你的信任感.我一直认为信任感是与他人沟通最重要的.  用例编写的

利用python进行数据分析--(阅读笔记一)

以此记录阅读和学习<利用Python进行数据分析>这本书中的觉得重要的点! 第一章:准备工作 1.一组新闻文章可以被处理为一张词频表,这张词频表可以用于情感分析. 2.大多数软件是由两部分代码组成:少量需要占用大部分执行时间的代码,以及大量不经常执行的“粘合剂代码”. cython已经成为python领域中创建编译型扩展以及对接c/c++代码的一大途径. 3.在那些要求延迟性非常小的应用程序中(例如高频交易系统),为了尽最大可能地优化性能,耗费时间使用诸如C++这样更低级.更低生产率的语言进行

Adobe阅读器漏洞(adobe_cooltype_sing)学习研究

实验环境:Kali 2.0+Windows XP sp3+Adobe Reader 9.0.0 类别:缓冲区溢出 描述:这个漏洞针对Adobe阅读器9.3.4之前的版本,一个名为SING表对象中一个名为uniqueName的参数造成缓冲区溢出. 参考资料:<Metasploit魔鬼训练营>p286-p298 Adobe漏洞渗透过程: kali上使用windows/fileformat/adobe_cooltype_sing,载荷为windows/meterpreter/reverse_http

《构建之法阅读笔记02》

这次主要对<构建之法>的第四章“两人合作”作一次阅读笔记. 首先是代码规范问题. 我过去对于代码规范问题并没有做到注意.在编程中,许多变量和函数的命名都非常的简单而没有实际的意义.而且编程时不注意对齐缩进.很多时候也不加注释,导致对这些简单的变量名称不熟悉. 这样做会使得很多人读代码费劲,甚至是自己都要花时间再次阅读懂自己的代码.而且很多没必要的注释也会使得注释失去意义.当自己再次在原基础上编程时,可能要重新编程等问题. 因此,通过阅读“代码规范”,我找到一些解决方法.代码的风格要简明.易读.

《编写有效用例》阅读笔记之二

基 于数据库操作的小用力称为CRUD用例,每个小用例都表达了单独需求,在处理这种用例是会有两种不同的方法,可以将其分离或者先使用单个管理实体用例对其 处理.在提取系统用例时或有许多用例大致相同,对此可能会建立一种通用搜索机.用例每个目标步骤的命名类似于编程语言中的子过程调用,而且用例是有人而不 是计算机使用.搜索任何东西都会有相同的步骤,对此为了方便操作我们可以建立一个参数化用例,为每个用例起一个别名.然后将别名数据值划分为三个不同的精 度级别,可以在一定程度上简化用例描述. 当对业务过程进行建

《代码阅读方法与实践》阅读笔记之二

时间过得真快,一转眼,10天就过去了,感觉上次写阅读笔记的场景仿佛还历历在目.<代码阅读方法与实践>这本书真的很难写笔记,本来我看这本书的名字还以为书里大概写的都是些代码阅读的简易方法,心想着这就好写笔记了,没想到竟然好多都是我们之前学过的东西,这倒让我有点无从下手了.大概像我们这些还没有太多经历的大学生,总是习惯于尽量避免自己的工作量,总是试图找到一些完成事情的捷径吧.总之,尽管我不想承认,但我自己心里很清楚,我就是这种人.下面开始言归正传,说说接下来的几章内容归纳. 这本书在前面已经分析了

C# DataGridView 对指定行文字加粗实现阅读标记

在使用DataGridView控件放置通知等信息时,会遇到标记"已读"."未读"的问题.通过SQL语句查询出的结果中,"已读"."未读"会被放在一个专门的字段(DataGridView的列)中用来标记这个 条目的阅读情况.本文的目标就是要做到在显示上区分当前用户已读和未读的条目. 1.准备工作 建立一个C#窗体应用程序,里面放置一个Dock属性设置为Full的DataGridView 2.程序代码 在Load函数中,模拟生成了