Skip to content

Commit

Permalink
Merge pull request ceph#977 from ceph/wip-rgw-compression
Browse files Browse the repository at this point in the history
rgw/verify: use rgw_compression_type = "random"

Reviewed-by: Yehuda Sadeh <[email protected]>
Reviewed-by: Orit Wasserman <[email protected]>
  • Loading branch information
yehudasa authored Dec 7, 2016
2 parents 8fa08e9 + f39cafe commit 02e7e83
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions suites/rgw/verify/overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ overrides:
conf:
client:
debug rgw: 20
rgw compression type: random
rgw:
frontend: civetweb
28 changes: 27 additions & 1 deletion tasks/rgw.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,13 @@ def extract_zone_info(ctx, client, client_config):
index_pool = '.' + region + '.' + zone + '.' + 'index_pool'
data_pool = '.' + region + '.' + zone + '.' + 'data_pool'
data_extra_pool = '.' + region + '.' + zone + '.' + 'data_extra_pool'
compression_type = ceph_config.get('rgw compression type', '')

zone_info['placement_pools'] = [{'key': 'default_placement',
'val': {'index_pool': index_pool,
'data_pool': data_pool,
'data_extra_pool': data_extra_pool}
'data_extra_pool': data_extra_pool,
'compression': compression_type}
}]

# these keys are meant for the zones argument in the region info. We
Expand Down Expand Up @@ -819,6 +821,28 @@ def configure_multisite_regions_and_zones(ctx, config, regions, role_endpoints,

yield

def configure_compression_in_default_zone(ctx, config):
ceph_config = ctx.ceph['ceph'].conf.get('global', {})
ceph_config.update(ctx.ceph['ceph'].conf.get('client', {}))
for client, c_config in config.iteritems():
ceph_config.update(ctx.ceph['ceph'].conf.get(client, {}))
key = 'rgw compression type'
if not key in ceph_config:
log.debug('No compression setting to enable')
break
compression = ceph_config[key]
log.debug('Configuring compression type = %s', compression)

# XXX: the 'default' zone and zonegroup aren't created until we run RGWRados::init_complete().
# issue a 'radosgw-admin user list' command to trigger this
rgwadmin(ctx, client, cmd=['user', 'list'], check_status=True)

rgwadmin(ctx, client,
cmd=['zone', 'placement', 'modify', '--rgw-zone', 'default',
'--placement-id', 'default-placement', '--compression', compression],
check_status=True)
break # only the first client

@contextlib.contextmanager
def configure_regions_and_zones(ctx, config, regions, role_endpoints, realm):
"""
Expand All @@ -828,13 +852,15 @@ def configure_regions_and_zones(ctx, config, regions, role_endpoints, realm):
log.debug(
'In rgw.configure_regions_and_zones() and regions is None. '
'Bailing')
configure_compression_in_default_zone(ctx, config)
yield
return

if not realm:
log.debug(
'In rgw.configure_regions_and_zones() and realm is None. '
'Bailing')
configure_compression_in_default_zone(ctx, config)
yield
return

Expand Down

0 comments on commit 02e7e83

Please sign in to comment.