Project

General

Profile

Fix #9371

ceph should fail when an argument is of the wrong type

Added by Loïc Dachary over 9 years ago. Updated over 4 years ago.

Status:
New
Priority:
High
Assignee:
-
Category:
ceph cli
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Instead it drops the argument for which a type error has been discovered and proceeds with the command. The outcome may be unexpected.

./ceph --verbose osd pool create replicated0 12 12 replicated_ruleset
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
better match: 5 > 2: cmd133:osd pool create <poolname> <int[0-]> {<int[0-]>} {replicated|erasure} {<erasure_code_profile>} {<ruleset>} {<int>} 
bestcmds_sorted: 
[{u'cmd133': {u'avail': u'cli,rest',
              u'help': u'create pool',
              u'module': u'osd',
              u'perm': u'rw',
              u'sig': [argdesc(<class 'ceph_argparse.CephPrefix'>, name=prefix, req=True, n=1, prefix=osd),
                       argdesc(<class 'ceph_argparse.CephPrefix'>, name=prefix, req=True, n=1, prefix=pool),
                       argdesc(<class 'ceph_argparse.CephPrefix'>, name=prefix, req=True, n=1, prefix=create),
                       argdesc(<class 'ceph_argparse.CephPoolname'>, name=pool, req=True, n=1),
                       argdesc(<class 'ceph_argparse.CephInt'>, name=pg_num, req=True, n=1, range=0),
                       argdesc(<class 'ceph_argparse.CephInt'>, name=pgp_num, req=False, n=1, range=0),
                       argdesc(<class 'ceph_argparse.CephChoices'>, name=pool_type, req=False, n=1, strings=replicated|erasure),
                       argdesc(<class 'ceph_argparse.CephString'>, name=erasure_code_profile, req=False, n=1, goodchars=[A-Za-z0-9-_.]),
                       argdesc(<class 'ceph_argparse.CephString'>, name=ruleset, req=False, n=1),
                       argdesc(<class 'ceph_argparse.CephInt'>, name=expected_num_objects, req=False, n=1)]}}]
replicated_ruleset not valid:  replicated_ruleset not in replicated|erasure
Submitting command  {'prefix': 'osd pool create', u'pg_num': 12L, u'erasure_code_profile': 'replicated_ruleset', u'pool': 'replicated0', u'pgp_num': 12L}
pool 'replicated0' created

History

#1 Updated by Loïc Dachary over 9 years ago

  • Tracker changed from Bug to Fix

#2 Updated by Jens Harbott over 8 years ago

The way ceph uses positional arguments here is quite creative indeed. It seems also badly documented, e.g. only after finding this bug I was able to work out the proper way to set expected_num_objects. Pretty counterintuitive that erasure_code_profile is even needed as an argument when pool_type=replicated is set before.

#3 Updated by Patrick Donnelly over 4 years ago

  • Status changed from 12 to New

Also available in: Atom PDF