GFS
GFS
FILE SYSTEM
S. Ghemawat, H. Gobioff, and S.‐T. Leung.
SOSP 2003
An unusual environment
Component failures are the norm, not the exception
Scale and component quality
Record appends
Allow multiple clients to concurrently append data
Producer-consumer queues
GFS clusters
GFS Cluster
A master
Multiple chunkservers
Concurrently accessed by many clients
Chunkserver
Master Chunkserver
Chunkserver
The files
Files are divided into fixed-size chunks of 64MB
Similar to clusters or sectors in other file systems
Each chunk has a unique 64-bit label
Assigned by the master node at time of creation
GFS maintain logical mappings of files to constituent chunks
Chunks are replicated
At least three times
More for critical or heavily used files
Architecture
The master server (I)
Single master server
Stores chunk-related metadata
Tables mapping the 64-bit labels to chunk locations
The files they make up
Locations of chunk replicas
What processes are reading or writing to a particular chunk, or
taking a snapshot of it
The master server (II)
Communicates with its chunkservers through
heartbeat messages
Also controls
Lease management
Garbage collection of orphaned chunks
Chunk migration between chunk servers
Simplest solution
Operation log
Contains historical record of critical metadata changes
Acts a logical time line for the order of all concurrent operations
Replicated on multiple remote machines
Using blocking writes, both locally and remotely
Consistency model
All file namespace mutations are atomic
Handled exclusively by the master
Status of a file region can be
Consistent: all clients see the same data
Defined: all clients see the same data, which include the
entirety of the last mutation
Undefined but consistent: all clients see then same data but it
may not reflect what any one mutation has written
Inconsistent
Data mutations
Writes:
Cause data to be written at a specific offset
Record appends:
Cause data to be automatically appended at least once at an
offset of GFS choosing
Consistency is ensured by
Applying mutations to a chunk in the same order
Using chunk version numbers
Dealing with stale chunk locations
Not covered
Numbers refer to
the steps in the
two previous slides
Mutations (I)
1. Client requests a lease from master server :
2. Master server grants update permission to a client for a finite
period of time (60 seconds)
3. Client pushes data to all the replicas
Data end in internal LRU buffer cache of each chunkserver
taken
Implementation
As a user-level library
Easiest solution
Performance
Performance
When used with relatively small number of servers (15),
GFS achieves
Reading performance comparable to that of a single disk
(80–100 MB/s)
Reduced write performance (30 MB/s)
existing files
Performance
Read rate increases significantly with the number of chunk
servers
583 MB/s for 342 nodes