Changeset 211dc60 in trunk
- Timestamp:
- 2017-06-05T22:26:46Z (8 years ago)
- Branches:
- master
- Children:
- adb9a98
- Parents:
- 17cff7a
- git-author:
- Brian Warner <warner@…> (2016-11-15 00:24:26)
- git-committer:
- meejah <meejah@…> (2017-06-05 22:26:46)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified docs/specifications/servers-of-happiness.rst ¶
r17cff7a r211dc60 109 109 We calculate share placement like so: 110 110 111 1. Query 2n servers for existing shares.111 0. Start with an ordered list of servers. Maybe *2N* of them. 112 112 113 2. Construct a bipartite graph of readonly servers to shares, where an edge 114 exists between an arbitrary readonly server s and an arbitrary share n if and only if s 115 holds n. 113 1. Query all servers for existing shares. 116 114 117 3. Calculate the maximum matching graph of the bipartite graph. The maxmum matching 118 is the matching which contains the largest possible number of edges. 115 2. Construct a bipartite graph G1 of *readonly* servers to pre-existing 116 shares, where an edge exists between an arbitrary readonly server S and an 117 arbitrary share T if and only if S currently holds T. 119 118 120 4. Construct a bipartite graph of servers to shares, removing any servers and 121 shares used in the maximum matching graph from step 3. Let an edge exist between 122 server s and share n if and only if s holds n. 119 3. Calculate a maximum matching graph of G1 (a set of S->T edges that has or 120 is-tied-for the highest "happiness score"). There is a clever efficient 121 algorithm for this, named "Ford-Fulkerson". There may be more than one 122 maximum matching for this graph; we choose one of them arbitrarily, but 123 prefer earlier servers. Call this particular placement M1. The placement 124 maps shares to servers, where each share appears at most once, and each 125 server appears at most once. 123 126 124 5. Calculate the maximum matching graph of the new graph. 127 4. Construct a bipartite graph G2 of readwrite servers to pre-existing 128 shares. Then remove any edge (from G2) that uses a server or a share found 129 in M1. Let an edge exist between server S and share T if and only if S 130 already holds T. 125 131 126 6. Construct a bipartite graph of servers to share, removing any servers and 127 shares used in the maximum matching graphs from steps 3 and 5. Let an edge exist 128 between server s and share n if and only if s can hold n. 132 5. Calculate a maximum matching graph of G2, call this M2, again preferring 133 earlier servers. 129 134 130 7. Calculate the maximum matching graph of the new graph. 135 6. Construct a bipartite graph G3 of (only readwrite) servers to shares. Let 136 an edge exist between server S and share T if and only if S already has T, 137 or *could* hold T (i.e. S has enough available space to hold a share of at 138 least T's size). Then remove (from G3) any servers and shares used in M1 139 or M2 (note that we retain servers/shares that were in G1/G2 but *not* in 140 the M1/M2 subsets) 131 141 132 8. Renew the shares on their respective servers from steps 3 133 and 5.142 7. Calculate a maximum matching graph of G3, call this M3, preferring earlier 143 servers. The final placement table is the union of M1+M2+M3. 134 144 135 9. Place share n on server s if an edge exists between s and n in the 136 maximum matching graph from step 7. 145 8. Renew the shares on their respective servers from M1 and M2. 137 146 138 10. If any placements from step 7 fail, remove the server from the set of possible 139 servers and regenerate the matchings. 147 9. Upload share T to server S if an edge exists between S and T in M3. 140 148 149 10. If any placements from step 9 fail, mark the server as read-only. Go back 150 to step 2 (since we may discover a server is/has-become read-only, or has 151 failed, during step 9). 152 153 Rationale (Step 4): when we see pre-existing shares on read-only servers, we 154 prefer to rely upon those (rather than the ones on read-write servers), so we 155 can maybe use the read-write servers for new shares. If we picked the 156 read-write server's share, then we couldn't re-use that server for new ones 157 (we only rely upon each server for one share, more or less). 141 158 142 159 Properties of Upload Strategy of Happiness
Note: See TracChangeset
for help on using the changeset viewer.