]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
obj_bencher: check run_name and prefix for empty string instead of NULL 5071/head
authorshawn chen <cxwshawn@gmail.com>
Fri, 3 Jul 2015 03:17:55 +0000 (11:17 +0800)
committershawn chen <cxwshawn@gmail.com>
Fri, 3 Jul 2015 03:17:58 +0000 (11:17 +0800)
commit0f7aeee1d965f94c9672820dc8a61fe263ddf3d0
tree37abe5cd32b961f96acb45af75d3754a8f4eb87e
parent1dce70efde874c889d22cec99c8b55dd6740460b
obj_bencher: check run_name and prefix for empty string instead of NULL

change aio_bench and clean_up parameter const char * to const std::string & format.
In rest_bench.cc, aio_bench used run_name.c_str(), so this format will always be empty
string not NULL, so the condition statement
const std::string run_name_meta = (run_name == NULL ? BENCH_LASTRUN_METADATA : std::string(run_name));
is wrong!

test fix:
    before:
        ./rest-bench --seconds 1 -t 2 -b 100 write --api-host=radosgw.com --bucket=test_rm --access-key=FTL7TSJAGXX5KKDQHMJM  --secret=123456879
        use s3cmd ls s3://test_rm , we can a lot of objects in this bucket, objects are not cleaned up.
    after changes, do the same procedure, objects are cleaned up.

Signed-off-by: shawn chen <cxwshawn@gmail.com>
src/common/obj_bencher.cc
src/common/obj_bencher.h
src/tools/rest_bench.cc