Next: , Previous: , Up: Client   [Contents][Index]

#### 5.3.3 serv

The Serv process maintains the integrity of the meta-data files. Moreover, it manage a perennial score on every archives. For bellow computation, values and parameters are read from the ~mdtx/md5sums/mdtx-COLL.md5 (see mdtxCOLL.md5) file.

• A local image’s score is updated into /etc/mediatex/mdtx-COLL/servers.txt (see servers.txt) by each servers. It is computed by summing the local support’s scores computed by supp (see supp).

imageScore(x) = \min {(\sum_{i=1}^N supportScore(x_i) , M)}

When there are many local supports burned from the same image, this sum may be greater than the maximum score (maxScore), so we truncate it.

Notice: if the server’s lastCommit value is outdated compared to the current date added to serverTTL parameter, the image’s score if set to 0 for this server as server is supposed crashed.

• The server score equals the worst local image’s score on the server.

serverScore(x) = \min_{i=1..N} imageScore(x_i)

• An archive score is computed from all local and remote images:

archiveScore(x) = \min {({\sum_{i=1}^N imageScore(x_i) \over d}, M)}

where: (default value)

d = 2

is the minimum number of geographical duplication required (minGeoDup)

M = 10.00

is the maximum score (maxScore)

When there are more image geographically duplicated than required, this sum may be greater than the maximum score, so we truncate it.

Next, archive’s scores are computed recursively:

• using \max when archive is provided by several containers,
• or using \min when archive comes from combined containers (CAT or RAR).
• Finally, the global collection score equals to the worst archive score.
collectionScore = \min_{i=1..N} archiveScore(x_i)

However, new uploaded archives (since uploadTTL) that still have a bad score (< {M \over 2}) are not taken into account for this global score.

Process conceptual model:

• Events in
$mediatex add key file to coll coll $ mediatex del key fingerprint from coll coll
\$ mediatex upgrade[+] [coll coll]

from PUBLISHER (see Who): manage collection settings.

upgrade()

from conf (see conf): upgrade the meta-data.

• Processing
• The upgrade processing is automatically raised when needed. However it permit to force an upgrade now, which may be useful when modifying manually the configuration files.
• Adding a key will add a server entry into the /etc/mediatex/mdtx-COLL/servers.txt file and so, allow connections (subscription, synchronisations, copies) from a new remote server to this collection directory on every servers already added.
• Data in/out
• Data out
/etc/mediatex/mdtx-COLL/servers.txt (see servers.txt)
~mdtx-COLL/.ssh/authorized_keys
~mdtx-COLL/.ssh/known_host
~mdtx-COLL/.ssh/config

Examples:

• Join an already existing collection: see Scenario 5.
• Synchronise servers together via upgrade query: see Scenario 4.

Code:

src/common/ssh.c
src/common/extractScore.c
src/client/serv.c

Next: , Previous: , Up: Client   [Contents][Index]