Revision b0159850 doc/design-daemons.rst
b/doc/design-daemons.rst | ||
---|---|---|
346 | 346 |
The new configuration management protocol will be implemented in the following |
347 | 347 |
steps: |
348 | 348 |
|
349 |
#. Reimplement all current methods of ``ConfigWriter`` for reading and writing |
|
350 |
the configuration of a cluster in WConfD. |
|
351 |
#. Expose each of those functions in WConfD as a RPC function. This will allow |
|
352 |
easy future extensions or modifications. |
|
353 |
#. Replace ``ConfigWriter`` with a stub (preferably automatically generated |
|
354 |
from the Haskell code) that will contain the same methods as the current |
|
355 |
``ConfigWriter`` and delegate all calls to its methods to WConfD. |
|
356 |
|
|
357 |
After this step it'll be possible access the configuration from separate |
|
358 |
processes. |
|
349 |
Step 1: |
|
350 |
#. Implement the following functions in WConfD and export them through |
|
351 |
RPC: |
|
352 |
|
|
353 |
- Obtain a single internal lock, either in shared or |
|
354 |
exclusive mode. This lock will substitute the current lock |
|
355 |
``_config_lock`` in config.py. |
|
356 |
- Release the lock. |
|
357 |
- Return the whole configuration data to a client. |
|
358 |
- Receive the whole configuration data from a client and replace the |
|
359 |
current configuration with it. Distribute it to master candidates |
|
360 |
and distribute the corresponding *ssconf*. |
|
361 |
|
|
362 |
WConfD must detect deaths of its clients (see `Job death |
|
363 |
detection`_) and release locks automatically. |
|
364 |
|
|
365 |
#. In config.py modify public methods that access configuration: |
|
366 |
|
|
367 |
- Instead of acquiring a local lock, obtain a lock from WConfD |
|
368 |
using the above functions |
|
369 |
- Fetch the current configuration from WConfD. |
|
370 |
- Use it to perform the method's task. |
|
371 |
- If the configuration was modified, send it to WConfD at the end. |
|
372 |
- Release the lock to WConfD. |
|
373 |
|
|
374 |
This will decouple the configuration management from the master daemon, |
|
375 |
even though the specific configuration tasks will still performed by |
|
376 |
individual jobs. |
|
377 |
|
|
378 |
After this step it'll be possible access the configuration from separate |
|
379 |
processes. |
|
380 |
|
|
381 |
Step 2: |
|
382 |
#. Reimplement all current methods of ``ConfigWriter`` for reading and |
|
383 |
writing the configuration of a cluster in WConfD. |
|
384 |
#. Expose each of those functions in WConfD as a separate RPC function. |
|
385 |
This will allow easy future extensions or modifications. |
|
386 |
#. Replace ``ConfigWriter`` with a stub (preferably automatically |
|
387 |
generated from the Haskell code) that will contain the same methods |
|
388 |
as the current ``ConfigWriter`` and delegate all calls to its |
|
389 |
methods to WConfD. |
|
390 |
|
|
391 |
Step 3: |
|
392 |
#. Remove WConfD's RPC functions for obtaining/releasing the single |
|
393 |
internal lock from Step 1. |
|
394 |
#. Remove WConfD's RPC functions for sending/receiving the whole |
|
395 |
configuration from Step 1. |
|
359 | 396 |
|
360 | 397 |
Future aims: |
361 | 398 |
|
Also available in: Unified diff