-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cluster: Addition of new Scrubbing test #246
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ def __init__(self, archive_dir, cluster, config): | |
self.use_existing_volumes = config.get('use_existing_volumes', False) | ||
self.pool_name = config.get("poolname", "cbt-librbdfio") | ||
self.recov_pool_name = config.get("recov_pool_name", "cbt-librbdfio-recov") | ||
self.scrub_pool_name = config.get("scrub_pool_name", "cbt-librbdfio-scrub") | ||
self.scrub_pool_profile = config.get("scrub_pool_profile", "default") | ||
self.rbdname = config.get('rbdname', '') | ||
|
||
self.total_procs = self.procs_per_volume * self.volumes_per_client * len(settings.getnodes('clients').split(',')) | ||
|
@@ -80,9 +82,17 @@ def initialize(self): | |
|
||
common.sync_files('%s/*' % self.run_dir, self.out_dir) | ||
|
||
if 'scrubbing_test' in self.cluster.config: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this just be called 'scrub_test'. I think all instances of 'scrubbing' in function names and other places can be replaced with 'scrub'. This makes the code much neater and consistent to read. What do you think? |
||
self.mkscrubimage() | ||
|
||
# Create the recovery image based on test type requested | ||
if 'recovery_test' in self.cluster.config and self.recov_test_type == 'background': | ||
self.mkrecovimage() | ||
|
||
if 'scrub_recov_test' in self.cluster.config: | ||
self.mkrecovimage() | ||
self.mkscrubimage() | ||
|
||
self.mkimages() | ||
# populate the fio files | ||
ps = [] | ||
|
@@ -128,6 +138,17 @@ def run(self): | |
# Wait for a signal from the recovery thread to initiate client IO | ||
self.cluster.wait_start_io() | ||
|
||
if 'scrubbing_test' in self.cluster.config: | ||
scrubbing_callback = self.scrubbing_callback | ||
self.cluster.create_scrubbing_test(self.run_dir, scrubbing_callback) | ||
self.cluster.wait_start_io() | ||
|
||
if 'scrub_recov_test' in self.cluster.config: | ||
scrub_recov_callback = self.scrub_recov_callback | ||
self.cluster.create_scrub_recovery_test(self.run_dir, scrub_recov_callback) | ||
self.cluster.wait_start_io() | ||
|
||
|
||
monitoring.start(self.run_dir) | ||
|
||
logger.info('Running rbd fio %s test.', self.mode) | ||
|
@@ -142,6 +163,9 @@ def run(self): | |
if 'recovery_test' in self.cluster.config: | ||
self.cluster.wait_recovery_done() | ||
|
||
if 'scrub_recov_test' in self.cluster.config: | ||
self.cluster.wait_scrub_recovery_done() | ||
|
||
monitoring.stop(self.run_dir) | ||
|
||
# Finally, get the historic ops | ||
|
@@ -210,6 +234,18 @@ def mkrecovimage(self): | |
self.cluster.mkimage('cbt-librbdfio-recov-%s-%d' % (node,volnum), self.vol_size, self.recov_pool_name, self.data_pool, self.vol_object_size) | ||
monitoring.stop() | ||
|
||
def mkscrubimage(self): | ||
logger.info('Creating scrubbing image...') | ||
monitoring.start("%s/scrub_pool_monitoring" % self.run_dir) | ||
if (self.use_existing_volumes == False): | ||
self.cluster.rmpool(self.scrub_pool_name, self.scrub_pool_profile) | ||
self.cluster.mkpool(self.scrub_pool_name, self.scrub_pool_profile, 'rbd') | ||
for node in common.get_fqdn_list('clients'): | ||
for volnum in range(0, self.volumes_per_client): | ||
node = node.rpartition("@")[2] | ||
self.cluster.mkimage('cbt-librbdfio-scrub-%s-%d' % (node,volnum), self.vol_size, self.scrub_pool_name, self.data_pool, self.vol_object_size) | ||
monitoring.stop() | ||
|
||
def mkimages(self): | ||
monitoring.start("%s/pool_monitoring" % self.run_dir) | ||
if (self.use_existing_volumes == False): | ||
|
@@ -231,6 +267,9 @@ def recovery_callback_blocking(self): | |
def recovery_callback_background(self): | ||
logger.info('Recovery thread completed!') | ||
|
||
def scrubbing_callback(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'scrubbing' to 'scrub' |
||
logger.info('Scrubbing thread completed!') | ||
|
||
def parse(self, out_dir): | ||
for client in settings.getnodes('clients').split(','): | ||
host = settings.host_info(client)["host"] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ def __init__(self, cluster, config): | |
self.data_pool_profile = config.get('data_pool_profile', None) | ||
self.recov_pool = None | ||
self.recov_pool_profile = config.get('recov_pool_profile', 'default') | ||
self.scrub_pool = None | ||
self.scrub_pool_profile = config.get('scrub_pool_profile', 'default') | ||
self.order = config.get('order', 22) | ||
self.disabled_features = config.get('disabled_features', None) | ||
|
||
|
@@ -114,6 +116,15 @@ def create_rbd_recovery(self): | |
rbd_name = '%s-%s' % (self.pool, self.get_rbd_name(node, ep_num)) | ||
self.cluster.mkimage(rbd_name, self.endpoint_size, self.pool, self.data_pool, self.order) | ||
|
||
def create_rbd_scrubbing(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'create_rbd_scrub_pool()' sounds better. |
||
self.pool = '%s-scrub' % self.name | ||
self.cluster.rmpool(self.pool, self.scrub_pool_profile) | ||
self.cluster.mkpool(self.pool, self.scrub_pool_profile, 'rbd') | ||
for node in common.get_fqdn_list('clients'): | ||
for ep_num in range(0, self.endpoints_per_client): | ||
rbd_name = '%s-%s' % (self.pool, self.get_rbd_name(node, ep_num)) | ||
self.cluster.mkimage(rbd_name, self.endpoint_size, self.pool, self.data_pool, self.order) | ||
|
||
def mount_rbd(self): | ||
for ep_num in range(0, self.endpoints_per_client): | ||
dir_name = self.get_dir_name(ep_num) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,6 @@ def remove(self): | |
|
||
def create_recovery_image(self): | ||
pass | ||
|
||
def create_scrubbing_image(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'scrubbing' to 'scrub' here and in the other *_endpoint.py files. |
||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'scrubbing' to 'scrub'