zoukankan      html  css  js  c++  java
  • 《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

  • 相关阅读:
    基于Karma和Jasmine的angular自动化单元测试
    【转】使用SVG中的Symbol元素制作Icon
    【转】整理分析:Before 和 :After及其实例
    【转载】CSS中强大的EM
    【转】提升说服力!UI设计的心理学
    解决IE8不支持数组的indexOf方法
    KISSY Slide 组件应用遇到的一个放大缩小问题
    jQuery.extend 函数详解(转载)
    事件冒泡分析及return false、preventDefault、stopPropagation的区别
    jquery学习(一)-选择器
  • 原文地址:https://www.cnblogs.com/linghuaichong/p/4097777.html
Copyright © 2011-2022 走看看