Removed commented code found in test/osd/.
Fixes: http://tracker.ceph.com/issues/20207 (Partially)
Signed-off-by: Jos Collin <jcollin@redhat.com>
return out << "(ObjNum " << rhs.objnum
<< " snap " << rhs.cursnap
<< " seq_num " << rhs.seqnum
- //<< " prefix " << rhs.prefix
<< ")";
}
void TestOp::begin()
{
- //if (stat) stat->begin(this);
_begin();
}
void TestOp::finish(TestOp::CallbackInfo *info)
{
_finish(info);
- //if (stat && finished()) stat->end(this);
}
void read_callback(librados::completion_t comp, void *arg) {
i != obj.attrs.end();
++i, ++iter) {
if (!(*iter % 3)) {
- //op.rmxattr(i->first.c_str());
to_remove.insert(i->first);
op.rmxattr(i->first.c_str());
}
context->seq_num++;
waiting_on = ranges.size();
- //cout << " waiting_on = " << waiting_on << std::endl;
ContentsGenerator::iterator gen_pos = cont_gen->get_iterator(cont);
uint64_t tid = 1;
for (map<uint64_t, uint64_t>::iterator i = ranges.begin();
// not being particularly specific here about knowing which
// flushes are on the oldest clean snap and which ones are not.
can_fail = !blocking || !context->snaps.empty();
- // FIXME: we can could fail if we've ever removed a snap due to
+ // FIXME: we could fail if we've ever removed a snap due to
// the async snap trimming.
can_fail = true;
cout << num << ": " << (blocking ? "cache_flush" : "cache_try_flush")
new TestOp::CallbackInfo(0));
completion = context->rados.aio_create_completion((void *) cb_arg, NULL,
&write_callback);
- // leave object in unused list so that we race with other operations
- //context->oid_in_use.insert(oid);
- //context->oid_not_in_use.erase(oid);
context->oid_flushing.insert(oid);
context->oid_not_flushing.erase(oid);
context->state_lock.Unlock();
context->state_lock.Lock();
assert(!done);
assert(completion->is_complete());
- //context->oid_in_use.erase(oid);
- //context->oid_not_in_use.insert(oid);
context->oid_flushing.erase(oid);
context->oid_not_flushing.insert(oid);
int r = completion->get_return_value();
new TestOp::CallbackInfo(0));
completion = context->rados.aio_create_completion((void *) cb_arg, NULL,
&write_callback);
- // leave object in unused list so that we race with other operations
- //context->oid_in_use.insert(oid);
- //context->oid_not_in_use.erase(oid);
context->state_lock.Unlock();
op.cache_evict();
context->state_lock.Lock();
assert(!done);
assert(completion->is_complete());
- //context->oid_in_use.erase(oid);
- //context->oid_not_in_use.insert(oid);
+
int r = completion->get_return_value();
cout << num << ": got " << cpp_strerror(r) << std::endl;
if (r == 0) {
TEST_F(OSDMapTest, PrimaryAffinity) {
set_up_map();
- /*
- osdmap.print(cout);
- Formatter *f = Formatter::create("json-pretty");
- f->open_object_section("CRUSH");
- osdmap.crush->dump(f);
- f->close_section();
- f->flush(cout);
- delete f;
- */
-
int n = get_num_osds();
for (map<int64_t,pg_pool_t>::const_iterator p = osdmap.get_pools().begin();
p != osdmap.get_pools().end();
vector<int> primary(n, 0);
test_mappings(0, 10000, &any, &first, &primary);
for (int i=0; i<n; ++i) {
- //cout << "osd." << i << " " << any[i] << " " << first[i] << " " << primary[i] << std::endl;
ASSERT_LT(0, any[i]);
ASSERT_LT(0, first[i]);
ASSERT_LT(0, primary[i]);
vector<int> primary(n, 0);
test_mappings(pool, 10000, &any, &first, &primary);
for (int i=0; i<n; ++i) {
- //cout << "osd." << i << " " << any[i] << " " << first[i] << " " << primary[i] << std::endl;
ASSERT_LT(0, any[i]);
if (i >= 2) {
ASSERT_LT(0, first[i]);
vector<int> primary(n, 0);
test_mappings(pool, 10000, &any, &first, &primary);
for (int i=0; i<n; ++i) {
- //cout << "osd." << i << " " << any[i] << " " << first[i] << " " << primary[i] << std::endl;
ASSERT_LT(0, any[i]);
if (i >= 2) {
ASSERT_LT(0, first[i]);
int num_internal = 10;
// Set up splitting map
- //ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
OSDMap *osdmap = new OSDMap;
uuid_d test_uuid;
test_uuid.generate_random();
log.log.push_back(e);
if (i == 1)
log.tail = e.version;
- //cout << "object " << e.soid << std::endl;
}
log.head = e.version;
log.index();
TestOp *gen_op(RadosTestContext &context, TestOpType type)
{
string oid, oid2;
- //cout << "oids not in use " << context.oid_not_in_use.size() << std::endl;
assert(context.oid_not_in_use.size());
switch (type) {
set_redirect = true;
} else {
cerr << "unknown arg " << argv[i] << std::endl;
- //usage();
exit(1);
}
}
if (op_weights.empty()) {
cerr << "No operations specified" << std::endl;
- //usage();
exit(1);
}
p.set_pg_num(12);
p.set_pgp_num(12);
- //cout << "num " << p.get_pg_num()
- // << " mask " << p.get_pg_num_mask() << std::endl;
+
ASSERT_EQ(16u, p.get_pg_num_divisor(pg_t(0, 1)));
ASSERT_EQ(16u, p.get_pg_num_divisor(pg_t(1, 1)));
ASSERT_EQ(16u, p.get_pg_num_divisor(pg_t(2, 1)));