Limit OSD object name lengths for Jewel + ext4

As of the Ceph Jewel release, certain limitations apply to
OSD object name lengths: specifically if ext4 is in use for
block devices or a directory based OSD is configured, OSD's
must be configured to limit object name length:

  osd max object name len = 256
  osd max object namespace len = 64

This may cause problems storing objects with long names via
the ceph-radosgw charm or for direct users of RADOS.

Also ensure that ceph.conf as a final newline as ceph requires
this.

Change-Id: I26f1d8a6f9560b307929f294d2d637c92986cf41
Closes-Bug: 1580320
Closes-Bug: 1578403
(cherry picked from commit 53d09832e5)
This commit is contained in:
James Page 2016-05-17 10:08:18 +01:00
parent 0bfbdf8b1b
commit 813500053e
2 changed files with 24 additions and 0 deletions

View File

@ -278,6 +278,24 @@ def install():
install_upstart_scripts()
def use_short_objects():
'''
Determine whether OSD's should be configured with
limited object name lengths.
@return: boolean indicating whether OSD's should be limited
'''
if cmp_pkgrevno('ceph', "10.2.0") >= 0:
if config('osd-format') in ('ext4'):
return True
for device in config('osd-devices'):
if not device.startswith('/dev'):
# TODO: determine format of directory based
# OSD location
return True
return False
def emit_cephconf():
mon_hosts = get_mon_hosts()
log('Monitor hosts are ' + repr(mon_hosts))
@ -299,6 +317,7 @@ def emit_cephconf():
'ceph_cluster_network': cluster_network,
'loglevel': config('loglevel'),
'dio': str(config('use-direct-io')).lower(),
'short_object_len': use_short_objects(),
}
if config('prefer-ipv6'):

View File

@ -44,3 +44,8 @@ osd journal size = {{ osd_journal_size }}
filestore xattr use omap = true
journal dio = {{ dio }}
{%- if short_object_len %}
osd max object name len = 256
osd max object namespace len = 64
{% endif %}