Retry lvm volume and volume group query
We observed that the vgs and lvs queries the our lvm driver uses can intermittently fail with error code 11 (EAGAIN). So this patch enabled the retry in oslo_concurrency.processutils for these calls. Change-Id: I93da6cb1675d77bcdcd1075641dea9e2afc0ee1a Closes-Bug: #1931710
This commit is contained in:
parent
052cf96358
commit
e59fc77c3d
@ -57,14 +57,21 @@ def lvcreate(size, lv, vg, preallocated=None):
|
||||
|
||||
@nova.privsep.sys_admin_pctxt.entrypoint
|
||||
def vginfo(vg):
|
||||
return processutils.execute('vgs', '--noheadings', '--nosuffix',
|
||||
'--separator', '|', '--units', 'b',
|
||||
'-o', 'vg_size,vg_free', vg)
|
||||
# NOTE(gibi): We see intermittent faults querying volume groups failing
|
||||
# with error code -11, hence the retry. See bug 1931710
|
||||
return processutils.execute(
|
||||
'vgs', '--noheadings', '--nosuffix',
|
||||
'--separator', '|', '--units', 'b',
|
||||
'-o', 'vg_size,vg_free', vg,
|
||||
attempts=3, delay_on_retry=True,
|
||||
)
|
||||
|
||||
|
||||
@nova.privsep.sys_admin_pctxt.entrypoint
|
||||
def lvlist(vg):
|
||||
return processutils.execute('lvs', '--noheadings', '-o', 'lv_name', vg)
|
||||
return processutils.execute(
|
||||
'lvs', '--noheadings', '-o', 'lv_name', vg,
|
||||
attempts=3, delay_on_retry=True)
|
||||
|
||||
|
||||
@nova.privsep.sys_admin_pctxt.entrypoint
|
||||
|
@ -65,13 +65,15 @@ class PrivsepFilesystemHelpersTestCase(test.NoDBTestCase):
|
||||
nova.privsep.fs.vginfo('vg')
|
||||
mock_execute.assert_called_with('vgs', '--noheadings', '--nosuffix',
|
||||
'--separator', '|', '--units', 'b',
|
||||
'-o', 'vg_size,vg_free', 'vg')
|
||||
'-o', 'vg_size,vg_free', 'vg',
|
||||
attempts=3, delay_on_retry=True)
|
||||
|
||||
@mock.patch('oslo_concurrency.processutils.execute')
|
||||
def test_lvlist(self, mock_execute):
|
||||
nova.privsep.fs.lvlist('vg')
|
||||
mock_execute.assert_called_with('lvs', '--noheadings', '-o',
|
||||
'lv_name', 'vg')
|
||||
'lv_name', 'vg',
|
||||
attempts=3, delay_on_retry=True)
|
||||
|
||||
@mock.patch('oslo_concurrency.processutils.execute')
|
||||
def test_lvinfo(self, mock_execute):
|
||||
|
Loading…
Reference in New Issue
Block a user