Resolve "[daemon] Allow daemon restart without losing the file system state"

Current behavior: When the daemon is started a subdirectory within the rootdir is created with the name of its pid. Thus, when the server is restarted, it'll very likely get a different pid, no longer having access to the data of the previously run instance.

The reason for this behavior are that we need the ability to run multiple daemons on one node. This is beneficial when multiple network devices are present.

New behavior: A subdirectory is no longer created by default. Therefore, a server restart uses same directory for both data and metadata. Note, that the rootdir can be cleaned with the -c argument. For multiple daemons on one machine, the new argument --rootdir-suffix can be used which creates a subdirectory within the rootdir with a user-defined name. This also allows restarting multiple daemons on one node without losing data.

Note: The client assign an index for a remote daemon based on the order within the hostsfile. Depending on the order the daemons start, the order in the hostsfile changes, corrupting the file system state. Therefore, before attempting to access a remote daemon the client sorts the hostsfile entries so that the order in which the daemons are started remains irrelevant.

Closes #49 (closed)

Edited by Marc Vef

Merge request reports