]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix bench block size
authorJosh Durgin <josh.durgin@inktank.com>
Mon, 18 Nov 2013 22:39:12 +0000 (14:39 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Thu, 21 Nov 2013 02:16:12 +0000 (18:16 -0800)
The command was declared to take 'size' in dumpling, but was trying to
read 'bsize' instead, so it always used the default of 4MiB. Change
the bench command to read 'size', so it matches what existing clients
are sending.

Fixes: #6795
Backport: emperor, dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 40a76ef0d09f8ecbea13712410d9d34f25b91935)

Conflicts:
src/osd/OSD.cc

src/osd/OSD.cc
src/test/pybind/test_rados.py

index d1234a1f66be4ff988b61e8a94a446ee832702ff..d9d9ab3477befdb694f253517c07a8363c72d46d 100644 (file)
@@ -4025,7 +4025,7 @@ void OSD::do_command(Connection *con, tid_t tid, vector<string>& cmd, bufferlist
     int64_t bsize;
     // default count 1G, size 4MB
     cmd_getval(g_ceph_context, cmdmap, "count", count, (int64_t)1 << 30);
-    cmd_getval(g_ceph_context, cmdmap, "bsize", bsize, (int64_t)4 << 20);
+    cmd_getval(g_ceph_context, cmdmap, "size", bsize, (int64_t)4 << 20);
 
     bufferlist bl;
     bufferptr bp(bsize);
index 9be4c1eb815e51f5f3156fd6c5affe4ab85c8480..ae06a5f77c4c19f7e82791d7e51ae5e53146237f 100644 (file)
@@ -319,7 +319,7 @@ class TestObject(object):
         eq(self.object.read(3), 'bar')
         eq(self.object.read(3), 'baz')
 
-class TestMonCommand(object):
+class TestCommand(object):
 
     def setUp(self):
         self.rados = Rados(conffile='')
@@ -373,3 +373,12 @@ class TestMonCommand(object):
         d = json.loads(buf)
         assert('epoch' in d)
 
+    def test_osd_bench(self):
+        cmd = dict(prefix='bench', size=4096, count=8192)
+        ret, buf, err = self.rados.osd_command(0, json.dumps(cmd), '',
+                                               timeout=30)
+        eq(ret, 0)
+        assert len(err) > 0
+        out = json.loads(err)
+        eq(out['blocksize'], cmd['size'])
+        eq(out['bytes_written'], cmd['count'])