Skip to content

Commit

Permalink
add another switch to control
Browse files Browse the repository at this point in the history
if getting db members or not. Need to set to
True if SY does not modify at last.
  • Loading branch information
Niklaus-xie committed Nov 13, 2020
1 parent a04e5b7 commit 7124133
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions f5lbaasdriver/v2/bigip/driver_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand Down
5 changes: 4 additions & 1 deletion f5lbaasdriver/v2/bigip/service_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]}
Expand Down

0 comments on commit 7124133

Please sign in to comment.