Motr  M0
Configuration Service (confd)

XXX FIXME: confd documentation is outdated.

Configuration service (confd) is designed to work as a part of user-space configuration service, driven by request handler and provides a "FOP-based" interface for accessing Motr configuration information stored in configuration db. Confd is run within the context of a request handler.

Confd pre-loads configuration values fetched from configuration db in memory-based data cache to speed up confc requests.


Data Structures

  • m0_confd — represents configuration service instance registered in request handler, stores structures to perform caching, accesses to configuration db and handles configuration data requests.
  • m0_confd_cache – represents an efficient, high concurrency, in-memory cache over the underlying database.

    Members:

  • m0_confd_cache::ca_db is a database environment to access configuration db.
  • m0_confd_cache::ca_cache is a registry of cached configuration objects.

Confd receives multiple configuration requests from confcs. Each request is a FOP containing a "path" of a requested configuration value to be retrieved from the configuration db. Confcs and confds use RPC layer as a transport to send FOPs.

The following FOPs are defined for confd (see conf/onwire.h):


Subroutines

Initialization and termination

Confd is initiated and put into operation by request handler logic, after motr is started. Confd service should be registered in request handler with m0_confd_register() call, where it has to initialise own data structures and FOPs used for communication.

Initial configuration database is manually created prior to startup. Confd assumes that:

  • configuration db is created before confd started;
  • the schema of configuration database conforms to the expected schema.

The following errors may occur while using the configuration db:

  • db is empty or is in an unrecognized format;
  • db schema does not conform to HLD of Motr’s configuration database schema : For documentation links, please refer to this file : doc/motr-design-doc-list.rst

While initialization process, confd has to preload internal cache of configuration objects with their configuration values. It loads entire configuration db into memory-based structures. Pre-loading details can be found in Logical Specification.

Initialised confd may be eventually terminated by m0_confd_unregister() in which confd has to finalise own data structures and FOPs.

After a confd instance is started it manages configuration database, its own internal cache structures and incoming FOP-requests.

Command Usage

To configure confd from console, standard options described in Motr Setup in cs_help() function are used.


Recipes

Typical interaction between confc and confd

Client sends a m0_conf_fetch FOP request to confd;

Configuration service processes confc requests in m0_fom_ops::fo_tick() function of m0_conf_fetch FOP request and sends m0_conf_fetch_resp FOP back.

See also
Configuration Service (confd)