]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-objectstore-tool: call collection_bits() crashes on the meta collection 31133/head
authorDavid Zafman <dzafman@redhat.com>
Thu, 24 Oct 2019 18:31:52 +0000 (11:31 -0700)
committerDavid Zafman <dzafman@redhat.com>
Thu, 24 Oct 2019 18:37:30 +0000 (11:37 -0700)
Skip new check for meta collection
test:
    Turn off osd_pool_default_pg_autoscale_mode just like bash tests do
    Fix test by checking for new error message

Caused by: f88b3534549bb2ede76e9f3e8b6b641b5886a9f4

Fixes: https://tracker.ceph.com/issues/42476
Signed-off-by: David Zafman <dzafman@redhat.com>
qa/standalone/special/ceph_objectstore_tool.py
src/tools/ceph_objectstore_tool.cc

index ccc9d00e6dc36133226aa1359d454053de100eed..952eda3b3ae9527acf1fd6b46c3d8060a52b0d4b 100755 (executable)
@@ -150,7 +150,7 @@ def cat_file(level, filename):
     print("<EOF>")
 
 
-def vstart(new, opt=""):
+def vstart(new, opt="-o osd_pool_default_pg_autoscale_mode=off"):
     print("vstarting....", end="")
     NEW = new and "-n" or "-N"
     call("MON=1 OSD=4 MDS=0 MGR=1 CEPH_PORT=7400 MGR_PYTHON_PATH={path}/src/pybind/mgr {path}/src/vstart.sh --filestore --short -l {new} -d {opt} > /dev/null 2>&1".format(new=NEW, opt=opt, path=CEPH_ROOT), shell=True)
@@ -1542,7 +1542,10 @@ def main(argv):
                             logging.debug("FOUND: {json} in {osd} has value '{val}'".format(osd=osd, json=JSON, val=out))
                             found += 1
                         except subprocess.CalledProcessError as e:
-                            if "No such file or directory" not in e.output and "No data available" not in e.output:
+                            logging.debug("Error message: {output}".format(output=e.output))
+                            if "No such file or directory" not in e.output and \
+                               "No data available" not in e.output and \
+                               "not contained by pg" not in e.output:
                                 raise
                 # Assuming k=2 m=1 for the default ec pool
                 if found != 3:
index 5e2057f54da0a000f3938c9512ce41a5700d5644..229c9f628eee1e0ea0970e481fcd93297dbe4f96 100644 (file)
@@ -3758,11 +3758,13 @@ int main(int argc, char **argv)
           ret = 1;
           goto out;
         }
-       auto ch = fs->open_collection(coll_t(pgid));
-       if (!ghobj.match(fs->collection_bits(ch), pgid.ps())) {
-         stringstream ss;
-         ss << "object " << ghobj << " not contained by pg " << pgid;
-         throw std::runtime_error(ss.str());
+       if (pgidstr != "meta") {
+         auto ch = fs->open_collection(coll_t(pgid));
+         if (!ghobj.match(fs->collection_bits(ch), pgid.ps())) {
+           stringstream ss;
+           ss << "object " << ghobj << " not contained by pg " << pgid;
+           throw std::runtime_error(ss.str());
+         }
        }
       }
     } catch (std::runtime_error& e) {