Add chunk management notes to DESIGN.txt
This commit is contained in:
+39
-14
@@ -137,26 +137,51 @@ Chunk Management:
|
||||
servers need to forget some copies. If they are under-replicated,
|
||||
some chunk servers need to copy chunks from elsewhere.
|
||||
|
||||
Event 1: A chunk server connects
|
||||
If the chunk server is holding some chunks, for each chunk
|
||||
one of the following must be true:
|
||||
- The chunk is not used by the file system
|
||||
=> Mark the chunk for removal
|
||||
- The chunk is used and, with this copy, perfectly replicated
|
||||
=> Do nothing
|
||||
- The chunk is used and under-replicated
|
||||
=> ???
|
||||
- The chunk is used and over-replicated
|
||||
=> Mark the chunk for removal
|
||||
The metadata server holds an authoritative list of hashes that each
|
||||
chunk server needs to hold. These lists are enforced periodically and
|
||||
automatically during the state updates, therefore the metadata server
|
||||
only needs to reorganize the chunks in its in-memory lists. The changes
|
||||
will propagate over the chunk servers in time. The metadata server's
|
||||
in-memory representation is the ideal state the system is converging
|
||||
to, which means every chunk if always replicated correctly. Given this
|
||||
setup, a chunk can only be under-replicated when there are not enough
|
||||
chunk servers.
|
||||
|
||||
Event 2: A write operation on metadata (adding chunks)
|
||||
Case 1: The first chunk server connects with no chunks
|
||||
CS connects
|
||||
MS accepts
|
||||
CS sends auth message
|
||||
MS validates auth
|
||||
MS requests list of chunks
|
||||
CS sends the chunk list
|
||||
MS notices it's empty
|
||||
|
||||
Case 2: The first chunk server connects with some chunks
|
||||
CS connects
|
||||
MS accepts
|
||||
CS sends auth message
|
||||
MS valudates auth
|
||||
MS requests list of chunks
|
||||
CS sends the chunk list
|
||||
MS iterates over each chunk. For each chunk it determines
|
||||
whether it's useless, under-replicated, over-replicated,
|
||||
or properly replicated.
|
||||
MS adds all useless or over-replicated chunks to the rem_list
|
||||
of the newly connected chunk server. Note that it's only
|
||||
possible for a chunk to be over-replicated by 1, so removing
|
||||
it from the new chunk server will fix the issue.
|
||||
MS If a chunk is under-replicated, it means that there are not
|
||||
enough chunk servers to hold all the replicas, so there is
|
||||
nothing to be done.
|
||||
|
||||
Case 3: Chunk server with some chunks disconnects
|
||||
TODO
|
||||
|
||||
Event 3: A chunk server disconnects
|
||||
A number of chunks are lost, but there is a chance the server will come back
|
||||
in a short while (10s or so).
|
||||
|
||||
TODO
|
||||
=> Wait for about 10s. If the chunk server doesn't come back, distribute
|
||||
its hashes to other chunk servers
|
||||
|
||||
Event 4: A write operation on metadata occurs (overwriting old chunks)
|
||||
Assuming the write overwrites some chunks:
|
||||
|
||||
Reference in New Issue
Block a user