Project

General

Profile

Actions

Cleanup #38717

open

mgr: remove duplicate Active-Standby code in C++ mgr and Python mgr_module.py

Added by Ernesto Puerta about 5 years ago. Updated about 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
ceph-mgr
Target version:
-
% Done:

0%

Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Currently both Ceph-mgr and mgr_module.py have a notable amount of duplicate code for implementing the API both in Active and Stand-by instances. The overhead of keeping 2 implementations aligned has already led to some oversights (e.g.: {get,set}_module_option() interface is different in both Active and Standby modules, and both at C++ and Python sides).

Given both C++ and Python support multiple inheritance, a suggestion could be to take a mixin approach:
  • In Python: OptionMixin base class providing {get,set}_module_option implementations, where high level option handling is performed, and falling back then to their corresponding C++ calls.
  • In C++: a similar approach is possible.

If more methods can be moved out of the Active-Standby specific logic, a CommonBaseMgr could be used instead.

This should also help keep Ceph-mgr API docs updated (currently they do not reflect the latest Ceph-mgr module API).

Actions #1

Updated by Ernesto Puerta about 5 years ago

  • Tracker changed from Bug to Cleanup
Actions

Also available in: Atom PDF