Teams and SS mappings - jzhou77/foundationdb GitHub Wiki
\xff key space is system key space. Part of it is txnStateStore, also stored on TLogs.
// A map from teamId to list of storage servers in that team.
extern const KeyRef storageTeamIdKeyPrefix;
// A map from storage server ID to list of teams associated with that SS.
// The first team in the list is that storage server's own team, i.e., no
// other storage servers are in that team.
extern const KeyRef storageServerToTeamIdKeyPrefix;
Master assignes seed storage servers to unique teams in sendInitialCommitToResolvers. Key is storageServerToTeamIdKey(ss), value is encodeStorageServerToTeamIdValue({ teamId }) in txnStateStore, which is broadcast to all commit proxies.
Commit proxy receives TxnStateRequest broadcast, and populates commitData.ssToStorageTeam map, i.e., the map of SS's own team.
applyMetadataMutations() does several things:
- Generate private mutations for specific or all storage servers, e.g.,
serverKeysorserverTagsmutations. - Update
txnStateStoreso that all proxies have the exact the same copy
Each SS's own team: typical mapping is ptxn::StorageTeamID team(tag.locality, tag.id);