diff --git a/f5lbaasdriver/v2/bigip/driver_v2.py b/f5lbaasdriver/v2/bigip/driver_v2.py index 1b00f8c34..77a527684 100644 --- a/f5lbaasdriver/v2/bigip/driver_v2.py +++ b/f5lbaasdriver/v2/bigip/driver_v2.py @@ -47,6 +47,12 @@ default=0, help=('switch driver performance mode from 0 to 3') ), + cfg.BoolOpt( + 'fetch_fresh_db_members', + default=True, + help=('If True, fetch fresh members from db in _get_members,' + 'if set to False, skip the fetch') + ), cfg.StrOpt( 'f5_loadbalancer_pool_scheduler_driver_v2', default=( diff --git a/f5lbaasdriver/v2/bigip/service_builder.py b/f5lbaasdriver/v2/bigip/service_builder.py index 3ec15e132..4606289a8 100644 --- a/f5lbaasdriver/v2/bigip/service_builder.py +++ b/f5lbaasdriver/v2/bigip/service_builder.py @@ -620,7 +620,9 @@ def _get_members(self, context, loadbalancer, pools, pool_members = [] def get_db_members(): - if cfg.CONF.f5_driver_perf_mode in (1, 3): + if cfg.CONF.f5_driver_perf_mode in (1, 3) \ + and not cfg.CONF.fetch_fresh_db_members: + LOG.debug('inside this logic') members = [] for p1 in loadbalancer.pools: for p2 in pools: @@ -632,6 +634,7 @@ def get_db_members(): LOG.info(members) return members else: + LOG.debug('getting the db members') return self.plugin.db.get_pool_members( context, filters={'pool_id': [p['id'] for p in pools]}