ldout(cct, 0) << "verify_authorizer could not get service secret for service "
<< ceph_entity_type_name(service_id) << " secret_id=" << ticket.secret_id << dendl;
if (cct->_conf->auth_debug && ticket.secret_id == 0)
- ceph_assert(0 == "got secret_id=0");
+ ceph_abort_msg("got secret_id=0");
return false;
}
}
else if (command == "status")
m_client->dump_status(f.get());
else
- ceph_assert(0 == "bad command registered");
+ ceph_abort_msg("bad command registered");
m_client->client_lock.Unlock();
f->close_section();
f->flush(out);
else
dir->readdir_cache[dirp->cache_index] = dn;
} else {
- ceph_assert(0 == "unexpected readdir buffer idx");
+ ceph_abort_msg("unexpected readdir buffer idx");
}
dirp->cache_index++;
}
if ((wanted & CEPH_CAP_XATTR_SHARED) &&
!(ist.xattr_version > 0 && ist.xattrbl.length() > 0))
- ceph_assert(0 == "MDS reply does not contain xattrs");
+ ceph_abort_msg("MDS reply does not contain xattrs");
}
in = add_update_inode(&ist, request->sent_stamp, session,
&target, perms);
} else {
// if the dentry is not linked, just do our best. see #5021.
- ceph_assert(0 == "how did this happen? i want logs!");
+ ceph_abort_msg("how did this happen? i want logs!");
}
} else {
Inode *in = request->inode();
break;
default:
// Should never happen
- ceph_assert(false);
+ ceph_abort();
}
return caps;
}
}
}
if (stag == first)
- ceph_assert(0 == "run out of stag");
+ ceph_abort_msg("run out of stag");
inodeno_t fino = MAKE_FINO(ino, stag);
//cout << "make_fake_ino " << ino << "." << snapid << " -> " << fino << std::endl;
old_cycles = 0;
while (1) {
if (gettimeofday(&start_time, NULL) != 0) {
- ceph_assert(0 == "couldn't read clock");
+ ceph_abort_msg("couldn't read clock");
}
uint64_t start_cycles = rdtsc();
while (1) {
if (gettimeofday(&stop_time, NULL) != 0) {
- ceph_assert(0 == "couldn't read clock");
+ ceph_abort_msg("couldn't read clock");
}
uint64_t stop_cycles = rdtsc();
micros = (stop_time.tv_usec - start_time.tv_usec) +
<< " had suicide timed out after " << h->suicide_grace << dendl;
pthread_kill(h->thread_id, SIGABRT);
sleep(1);
- ceph_assert(0 == "hit suicide timeout");
+ ceph_abort_msg("hit suicide timeout");
}
return healthy;
}
int Thread::join(void **prval)
{
if (thread_id == 0) {
- ceph_assert("join on thread that was never started" == 0);
+ ceph_abort_msg("join on thread that was never started");
return -EINVAL;
}
ostringstream tss;
tss << ceph_clock_now();
+ char buf[8096];
BackTrace *bt = new BackTrace(1);
- ba.printf("%s: In function '%s' thread %llx time %s\n"
- "%s: %d: abort()\n",
- file, func, (unsigned long long)pthread_self(), tss.str().c_str(),
- file, line);
+ snprintf(buf, sizeof(buf), "%s: In function '%s' thread %llx time %s\n"
+ "%s: %d: abort()\n", file, func, (unsigned long long)pthread_self(),
+ tss.str().c_str(), file, line);
dout_emergency(msg);
// TODO: get rid of this memory allocation.
}
lgeneric_dout(this, 1) << "do_command '" << command << "' '"
<< ss.str() << dendl;
- if (command == "assert" && _conf->debug_asok_assert_abort) {
- ceph_assert(0 == "assert");
- }
+ ceph_assert_always(!(command == "assert" && _conf->debug_asok_assert_abort));
if (command == "abort" && _conf->debug_asok_assert_abort) {
- ceph_abort();
+ ceph_abort();
}
if (command == "perfcounters_dump" || command == "1" ||
command == "perf dump") {
_log->reopen_log_file();
}
else {
- ceph_assert(0 == "registered under wrong command?");
+ ceph_abort_msg("registered under wrong command?");
}
f->close_section();
}
class _bad_endl_use_dendl_t { public: _bad_endl_use_dendl_t(int) {} };
static const _bad_endl_use_dendl_t endl = 0;
inline std::ostream& operator<<(std::ostream& out, _bad_endl_use_dendl_t) {
- ceph_assert(0 && "you are using the wrong endl.. use std::endl or dendl");
+ ceph_abort_msg("you are using the wrong endl.. use std::endl or dendl");
return out;
}
int i = 0;
for (const auto &ac : axes_config) {
- ceph_assert(ac.m_buckets > 0 && "Must have at least one bucket on axis");
- ceph_assert(ac.m_quant_size > 0 &&
+ ceph_assertf(ac.m_buckets > 0, "Must have at least one bucket on axis");
+ ceph_assertf(ac.m_quant_size > 0,
"Quantization unit must be non-zero positive integer value");
m_axes_config[i++] = ac;
static_assert(sizeof...(T) == DIM, "Incorrect number of arguments");
return get_raw_index_internal<0>(
[](int64_t bucket, const axis_config_d &ac) {
- ceph_assert(bucket >= 0 && "Bucket index can not be negative");
- ceph_assert(bucket < ac.m_buckets && "Bucket index too large");
+ ceph_assertf(bucket >= 0, "Bucket index can not be negative");
+ ceph_assertf(bucket < ac.m_buckets, "Bucket index too large");
return bucket;
},
0, buckets...);
if (seq <= in_seq) {
if (HAVE_FEATURE(features, RECONNECT_SEQ) &&
conf.ms_die_on_old_message) {
- ceph_assert(0 == "old msgs despite reconnect_seq feature");
+ ceph_abort_msg("old msgs despite reconnect_seq feature");
}
return false;
} else if (seq > in_seq + 1) {
if (conf.ms_die_on_skipped_message) {
- ceph_assert(0 == "skipped incoming seq");
+ ceph_abort_msg("skipped incoming seq");
}
return false;
} else {
}
}
} while (class_id != start);
- ceph_assert(0 == "no available class id");
+ ceph_abort_msg("no available class id");
}
void CrushWrapper::reweight(CephContext *cct)
int ErasureCode::encode_chunks(const set<int> &want_to_encode,
map<int, bufferlist> *encoded)
{
- ceph_assert("ErasureCode::encode_chunks not implemented" == 0);
+ ceph_abort_msg("ErasureCode::encode_chunks not implemented");
}
int ErasureCode::_decode(const set<int> &want_to_read,
const map<int, bufferlist> &chunks,
map<int, bufferlist> *decoded)
{
- ceph_assert("ErasureCode::decode_chunks not implemented" == 0);
+ ceph_abort_msg("ErasureCode::decode_chunks not implemented");
}
int ErasureCode::parse(const ErasureCodeProfile &profile,
#define MEMPOOL_CLASS_HELPERS() \
void *operator new(size_t size); \
void *operator new[](size_t size) noexcept { \
- ceph_assert(0 == "no array new"); \
+ ceph_abort_msg("no array new"); \
return nullptr; } \
void operator delete(void *); \
- void operator delete[](void *) { ceph_assert(0 == "no array delete"); }
+ void operator delete[](void *) { ceph_abort_msg("no array delete"); }
// Use this in some particular .cc file to match each class with a
cerr << "\t" << client_name
<< "-read_index: getting keys failed with "
<< err << std::endl;
- ceph_assert(0 == client_name + "-read_index: reading index failed");
+ ceph_abort_msg(client_name + "-read_index: reading index failed");
return err;
}
kvmap.insert(dupmap.begin(), dupmap.end());
const std::string &prefix, ///< [in] Prefix/CF ==> MUST match some established merge operator
const std::string &key, ///< [in] Key to be merged
const bufferlist &value ///< [in] value to be merged into key
- ) { ceph_assert(0 == "Not implemented"); }
+ ) { ceph_abort_msg("Not implemented"); }
virtual ~TransactionImpl() {}
};
int KineticStore::open(ostream &out, const vector<ColumnFamily>& cfs)
{
if (!cfs.empty()) {
- ceph_assert(0 == "Not implemented");
+ ceph_abort_msg("Not implemented");
}
return do_open(out, false);
}
int KineticStore::create_and_open(ostream &out, const vector<ColumnFamily>& cfs)
{
if (!cfs.empty()) {
- ceph_assert(0 == "Not implemented");
+ ceph_abort_msg("Not implemented");
}
return do_open(out, true);
}
int LevelDBStore::open(ostream &out, const vector<ColumnFamily>& cfs) {
if (!cfs.empty()) {
- ceph_assert(0 == "Not implemented");
+ ceph_abort_msg("Not implemented");
}
return do_open(out, false);
}
int LevelDBStore::create_and_open(ostream &out, const vector<ColumnFamily>& cfs) {
if (!cfs.empty()) {
- ceph_assert(0 == "Not implemented");
+ ceph_abort_msg("Not implemented");
}
return do_open(out, true);
}
filterpolicy.reset(_filterpolicy);
ldoptions.filter_policy = filterpolicy.get();
#else
- ceph_assert(0 == "bloom size set but installed leveldb doesn't support bloom filters");
+ ceph_abort_msg(0 == "bloom size set but installed leveldb doesn't support bloom filters");
#endif
}
if (options.compression_enabled)
int MemDB::open(ostream &out, const vector<ColumnFamily>& cfs) {
if (!cfs.empty()) {
- ceph_assert(0 == "Not implemented");
+ ceph_abort_msg("Not implemented");
}
return do_open(out, false);
}
int MemDB::create_and_open(ostream &out, const vector<ColumnFamily>& cfs) {
if (!cfs.empty()) {
- ceph_assert(0 == "Not implemented");
+ ceph_abort_msg("Not implemented");
}
return do_open(out, true);
}
finish(r);
break;
case DISPATCH_RESULT_INVALID:
- ceph_assert(false);
+ ceph_abort();
break;
}
}
case DISCARD_ACTION_ZERO:
return "zero";
}
- ceph_assert(false);
+ ceph_abort();
return nullptr;
}
wr->zero(this->m_object_off, this->m_object_len);
break;
default:
- ceph_assert(false);
+ ceph_abort();
break;
}
}
return true;
}
journal::Event create_event(uint64_t op_tid) const override {
- ceph_assert(0);
+ ceph_abort();
return journal::UnknownEvent();
}
break;
default:
derr << "locker unknown message " << m->get_type() << dendl;
- ceph_assert(0 == "locker unknown message");
+ ceph_abort_msg("locker unknown message");
}
}
ceph_assert(lock->get_parent()->is_auth());
ceph_assert(lock->is_stable());
- ceph_assert(0 == "not fully implemented, at least not for filelock");
+ ceph_abort_msg("not fully implemented, at least not for filelock");
CInode *in = static_cast<CInode *>(lock->get_parent());
default:
derr << " balancer unknown message " << m->get_type() << dendl_impl;
- ceph_assert(0 == "balancer unknown message");
+ ceph_abort_msg("balancer unknown message");
}
return 0;
reap->set_cap_peer(p_cap_id, p_seq, p_mseq, peer, p_flags);
mds->send_message_client_counted(reap, session);
} else {
- ceph_assert(0);
+ ceph_abort();
}
}
default:
derr << "cache unknown message " << m->get_type() << dendl;
- ceph_assert(0 == "cache unknown message");
+ ceph_abort_msg("cache unknown message");
}
}
break;
default:
- ceph_assert(0 == "unrecognized mds_table_client request op");
+ ceph_abort_msg("unrecognized mds_table_client request op");
}
}
case TABLESERVER_OP_COMMIT: return handle_commit(req);
case TABLESERVER_OP_ROLLBACK: return handle_rollback(req);
case TABLESERVER_OP_NOTIFY_ACK: return handle_notify_ack(req);
- default: ceph_assert(0 == "unrecognized mds_table_server request op");
+ default: ceph_abort_msg("unrecognized mds_table_server request op");
}
}
default:
derr << "migrator unknown message " << m->get_type() << dendl;
- ceph_assert(0 == "migrator unknown message");
+ ceph_abort_msg("migrator unknown message");
}
}
dirfrag_t df = m->get_dirfrag();
map<dirfrag_t,import_state_t>::iterator it = import_state.find(df);
if (it == import_state.end()) {
- ceph_assert(0 == "got export_cancel in weird state");
+ ceph_abort_msg("got export_cancel in weird state");
} else if (it->second.state == IMPORT_DISCOVERING) {
import_reverse_discovering(df);
} else if (it->second.state == IMPORT_DISCOVERED) {
cache->adjust_subtree_auth(dir, it->second.peer);
import_reverse_unfreeze(dir);
} else {
- ceph_assert(0 == "got export_cancel in weird state");
+ ceph_abort_msg("got export_cancel in weird state");
}
}
} else if (start == '-') {
// nothing
} else
- ceph_assert(0 == "unrecognized start char");
+ ceph_abort_msg("unrecognized start char");
while (!q.end()) {
CDentry *dn = cache->add_replica_dentry(q, cur, finished);
finish_contexts(g_ceph_context, waiting_for_prefetch);
waiting_for_prefetch.clear();
} else {
- ceph_assert(0);
+ ceph_abort();
}
}
}
else if (prefetch_state == FILE_INODES)
pool = mds->mdsmap->get_first_data_pool();
else
- ceph_assert(0);
+ ceph_abort();
MDCache *mdcache = mds->mdcache;
return;
default:
derr << "server unknown message " << m->get_type() << dendl;
- ceph_assert(0 == "server unknown message");
+ ceph_abort_msg("server unknown message");
}
}
} else if (mdr->internal_op > -1) {
dout(10) << "respond_to_request on internal request " << mdr << dendl;
if (!mdr->internal_op_finish)
- ceph_assert(0 == "trying to respond to internal op without finisher");
+ ceph_abort_msg("trying to respond to internal op without finisher");
mdr->internal_op_finish->complete(r);
mdcache->request_finish(mdr);
}
auto blp = bl.cbegin();
if (r < 0) {
derr << "_load_finish got " << cpp_strerror(r) << dendl;
- ceph_assert(0 == "failed to load sessionmap");
+ ceph_abort_msg("failed to load sessionmap");
}
dump();
decode_legacy(blp); // note: this sets last_cap_renew = now()
else if (ino == MDS_INO_MDSDIR(rank))
mdsdir_scrubbed = true;
else
- ceph_assert(0);
+ ceph_abort();
}
bool can_allow_multimds_snaps() const {
return (root_scrubbed && mdsdir_scrubbed) ||
// is being purged (aside from it were
derr << "Rogue reference after purge to " << *dn << dendl;
- ceph_assert(0 == "rogue reference to purging inode");
+ ceph_abort_msg("rogue reference to purging inode");
}
// kill dentry.
!dir->state_test(CDir::STATE_AUXSUBTREE) &&
!diri->state_test(CInode::STATE_AMBIGUOUSAUTH)) {
dout(0) << "EMetaBlob::add_dir_context unexpected subtree " << *dir << dendl;
- ceph_assert(0);
+ ceph_abort();
}
dout(20) << "EMetaBlob::add_dir_context(" << dir << ") ambiguous or transient subtree " << dendl;
} else {
}
void encode_payload(uint64_t features) override {
- ceph_assert(0 == "MMonQuorumService message must always be a base class");
+ ceph_abort_msg("MMonQuorumService message must always be a base class");
}
void decode_payload() override {
- ceph_assert(0 == "MMonQuorumService message must always be a base class");
+ ceph_abort_msg("MMonQuorumService message must always be a base class");
}
const char *get_type_name() const override { return "quorum_service"; }
switch (op) {
case OP_SCRUB: return "scrub";
case OP_RESULT: return "result";
- default: ceph_assert(0 == "unknown op type"); return NULL;
+ default: ceph_abort_msg("unknown op type"); return NULL;
}
}
case OP_CHUNK: return "chunk";
case OP_LAST_CHUNK: return "last_chunk";
case OP_NO_COOKIE: return "no_cookie";
- default: ceph_assert(0 == "unknown op type"); return NULL;
+ default: ceph_abort_msg("unknown op type"); return NULL;
}
}
}
break;
default:
- ceph_assert(0 == "actual_op value is not supported");
+ ceph_abort_msg("actual_op value is not supported");
}
parsed_pgs.push_back(std::move(parsed_pg));
for (auto [name, type] : classes) {
type->tp_new = PyType_GenericNew;
if (PyType_Ready(type) < 0) {
- ceph_assert(0);
+ ceph_abort();
}
Py_INCREF(type);
if (! PyArg_ParseTupleAndKeywords(args, kwds, "O",
const_cast<char**>(kwlist),
&osdmap_capsule)) {
- ceph_assert(0);
- return -1;
+ ceph_abort();
+ return -1;
}
ceph_assert(PyObject_TypeCheck(osdmap_capsule, &PyCapsule_Type));
if (! PyArg_ParseTupleAndKeywords(args, kwds, "O",
const_cast<char**>(kwlist),
&inc_capsule)) {
- ceph_assert(0);
- return -1;
+ ceph_abort();
+ return -1;
}
ceph_assert(PyObject_TypeCheck(inc_capsule, &PyCapsule_Type));
if (! PyArg_ParseTupleAndKeywords(args, kwds, "O",
const_cast<char**>(kwlist),
&crush_capsule)) {
- ceph_assert(0);
- return -1;
+ ceph_abort();
+ return -1;
}
ceph_assert(PyObject_TypeCheck(crush_capsule, &PyCapsule_Type));
please enable \"mon_enable_op_tracker\", and the tracker will start to track new ops received afterwards.";
}
} else {
- ceph_assert(0 == "bad AdminSocket command binding");
+ ceph_abort_msg("bad AdminSocket command binding");
}
(read_only ? audit_clog->debug() : audit_clog->info())
<< "from='admin socket' "
derr << __func__
<< " something wrong happened while reading the store: "
<< cpp_strerror(err) << dendl;
- ceph_assert(0 == "error reading the store");
+ ceph_abort_msg("error reading the store");
}
} else {
latest_monmap.decode(monmon_bl);
derr << __func__
<< " something wrong happened while reading the store: "
<< cpp_strerror(err) << dendl;
- ceph_assert(0 == "error reading the store");
+ ceph_abort_msg("error reading the store");
}
ceph_assert(backup_bl.length() > 0);
default:
dout(0) << __func__ << " unknown op " << m->op << dendl;
- ceph_assert(0 == "unknown op");
+ ceph_abort_msg("unknown op");
}
}
ds << '\n';
}
} else {
- ceph_assert(0 == "We should never get here!");
+ ceph_abort_msg("We should never get here!");
return;
}
rdata.append(ds);
ceph_assert(is_leader());
if (monmap->size() == 1) {
- ceph_assert(0 == "We are alone; this shouldn't have been scheduled!");
+ ceph_abort_msg("We are alone; this shouldn't have been scheduled!");
return;
}
ceph_assert(is_leader());
ceph_assert((timecheck_round % 2) == 0);
if (monmap->size() == 1) {
- ceph_assert(0 == "We are alone; we shouldn't have gotten here!");
+ ceph_abort_msg("We are alone; we shouldn't have gotten here!");
return;
}
ceph_assert(timecheck_latencies.size() == timecheck_skews.size());
ceph_assert(is_leader());
ceph_assert((timecheck_round % 2) == 0);
if (monmap->size() == 1) {
- ceph_assert(0 == "We are alone; we shouldn't have gotten here!");
+ ceph_abort_msg("We are alone; we shouldn't have gotten here!");
return;
}
dout(10) << __func__ << dendl;
ceph_assert(is_leader());
if (monmap->size() == 1) {
- ceph_assert(0 == "We are alone; we shouldn't have gotten here!");
+ ceph_abort_msg("We are alone; we shouldn't have gotten here!");
return;
}
ceph_assert(timecheck_round % 2 != 0);
else if (r == -EAGAIN)
mon->dispatch_op(op);
else
- ceph_assert(0 == "bad C_Command return value");
+ ceph_abort_msg("bad C_Command return value");
}
};
else if (r == -ECANCELED)
return;
else
- ceph_assert(0 == "bad C_RetryMessage return value");
+ ceph_abort_msg("bad C_RetryMessage return value");
}
};
compact.pop_front();
}
} else {
- ceph_assert(0 == "failed to write to db");
+ ceph_abort_msg("failed to write to db");
}
return r;
}
generic_dout(0) << "MonitorDBStore::get() error obtaining"
<< " (" << prefix << ":" << key << "): "
<< cpp_strerror(err) << dendl;
- ceph_assert(0 == "error obtaining key");
+ ceph_abort_msg("error obtaining key");
}
ceph_assert(bl.length());
derr << __func__ << " error initializing "
<< kv_type << " db back storage in "
<< full_path << dendl;
- ceph_assert(0 == "MonitorDBStore: error initializing keyvaluedb back storage");
+ ceph_abort_msg("MonitorDBStore: error initializing keyvaluedb back storage");
}
db.reset(db_ptr);
// established them in the first place.
return;
} else {
- ceph_assert(0 == "bad C_ApplyFeatures return value");
+ ceph_abort_msg("bad C_ApplyFeatures return value");
}
}
};
int r = ceph_release_from_name(
g_conf()->mon_osd_initial_require_min_compat_client.c_str());
if (r <= 0) {
- ceph_assert(0 == "mon_osd_initial_require_min_compat_client is not valid");
+ ceph_abort_msg("mon_osd_initial_require_min_compat_client is not valid");
}
newmap.require_min_compat_client = r;
}
int r = get_value("osdmap_manifest", manifest_bl);
if (r < 0) {
derr << __func__ << " unable to read osdmap version manifest" << dendl;
- ceph_assert(0 == "error reading manifest");
+ ceph_abort_msg("error reading manifest");
}
osdmap_manifest.decode(manifest_bl);
has_osdmap_manifest = true;
derr << __func__
<< " osdmap crc mismatch! (osdmap crc " << tosdm.get_crc()
<< ", expected " << inc.full_crc << ")" << dendl;
- ceph_assert(0 == "osdmap crc mismatch");
+ ceph_abort_msg("osdmap crc mismatch");
}
}
*new_id = pending_inc.new_max_osd - 1;
ceph_assert(*new_id == allocated_id);
} else {
- ceph_assert(0 == "unexpected condition");
+ ceph_abort_msg("unexpected condition");
}
out:
break;
default:
- ceph_assert(0 == "invalid option");
+ ceph_abort_msg("invalid option");
}
}
}
osdmap.get_noout_osds(&osds);
break;
default:
- ceph_assert(0 == "invalid option");
+ ceph_abort_msg("invalid option");
}
// cancel any pending noup/nodown/noin/noout requests too
break;
default:
- ceph_assert(0 == "invalid option");
+ ceph_abort_msg("invalid option");
}
}
break;
default:
- ceph_assert(0 == "invalid option");
+ ceph_abort_msg("invalid option");
}
}
}
break;
default:
- ceph_assert(0 == "invalid option");
+ ceph_abort_msg("invalid option");
}
switch (option) {
break;
default:
- ceph_assert(0 == "invalid option");
+ ceph_abort_msg("invalid option");
}
goto update;
} else if (field == "max_bytes") {
value = strict_iecstrtoll(val.c_str(), &tss);
} else {
- ceph_assert(0 == "unrecognized option");
+ ceph_abort_msg("unrecognized option");
}
if (!tss.empty()) {
ss << "error parsing value '" << val << "': " << tss;
} else if (field == "max_bytes") {
pi->quota_max_bytes = value;
} else {
- ceph_assert(0 == "unrecognized option");
+ ceph_abort_msg("unrecognized option");
}
ss << "set-quota " << field << " = " << value << " for pool " << poolstr;
rs = ss.str();
else if (r == -EAGAIN)
cmon->dispatch(op);
else
- ceph_assert(0 == "bad C_Booted return value");
+ ceph_abort_msg("bad C_Booted return value");
}
};
else if (r == -EAGAIN)
osdmon->dispatch(op);
else
- ceph_assert(0 == "bad C_ReplyMap return value");
+ ceph_abort_msg("bad C_ReplyMap return value");
}
};
struct C_PoolOp : public C_MonOp {
else if (r == -EAGAIN)
osdmon->dispatch(op);
else
- ceph_assert(0 == "bad C_PoolOp return value");
+ ceph_abort_msg("bad C_PoolOp return value");
}
};
}
break;
default:
- ceph_assert(0 == "unrecognized pool type");
+ ceph_abort_msg("unrecognized pool type");
}
}
} else if (r == -ECANCELED || r == -EAGAIN) {
return;
} else {
- ceph_assert(0 == "bad return value for proposal_timer");
+ ceph_abort_msg("bad return value for proposal_timer");
}
});
dout(10) << " setting proposal_timer " << do_propose
else if (r == -ECANCELED || r == -EAGAIN)
return;
else
- ceph_assert(0 == "bad return value for C_Committed");
+ ceph_abort_msg("bad return value for C_Committed");
}
};
paxos->queue_pending_finisher(new C_Committed(this));
else if (r == -ECANCELED)
return;
else
- ceph_assert(0 == "bad C_RetryMessage return value");
+ ceph_abort_msg("bad C_RetryMessage return value");
}
};
/**
* Deliver a single Message. Send it to each Dispatcher
* in sequence until one of them handles it.
- * If none of our Dispatchers can handle it, ceph_assert(0).
+ * If none of our Dispatchers can handle it, ceph_abort().
*
* @param m The Message to deliver.
*/
<< ", discarding" << dendl;
message->put();
if (has_feature(CEPH_FEATURE_RECONNECT_SEQ) && async_msgr->cct->_conf->ms_die_on_old_message)
- ceph_assert(0 == "old msgs despite reconnect_seq feature");
+ ceph_abort_msg("old msgs despite reconnect_seq feature");
break;
}
if (message->get_seq() > cur_seq + 1) {
ldout(async_msgr->cct, 0) << __func__ << " missed message? skipped from seq "
<< cur_seq << " to " << message->get_seq() << dendl;
if (async_msgr->cct->_conf->ms_die_on_skipped_message)
- ceph_assert(0 == "skipped incoming seq");
+ ceph_abort_msg("skipped incoming seq");
}
message->set_connection(this);
// add_event shouldn't report error, otherwise it must be a innermost bug!
lderr(cct) << __func__ << " add event failed, ret=" << r << " fd=" << fd
<< " mask=" << mask << " original mask is " << event->mask << dendl;
- ceph_assert(0 == "BUG!");
+ ceph_abort_msg("BUG!");
return r;
}
int r = driver->del_event(fd, event->mask, mask);
if (r < 0) {
// see create_file_event
- ceph_assert(0 == "BUG!");
+ ceph_abort_msg("BUG!");
}
if (mask & EVENT_READABLE && event->read_cb) {
break;
default:
- ceph_assert(0 == "unhandled event");
+ ceph_abort_msg("unhandled event");
break;
}
rdma_ack_cm_event(event);
m->put();
if (connection_state->has_feature(CEPH_FEATURE_RECONNECT_SEQ) &&
msgr->cct->_conf->ms_die_on_old_message)
- ceph_assert(0 == "old msgs despite reconnect_seq feature");
+ ceph_abort_msg("old msgs despite reconnect_seq feature");
continue;
}
if (m->get_seq() > in_seq + 1) {
ldout(msgr->cct,0) << "reader missed message? skipped from seq "
<< in_seq << " to " << m->get_seq() << dendl;
if (msgr->cct->_conf->ms_die_on_skipped_message)
- ceph_assert(0 == "skipped incoming seq");
+ ceph_abort_msg("skipped incoming seq");
}
m->set_connection(connection_state.get());
break;
default:
- ceph_assert(0 == "Unknown OP");
+ ceph_abort_msg("Unknown OP");
}
}
void _update_op_bl(
}
if (errors) {
derr << __func__ << " saw " << errors << " errors" << dendl;
- ceph_assert(0 == "bitmap freelist errors");
+ ceph_abort_msg("bitmap freelist errors");
}
}
dout(10) << __func__ << " 0x" << std::hex << read_pos
<< ": stop: failed to skip to " << offset
<< std::dec << dendl;
- ceph_assert(0 == "problem with op_jump");
+ ceph_abort_msg("problem with op_jump");
}
}
}
derr << __func__ << " allocated: 0x" << std::hex << allocated
<< " offset: 0x" << offset << " length: 0x" << length << std::dec
<< dendl;
- ceph_assert(0 == "bluefs enospc");
+ ceph_abort_msg("bluefs enospc");
return r;
}
if (cct->_conf->bluefs_preextend_wal_files &&
<< " unflushed bytes" << dendl;
t.substr_of(h->buffer, 0, offset - h->pos);
h->buffer.swap(t);
- ceph_assert(0 == "actually this shouldn't happen");
+ ceph_abort_msg("actually this shouldn't happen");
}
if (h->buffer.length()) {
int r = _flush(h, true);
return 0; // no-op!
}
if (offset > h->file->fnode.size) {
- ceph_assert(0 == "truncate up not supported");
+ ceph_abort_msg("truncate up not supported");
}
ceph_assert(h->file->fnode.size >= offset);
h->file->fnode.size = offset;
return rocksdb::Status::IOError(strerror(r));
default:
// FIXME :(
- ceph_assert(0 == "unrecognized error code");
+ ceph_abort_msg("unrecognized error code");
return rocksdb::Status::NotSupported(rocksdb::Status::kNone);
}
}
else if (type == "2q")
c = new TwoQCache(cct);
else
- ceph_assert(0 == "unrecognized cache type");
+ ceph_abort_msg("unrecognized cache type");
c->logger = logger;
return c;
buffer_hot.insert(buffer_hot.iterator_to(*near), *b);
break;
default:
- ceph_assert(0 == "bad cache_private");
+ ceph_abort_msg("bad cache_private");
}
} else if (b->cache_private == BUFFER_NEW) {
b->cache_private = BUFFER_WARM_IN;
buffer_hot.push_front(*b);
break;
default:
- ceph_assert(0 == "bad cache_private");
+ ceph_abort_msg("bad cache_private");
}
}
if (!b->is_empty()) {
buffer_hot.erase(buffer_hot.iterator_to(*b));
break;
default:
- ceph_assert(0 == "bad cache_private");
+ ceph_abort_msg("bad cache_private");
}
}
buffer_hot.push_back(*b);
break;
default:
- ceph_assert(0 == "bad cache_private");
+ ceph_abort_msg("bad cache_private");
}
if (!b->is_empty()) {
buffer_bytes += b->length;
if (bid < 0) bid = 0;
}
} while (bid != begin_bid);
- ceph_assert(0 == "no available blob id");
+ ceph_abort_msg("no available blob id");
}
void BlueStore::ExtentMap::reshard(
derr << __func__ << "on write 0x" << std::hex << offset
<< "~" << length << " shard 0x" << p->shard_info->offset
<< std::dec << " is not loaded, can't mark dirty" << dendl;
- ceph_assert(0 == "can't mark unloaded shard dirty");
+ ceph_abort_msg("can't mark unloaded shard dirty");
}
if (!p->dirty) {
dout(20) << __func__ << " mark shard 0x" << std::hex
lderr(store->cct) << __func__ << " sbid 0x" << std::hex << sbid
<< std::dec << " not found at key "
<< pretty_binary_string(key) << dendl;
- ceph_assert(0 == "uh oh, missing shared_blob");
+ ceph_abort_msg("uh oh, missing shared_blob");
}
sb->loaded = true;
if (r < 0) {
derr << __func__ << " failed to read from 0x" << std::hex << e->offset
<<"~" << e->length << std::dec << dendl;
- ceph_assert(0 == "read failed, wtf");
+ ceph_abort_msg("read failed, wtf");
}
pext_to_release.push_back(*e);
e = pextents.erase(e);
freelist_type = std::string(bl.c_str(), bl.length());
dout(10) << __func__ << " freelist_type " << freelist_type << dendl;
} else {
- ceph_assert("Not Support extent freelist manager" == 0);
+ ceph_abort_msg("Not Support extent freelist manager");
}
}
default:
derr << __func__ << " unexpected txc " << txc
<< " state " << txc->get_state_name() << dendl;
- ceph_assert(0 == "unexpected txc state");
+ ceph_abort_msg("unexpected txc state");
return;
}
}
break;
case Transaction::OP_SPLIT_COLLECTION:
- ceph_assert(0 == "deprecated");
+ ceph_abort_msg("deprecated");
break;
case Transaction::OP_SPLIT_COLLECTION2:
break;
case Transaction::OP_COLL_RENAME:
- ceph_assert(0 == "not implemented");
+ ceph_abort_msg("not implemented");
break;
}
if (r < 0) {
<< " not handled on operation " << op->op
<< " (op " << pos << ", counting from 0)" << dendl;
_dump_transaction<0>(t);
- ceph_assert(0 == "unexpected error");
+ ceph_abort_msg("unexpected error");
}
// these operations implicity create the object
break;
case Transaction::OP_CLONERANGE:
- ceph_assert(0 == "deprecated");
+ ceph_abort_msg("deprecated");
break;
case Transaction::OP_CLONERANGE2:
break;
case Transaction::OP_COLL_ADD:
- ceph_assert(0 == "not implemented");
+ ceph_abort_msg("not implemented");
break;
case Transaction::OP_COLL_REMOVE:
- ceph_assert(0 == "not implemented");
+ ceph_abort_msg("not implemented");
break;
case Transaction::OP_COLL_MOVE:
- ceph_assert(0 == "deprecated");
+ ceph_abort_msg("deprecated");
break;
case Transaction::OP_COLL_MOVE_RENAME:
<< dendl;
derr << msg << dendl;
_dump_transaction<0>(t);
- ceph_assert(0 == "unexpected error");
+ ceph_abort_msg("unexpected error");
}
}
}
break;
case BUFFER_WARM_OUT:
// move from warm_out to hot LRU
- ceph_assert(0 == "this happens via discard hint");
+ ceph_abort_msg("this happens via discard hint");
break;
case BUFFER_HOT:
// move to front of hot LRU
dio = true;
aio = cct->_conf->bdev_aio;
if (!aio) {
- ceph_assert(0 == "non-aio not supported");
+ ceph_abort_msg("non-aio not supported");
}
// disable readahead as it will wreak havoc on our mix of
aio, max);
if (r < 0) {
derr << __func__ << " got " << cpp_strerror(r) << dendl;
- ceph_assert(0 == "got unexpected error from io_getevents");
+ ceph_abort_msg("got unexpected error from io_getevents");
}
if (r > 0) {
dout(30) << __func__ << " got " << r << " completed aios" << dendl;
} else if (aio[i]->length != (uint64_t)r) {
derr << "aio to " << aio[i]->offset << "~" << aio[i]->length
<< " but returned: " << r << dendl;
- ceph_assert(0 == "unexpected aio error");
+ ceph_abort_msg("unexpected aio error");
}
dout(10) << __func__ << " finished aio " << aio[i] << " r " << r
<< " since " << debug_stall_since << ", timeout is "
<< cct->_conf->bdev_debug_aio_suicide_timeout
<< "s, suicide" << dendl;
- ceph_assert(0 == "stalled aio... buggy kernel or bad device?");
+ ceph_abort_msg("stalled aio... buggy kernel or bad device?");
}
}
}
unsigned refs = 0;
for (const auto &p : ref_map) {
if (p.first < pos)
- ceph_assert(0 == "overlap");
+ ceph_abort_msg("overlap");
if (p.first == pos && p.second.refs == refs)
- ceph_assert(0 == "unmerged");
+ ceph_abort_msg("unmerged");
pos = p.first + p.second.length;
refs = p.second.refs;
}
auto p = ref_map.lower_bound(offset);
if (p == ref_map.end() || p->first > offset) {
if (p == ref_map.begin()) {
- ceph_assert(0 == "put on missing extent (nothing before)");
+ ceph_abort_msg("put on missing extent (nothing before)");
}
--p;
if (p->first + p->second.length <= offset) {
- ceph_assert(0 == "put on missing extent (gap)");
+ ceph_abort_msg("put on missing extent (gap)");
}
}
if (p->first < offset) {
b_len -= p->length;
++p;
}
- ceph_assert(0 == "we should not get here");
+ ceph_abort_msg("we should not get here");
return false;
}
const char *p = csum_data.c_str();
switch (cs) {
case 0:
- ceph_assert(0 == "no csum data, bad index");
+ ceph_abort_msg("no csum data, bad index");
case 1:
return reinterpret_cast<const uint8_t*>(p)[i];
case 2:
case 8:
return reinterpret_cast<const __le64*>(p)[i];
default:
- ceph_assert(0 == "unrecognized csum word size");
+ ceph_abort_msg("unrecognized csum word size");
}
}
const char *get_csum_item_ptr(unsigned i) const {
if (directio && !bl.is_aligned_size_and_memory(block_size, CEPH_DIRECTIO_ALIGNMENT)) {
ceph_assert((bl.length() & (CEPH_DIRECTIO_ALIGNMENT - 1)) == 0);
ceph_assert((pos & (CEPH_DIRECTIO_ALIGNMENT - 1)) == 0);
- ceph_assert(0 == "bl was not aligned");
+ ceph_abort_msg("bl was not aligned");
}
}
continue;
}
check_align(pos, tbl);
- ceph_assert(0 == "io_submit got unexpected error");
+ ceph_abort_msg("io_submit got unexpected error");
} else {
break;
}
continue;
}
derr << "io_getevents got " << cpp_strerror(r) << dendl;
- ceph_assert(0 == "got unexpected error from io_getevents");
+ ceph_abort_msg("got unexpected error from io_getevents");
}
{
if (event[i].res != ai->len) {
derr << "aio to " << ai->off << "~" << ai->len
<< " returned: " << (int)event[i].res << dendl;
- ceph_assert(0 == "unexpected aio error");
+ ceph_abort_msg("unexpected aio error");
}
dout(10) << __func__ << " aio " << ai->off
<< "~" << ai->len << " done" << dendl;
int ret = object_map->sync();
if (ret < 0) {
derr << __FUNC__ << ": omap sync error " << cpp_strerror(ret) << dendl;
- ceph_assert(0 == "_set_global_replay_guard failed");
+ ceph_abort_msg("_set_global_replay_guard failed");
}
ret = sync_filesystem(basedir_fd);
if (ret < 0) {
derr << __FUNC__ << ": sync_filesystem error " << cpp_strerror(ret) << dendl;
- ceph_assert(0 == "_set_global_replay_guard failed");
+ ceph_abort_msg("_set_global_replay_guard failed");
}
char fn[PATH_MAX];
if (fd < 0) {
int err = errno;
derr << __FUNC__ << ": " << cid << " error " << cpp_strerror(err) << dendl;
- ceph_assert(0 == "_set_global_replay_guard failed");
+ ceph_abort_msg("_set_global_replay_guard failed");
}
_inject_failure();
if (r < 0) {
derr << __FUNC__ << ": fsetxattr " << GLOBAL_REPLAY_GUARD_XATTR
<< " got " << cpp_strerror(r) << dendl;
- ceph_assert(0 == "fsetxattr failed");
+ ceph_abort_msg("fsetxattr failed");
}
// and make sure our xattr is durable.
if (fd < 0) {
int err = errno;
derr << __FUNC__ << ": " << cid << " error " << cpp_strerror(err) << dendl;
- ceph_assert(0 == "_set_replay_guard failed");
+ ceph_abort_msg("_set_replay_guard failed");
}
_set_replay_guard(fd, spos, 0, in_progress);
VOID_TEMP_FAILURE_RETRY(::close(fd));
fd, REPLAY_GUARD_XATTR, v.c_str(), v.length());
if (r < 0) {
derr << "fsetxattr " << REPLAY_GUARD_XATTR << " got " << cpp_strerror(r) << dendl;
- ceph_assert(0 == "fsetxattr failed");
+ ceph_abort_msg("fsetxattr failed");
}
// and make sure our xattr is durable.
if (fd < 0) {
int err = errno;
derr << __FUNC__ << ": " << cid << " error " << cpp_strerror(err) << dendl;
- ceph_assert(0 == "_close_replay_guard failed");
+ ceph_abort_msg("_close_replay_guard failed");
}
_close_replay_guard(fd, spos);
VOID_TEMP_FAILURE_RETRY(::close(fd));
fd, REPLAY_GUARD_XATTR, v.c_str(), v.length());
if (r < 0) {
derr << "fsetxattr " << REPLAY_GUARD_XATTR << " got " << cpp_strerror(r) << dendl;
- ceph_assert(0 == "fsetxattr failed");
+ ceph_abort_msg("fsetxattr failed");
}
// and make sure our xattr is durable.
case Transaction::OP_COLL_SETATTR:
case Transaction::OP_COLL_RMATTR:
- ceph_assert(0 == "collection attr methods no longer implemented");
+ ceph_abort_msg("collection attr methods no longer implemented");
break;
case Transaction::OP_COLL_RENAME:
break;
case Transaction::OP_SPLIT_COLLECTION:
{
- ceph_assert(0 == "not legacy journal; upgrade to firefly first");
+ ceph_abort_msg("not legacy journal; upgrade to firefly first");
}
break;
case Transaction::OP_SPLIT_COLLECTION2:
dump_open_fds(cct);
}
- ceph_assert(0 == "unexpected error");
+ ceph_abort_msg("unexpected error");
}
}
if (errors != 0) {
dout(0) << __FUNC__ << ": " << cid << "/" << oid << " " << offset << "~"
<< got << " ... BAD CRC:\n" << ss.str() << dendl;
- ceph_assert(0 == "bad crc on read");
+ ceph_abort_msg("bad crc on read");
}
}
int err = write_op_seq(op_fd, cp);
if (err < 0) {
derr << "Error during write_op_seq: " << cpp_strerror(err) << dendl;
- ceph_assert(0 == "error during write_op_seq");
+ ceph_abort_msg("error during write_op_seq");
}
char s[NAME_MAX];
err = backend->sync_checkpoint(cid);
if (err < 0) {
derr << "ioctl WAIT_SYNC got " << cpp_strerror(err) << dendl;
- ceph_assert(0 == "wait_sync got error");
+ ceph_abort_msg("wait_sync got error");
}
dout(20) << " done waiting for checkpoint " << cid << " to complete" << dendl;
}
int err = object_map->sync();
if (err < 0) {
derr << "object_map sync got " << cpp_strerror(err) << dendl;
- ceph_assert(0 == "object_map sync returned error");
+ ceph_abort_msg("object_map sync returned error");
}
err = backend->syncfs();
if (err < 0) {
derr << "syncfs got " << cpp_strerror(err) << dendl;
- ceph_assert(0 == "syncfs returned error");
+ ceph_abort_msg("syncfs returned error");
}
err = write_op_seq(op_fd, cp);
if (err < 0) {
derr << "Error during write_op_seq: " << cpp_strerror(err) << dendl;
- ceph_assert(0 == "error during write_op_seq");
+ ceph_abort_msg("error during write_op_seq");
}
err = ::fsync(op_fd);
if (err < 0) {
derr << "Error during fsync of op_seq: " << cpp_strerror(err) << dendl;
- ceph_assert(0 == "error during fsync of op_seq");
+ ceph_abort_msg("error during fsync of op_seq");
}
}
if (int n = snprintf(filename, sizeof(filename), "%s/%s", fn, de->d_name);
n >= static_cast<int>(sizeof(filename))) {
derr << __func__ << " path length overrun: " << n << dendl;
- ceph_assert(false);
+ ceph_abort();
}
r = ::stat(filename, &sb);
<< oldcid << "/" << oldoid << " (dne, ignoring enoent)"
<< dendl;
} else {
- ceph_assert(0 == "ERROR: source must exist");
+ ceph_abort_msg("ERROR: source must exist");
}
if (!replaying) {
if (op != op_submitted + 1) {
dout(0) << "op_submit_finish " << op << " expected " << (op_submitted + 1)
<< ", OUT OF ORDER" << dendl;
- ceph_assert(0 == "out of order op_submit_finish");
+ ceph_abort_msg("out of order op_submit_finish");
}
op_submitted = op;
lock.Unlock();
fd_limits.second =
cct->_conf->filestore_wbthrottle_xfs_inodes_hard_limit;
} else {
- ceph_assert(0 == "invalid value for fs");
+ ceph_abort_msg("invalid value for fs");
}
cond.Signal();
}
}
}
}
- ceph_assert(0 == "unreachable");
+ ceph_abort_msg("unreachable");
return 0;
}
int from_fd,
uint64_t from_offset, uint64_t from_len)
{
- ceph_assert(0 == "write me");
+ ceph_abort_msg("write me");
}
int FS::zero(int fd, uint64_t offset, uint64_t length)
default:
derr << __func__ << " unexpected txc " << txc
<< " state " << txc->get_state_name() << dendl;
- ceph_assert(0 == "unexpected txc state");
+ ceph_abort_msg("unexpected txc state");
return;
}
}
break;
case Transaction::OP_SPLIT_COLLECTION:
- ceph_assert(0 == "deprecated");
+ ceph_abort_msg("deprecated");
break;
case Transaction::OP_SPLIT_COLLECTION2:
break;
case Transaction::OP_COLL_RENAME:
- ceph_assert(0 == "not implemented");
+ ceph_abort_msg("not implemented");
break;
}
if (r < 0) {
f.close_section();
f.flush(*_dout);
*_dout << dendl;
- ceph_assert(0 == "unexpected error");
+ ceph_abort_msg("unexpected error");
}
// object operations
break;
case Transaction::OP_CLONERANGE:
- ceph_assert(0 == "deprecated");
+ ceph_abort_msg("deprecated");
break;
case Transaction::OP_CLONERANGE2:
break;
case Transaction::OP_COLL_ADD:
- ceph_assert(0 == "not implemented");
+ ceph_abort_msg("not implemented");
break;
case Transaction::OP_COLL_REMOVE:
- ceph_assert(0 == "not implemented");
+ ceph_abort_msg("not implemented");
break;
case Transaction::OP_COLL_MOVE:
- ceph_assert(0 == "deprecated");
+ ceph_abort_msg("deprecated");
break;
case Transaction::OP_COLL_MOVE_RENAME:
f.close_section();
f.flush(*_dout);
*_dout << dendl;
- ceph_assert(0 == "unexpected error");
+ ceph_abort_msg("unexpected error");
}
}
}
break;
case Transaction::OP_COLL_MOVE:
- ceph_assert(0 == "deprecated");
+ ceph_abort_msg("deprecated");
break;
case Transaction::OP_COLL_MOVE_RENAME:
case Transaction::OP_COLL_SETATTR:
{
- ceph_assert(0 == "not implemented");
+ ceph_abort_msg("not implemented");
}
break;
case Transaction::OP_COLL_RMATTR:
{
- ceph_assert(0 == "not implemented");
+ ceph_abort_msg("not implemented");
}
break;
case Transaction::OP_COLL_RENAME:
{
- ceph_assert(0 == "not implemented");
+ ceph_abort_msg("not implemented");
}
break;
}
break;
case Transaction::OP_SPLIT_COLLECTION:
- ceph_assert(0 == "deprecated");
+ ceph_abort_msg("deprecated");
break;
case Transaction::OP_SPLIT_COLLECTION2:
{
f.close_section();
f.flush(*_dout);
*_dout << dendl;
- ceph_assert(0 == "unexpected error");
+ ceph_abort_msg("unexpected error");
}
}
case ECBackend::pipeline_state_t::CACHE_INVALID:
return lhs << "CACHE_INVALID";
default:
- ceph_assert(0 == "invalid pipeline state");
+ ceph_abort_msg("invalid pipeline state");
}
return lhs; // unreachable
}
ceph_assert(head->ssc);
h->ops.back().recovery_info.ss = head->ssc->snapset;
} else {
- ceph_assert(0 == "neither obc nor head set for a snap object");
+ ceph_abort_msg("neither obc nor head set for a snap object");
}
}
h->ops.back().recovery_progress.omap_complete = true;
if (!agent_queue.empty()) {
set<PGRef>& top = agent_queue.rbegin()->second;
derr << "agent queue not empty, for example " << (*top.begin())->get_pgid() << dendl;
- ceph_assert(0 == "agent queue not empty");
+ ceph_abort_msg("agent queue not empty");
}
agent_stop_flag = true;
}
f->close_section();
} else {
- ceph_assert(0 == "broken asok registration");
+ ceph_abort_msg("broken asok registration");
}
f->flush(ss);
delete f;
derr << __func__ << ": have pgid " << pgid << " at epoch "
<< map_epoch << ", but missing map. Crashing."
<< dendl;
- ceph_assert(0 == "Missing map in load_pgs");
+ ceph_abort_msg("Missing map in load_pgs");
}
}
pg = _make_pg(pgosdmap, pgid);
inc.decode(p);
if (o->apply_incremental(inc) < 0) {
derr << "ERROR: bad fsid? i have " << osdmap->get_fsid() << " and inc has " << inc.fsid << dendl;
- ceph_assert(0 == "bad fsid");
+ ceph_abort_msg("bad fsid");
}
bufferlist fbl;
continue;
}
- ceph_assert(0 == "MOSDMap lied about what maps it had?");
+ ceph_abort_msg("MOSDMap lied about what maps it had?");
}
// even if this map isn't from a mon, we may have satisfied our subscription
}
}
} else {
- ceph_assert(0 == "unhandled pool type");
+ ceph_abort_msg("unhandled pool type");
}
}
}
derr << info.pgid << " past_intervals [" << apib
<< ") start interval does not contain the required"
<< " bound [" << rpib << ") start" << dendl;
- ceph_assert(0 == "past_interval start interval mismatch");
+ ceph_abort_msg("past_interval start interval mismatch");
}
if (apib.second != rpib.second) {
osd->clog->error() << info.pgid << " past_interal bound [" << apib
derr << info.pgid << " past_interal bound [" << apib
<< ") end does not match required [" << rpib
<< ") end" << dendl;
- ceph_assert(0 == "past_interval end mismatch");
+ ceph_abort_msg("past_interval end mismatch");
}
}
}
if (info_struct_v < compat_struct_v) {
derr << "PG needs upgrade, but on-disk data is too old; upgrade to"
<< " an older version first." << dendl;
- ceph_assert(0 == "PG too old to upgrade");
+ ceph_abort_msg("PG too old to upgrade");
}
last_written_info = info;
decode(oi, bliter);
} catch (...) {
dout(0) << __func__ << ": Need version of replica, bad object_info_t: " << soid << dendl;
- ceph_assert(0);
+ ceph_abort();
}
if (bad_peer != primary) {
peer_missing[bad_peer].add(soid, oi.version, eversion_t(), false);
NamedState(context< RecoveryMachine >().pg, "Crashed")
{
context< RecoveryMachine >().log_enter(state_name);
- ceph_assert(0 == "we got a bad state machine event");
+ ceph_abort_msg("we got a bad state machine event");
}
return true;
}
}
- ceph_assert(0 == "in extra_caller_ops but not extra_reqids");
+ ceph_abort_msg("in extra_caller_ops but not extra_reqids");
}
if (!(indexed_data & PGLOG_INDEXED_DUPS)) {
<< i.first << " " << i.second
<< " last_backfill = " << info.last_backfill
<< dendl;
- ceph_assert(0 == "invalid missing set entry found");
+ ceph_abort_msg("invalid missing set entry found");
}
bufferlist bv;
int r = store->getattr(
return BufferUpdate::Zero{z.len + r->len};
},
[&](const BufferUpdate::CloneRange &c) -> BufferUpdateType {
- ceph_assert(0 == "violates can_merge condition");
+ ceph_abort_msg("violates can_merge condition");
return left;
});
}
break;
default:
- ceph_assert(0 == "bad message type in do_request");
+ ceph_abort_msg("bad message type in do_request");
}
}
return cache_result_t::NOOP;
}
default:
- ceph_assert(0 == "unrecognized manifest type");
+ ceph_abort_msg("unrecognized manifest type");
}
return cache_result_t::NOOP;
return cache_result_t::HANDLED_PROXY;
}
- ceph_assert(0 == "unreachable");
+ ceph_abort_msg("unreachable");
return cache_result_t::NOOP;
case pg_pool_t::CACHEMODE_FORWARD:
return cache_result_t::HANDLED_PROXY;
default:
- ceph_assert(0 == "unrecognized cache_mode");
+ ceph_abort_msg("unrecognized cache_mode");
}
return cache_result_t::NOOP;
}
soid = obc->obs.oi.manifest.redirect_target;
break;
default:
- ceph_assert(0 == "unrecognized manifest type");
+ ceph_abort_msg("unrecognized manifest type");
}
} else {
/* proxy */
soid = obc->obs.oi.manifest.redirect_target;
break;
default:
- ceph_assert(0 == "unrecognized manifest type");
+ ceph_abort_msg("unrecognized manifest type");
}
} else {
/* proxy */
if (chunk_index <= req_offset) {
osd_op.op.extent.offset = manifest->chunk_map[chunk_index].offset + req_offset - chunk_index;
} else {
- ceph_assert(0 == "chunk_index > req_offset");
+ ceph_abort_msg("chunk_index > req_offset");
}
osd_op.op.extent.length = req_length;
promote_callback->promote_results.get<1>(),
promote_callback->obc);
} else {
- ceph_assert(0 == "unrecognized manifest type");
+ ceph_abort_msg("unrecognized manifest type");
}
return 0;
}
src_hoid = obc->obs.oi.manifest.redirect_target;
cb = new PromoteCallback(obc, this);
} else {
- ceph_assert(0 == "unrecognized manifest type");
+ ceph_abort_msg("unrecognized manifest type");
}
}
dout(20) << " op order client." << n << " tid " << t << " last was " << p->second << dendl;
if (p->second > t) {
derr << "bad op order, already applied " << p->second << " > this " << t << dendl;
- ceph_assert(0 == "out of order op");
+ ceph_abort_msg("out of order op");
}
p->second = t;
}
src_hoid = obs.oi.manifest.redirect_target;
cb = new PromoteManifestCallback(ctx->obc, this, ctx);
} else {
- ceph_assert(0 == "unrecognized manifest type");
+ ceph_abort_msg("unrecognized manifest type");
}
ctx->op_finishers[ctx->current_osd_subop_num].reset(
new PromoteFinisher(cb));
}
});
} else {
- ceph_assert(0 == "unrecognized manifest type");
+ ceph_abort_msg("unrecognized manifest type");
}
oi.clear_flag(object_info_t::FLAG_MANIFEST);
block_write_on_full_cache(soid, ctx->op);
return -EAGAIN;
case cache_result_t::REPLIED_WITH_EAGAIN:
- ceph_assert(0 == "this can't happen, no rollback on replica");
+ ceph_abort_msg("this can't happen, no rollback on replica");
default:
- ceph_assert(0 == "must promote was set, other values are not valid");
+ ceph_abort_msg("must promote was set, other values are not valid");
return -EAGAIN;
}
}
}
} else if (ret) {
// ummm....huh? It *can't* return anything else at time of writing.
- ceph_assert(0 == "unexpected error code in _rollback_to");
+ ceph_abort_msg("unexpected error code in _rollback_to");
} else { //we got our context, let's use it to do the rollback!
hobject_t& rollback_to_sobject = rollback_to->obs.oi.soid;
if (is_degraded_or_backfilling_object(rollback_to_sobject) ||
auto p = obc->obs.oi.manifest.chunk_map.begin();
_copy_some_manifest(obc, cop, p->first);
} else {
- ceph_assert(0 == "unrecognized manifest type");
+ ceph_abort_msg("unrecognized manifest type");
}
}
}
if (!tctx->lock_manager.take_write_lock(
head,
obc)) {
- ceph_assert(0 == "problem!");
+ ceph_abort_msg("problem!");
}
dout(20) << __func__ << " took lock on obc, " << obc->rwstate << dendl;
if (!tctx->lock_manager.take_write_lock(
obc->obs.oi.soid,
obc)) {
- ceph_assert(0 == "problem!");
+ ceph_abort_msg("problem!");
}
dout(20) << __func__ << " took lock on obc, " << obc->rwstate << dendl;
switch (what) {
case pg_log_entry_t::LOST_MARK:
- ceph_assert(0 == "actually, not implemented yet!");
+ ceph_abort_msg("actually, not implemented yet!");
break;
case pg_log_entry_t::LOST_REVERT:
projected_log.scan_log_after(bi->version, func);
bi->version = projected_last_update;
} else {
- ceph_assert(0 == "scan_range should have raised bi->version past log_tail");
+ ceph_abort_msg("scan_range should have raised bi->version past log_tail");
}
}
if (r != -ENOENT) {
derr << __func__ << " " << p->soid << " exists, but should have been "
<< "deleted" << dendl;
- ceph_assert(0 == "erroneously present object");
+ ceph_abort_msg("erroneously present object");
}
} else {
// ignore old(+missing) objects
if (r != 0 && r != -ENOENT) {
lderr(pg->cct) << "get_next_objects_to_trim returned "
<< cpp_strerror(r) << dendl;
- ceph_assert(0 == "get_next_objects_to_trim returned an invalid code");
+ ceph_abort_msg("get_next_objects_to_trim returned an invalid code");
} else if (r == -ENOENT) {
// Done!
ldout(pg->cct, 10) << "got ENOENT" << dendl;
logger->inc(l_osd_sop_push_inb, inb);
logger->tinc(l_osd_sop_push_lat, latency);
} else
- ceph_assert("no support subop" == 0);
+ ceph_abort_msg("no support subop");
} else {
logger->tinc(l_osd_sop_pull_lat, latency);
}
Context *on_complete,
bool fast_read)
{
- ceph_assert(0 == "async read is not used by replica pool");
+ ceph_abort_msg("async read is not used by replica pool");
}
class C_OSD_OnOpCommit : public Context {
case FLUSH_MODE_IDLE: return "idle";
case FLUSH_MODE_LOW: return "low";
case FLUSH_MODE_HIGH: return "high";
- default: ceph_assert(0 == "bad flush mode");
+ default: ceph_abort_msg("bad flush mode");
}
}
const char *get_flush_mode_name() const {
case EVICT_MODE_IDLE: return "idle";
case EVICT_MODE_SOME: return "some";
case EVICT_MODE_FULL: return "full";
- default: ceph_assert(0 == "bad evict mode");
+ default: ceph_abort_msg("bad evict mode");
}
}
const char *get_evict_mode_name() const {
case RWEXCL:
return false;
default:
- ceph_assert(0 == "unhandled case");
+ ceph_abort_msg("unhandled case");
return false;
}
}
case RWEXCL:
return false;
default:
- ceph_assert(0 == "unhandled case");
+ ceph_abort_msg("unhandled case");
return false;
}
}
case RWEXCL:
return false;
default:
- ceph_assert(0 == "unhandled case");
+ ceph_abort_msg("unhandled case");
return false;
}
}
case RWState::RWEXCL:
return get_excl(op);
default:
- ceph_assert(0 == "invalid lock type");
+ ceph_abort_msg("invalid lock type");
return true;
}
}
rwstate.put_excl(to_wake);
break;
default:
- ceph_assert(0 == "invalid lock type");
+ ceph_abort_msg("invalid lock type");
}
if (rwstate.empty() && rwstate.recovery_read_marker) {
rwstate.recovery_read_marker = false;
_str = pgid.calc_name(_str_buff + spg_t::calc_name_buf_size - 1, "PMET_");
break;
default:
- ceph_assert(0 == "unknown collection type");
+ ceph_abort_msg("unknown collection type");
}
}
case 0:
break;
case 1:
- ceph_assert(0 == "pi_simple_rep support removed post-luminous");
+ ceph_abort_msg("pi_simple_rep support removed post-luminous");
break;
case 2:
past_intervals.reset(new pi_compact_rep);
break;
}
default:
- ceph_assert(0 == "Invalid rollback code");
+ ceph_abort_msg("Invalid rollback code");
}
DECODE_FINISH(bp);
}
} catch (...) {
- ceph_assert(0 == "Invalid encoding");
+ ceph_abort_msg("Invalid encoding");
}
}
case CACHEMODE_READPROXY:
return true;
default:
- ceph_assert(0 == "implement me");
+ ceph_abort_msg("implement me");
}
}
case TYPE_ERASURE:
return false;
default:
- ceph_assert(0 == "unhandled pool type");
+ ceph_abort_msg("unhandled pool type");
}
}
virtual void iterate_all_intervals(
std::function<void(const pg_interval_t &)> &&f) const {
ceph_assert(!has_full_intervals());
- ceph_assert(0 == "not valid for this implementation");
+ ceph_abort_msg("not valid for this implementation");
}
virtual ~interval_rep() {}
lderr(cct) << __func__ << ": multiple write errors, handler already called"
<< dendl;
} else {
- ceph_assert(0 == "unhandled write error");
+ ceph_abort_msg("unhandled write error");
}
}
stat_error += bh->length();
break;
default:
- ceph_assert(0 == "bh_stat_add: invalid bufferhead state");
+ ceph_abort_msg("bh_stat_add: invalid bufferhead state");
}
if (get_stat_dirty_waiting() > 0)
stat_cond.Signal();
stat_error -= bh->length();
break;
default:
- ceph_assert(0 == "bh_stat_sub: invalid bufferhead state");
+ ceph_abort_msg("bh_stat_sub: invalid bufferhead state");
}
}
#include <array>
#include <atomic>
#include <memory>
-#include <cassert>
+
+#include "include/assert.h"
class PerfHistogramCommon {
public:
int i = 0;
for (const auto &ac : axes_config) {
- ceph_assert(ac.m_buckets > 0 && "Must have at least one bucket on axis");
- ceph_assert(ac.m_quant_size > 0 &&
- "Quantization unit must be non-zero positive integer value");
+ ceph_assertf(ac.m_buckets > 0,
+ "Must have at least one bucket on axis");
+ ceph_assertf(ac.m_quant_size > 0,
+ "Quantization unit must be non-zero positive integer value");
m_axes_config[i++] = ac;
}
static_assert(sizeof...(T) == DIM, "Incorrect number of arguments");
return get_raw_index_internal<0>(
[](int64_t bucket, const axis_config_d &ac) {
- ceph_assert(bucket >= 0 && "Bucket index can not be negative");
- ceph_assert(bucket < ac.m_buckets && "Bucket index too large");
+ ceph_assertf(bucket >= 0, "Bucket index can not be negative");
+ ceph_assertf(bucket < ac.m_buckets, "Bucket index too large");
return bucket;
},
0, buckets...);
if (!err.empty()) {
std::cerr << __func__ << " AdminSocketClient::do_request errored with: "
<< err << std::endl;
- ceph_assert(false);
+ ceph_abort();
}
return std::make_pair(command, output);
}
g_conf().set_val("compressor_zlib_isal", "false");
g_ceph_context->_conf.apply_changes(nullptr);
} else {
- ceph_assert(0 == "bad option");
+ ceph_abort_msg("bad option");
}
}
cout << "[plugin " << plugin << " (" << GetParam() << ")]" << std::endl;
break;
default:
// Bad command
- ceph_assert(false);
+ ceph_abort();
}
if (ret != -EAGAIN)
break;
static GetLockerRequest* create(librados::IoCtx& ioctx,
const std::string& oid, bool exclusive,
Locker *locker, Context *on_finish) {
- ceph_assert(0 == "unexpected call");
+ ceph_abort_msg("unexpected call");
}
void send() {
- ceph_assert(0 == "unexpected call");
+ ceph_abort_msg("unexpected call");
}
};
bool exclusive, bool blacklist_locker,
uint32_t blacklist_expire_seconds,
bool force_break_lock, Context *on_finish) {
- ceph_assert(0 == "unexpected call");
+ ceph_abort_msg("unexpected call");
}
void send() {
- ceph_assert(0 == "unexpected call");
+ ceph_abort_msg("unexpected call");
}
};
if (pgs.count(pgid) == 0) {
derr << __func__
<< " pgid " << pgid << " not on our map" << dendl;
- ceph_assert(0 == "pgid not on our map");
+ ceph_abort_msg("pgid not on our map");
}
pg_stat_t &s = pgs[pgid];
mstats->pg_stat[pgid] = s;
derr << "osd." << whoami << "::" << __func__
<< "** ERROR: applying incremental: "
<< cpp_strerror(err) << dendl;
- ceph_assert(0 == "error applying incremental");
+ ceph_abort_msg("error applying incremental");
}
}
dout(30) << __func__ << "\nosdmap:\n";
if (i++ % 50 == 0)
print_internal_state(true);
if (timeout_us < 0)
- ceph_assert(0 == " loop time exceed 5 mins, it looks we stuck into some problems!");
+ ceph_abort_msg(" loop time exceed 5 mins, it looks we stuck into some problems!");
}
for (set<Messenger*>::iterator it = available_servers.begin();
it != available_servers.end(); ++it) {
default:
cout << "bad op " << op << std::endl;
- ceph_assert(0 == "bad op");
+ ceph_abort_msg("bad op");
}
return ok;
}
return it->first;
}
}
- ceph_assert(0 == "INTERNAL ERROR");
+ ceph_abort_msg("INTERNAL ERROR");
}
cerr << "- " << *p << std::endl;
//cerr << " objects_set: " << objects_set << std::endl;
//cerr << " available_set: " << available_objects << std::endl;
- ceph_assert(0 == "badness");
+ ceph_abort_msg("badness");
}
ASSERT_EQ(objects_set.size(), available_objects.size());
cerr << "Error: racing read on " << oid << " returned version "
<< rcompletion->get_version64() << " rather than version "
<< version << std::endl;
- ceph_assert(0 == "racing read got wrong version");
+ ceph_abort_msg("racing read got wrong version");
}
{
cerr << "Error: racing read on " << oid << " returned version "
<< rcompletion->get_version64() << " rather than version "
<< version << std::endl;
- ceph_assert(0 == "racing read got wrong version");
+ ceph_abort_msg("racing read got wrong version");
}
{
}
if (old_value.deleted()) {
std::cout << num << ": expect deleted" << std::endl;
- ceph_assert(0 == "expected deleted");
+ ceph_abort_msg("expected deleted");
} else {
std::cout << num << ": expect " << old_value.most_recent() << std::endl;
}
if (!retval) {
if (old_value.deleted()) {
std::cout << num << ": expect deleted" << std::endl;
- ceph_assert(0 == "expected deleted");
+ ceph_abort_msg("expected deleted");
} else {
std::cout << num << ": expect " << old_value.most_recent() << std::endl;
}
if (r == 0) {
// sucess
} else {
- ceph_assert(0 == "shouldn't happen");
+ ceph_abort_msg("shouldn't happen");
}
context->update_object_version(oid, completion->get_version64());
context->find_object(oid, &oid_value);
} else if (r == -ENOENT) {
// may have raced with a remove?
} else {
- ceph_assert(0 == "shouldn't happen");
+ ceph_abort_msg("shouldn't happen");
}
context->kick();
done = true;
} else if (r == -ENOENT) {
// may have raced with a remove?
} else {
- ceph_assert(0 == "shouldn't happen");
+ ceph_abort_msg("shouldn't happen");
}
context->kick();
done = true;
if (policy_type == "none" || policy_type == "simple") {
m_policy = image_map::SimplePolicy::create(m_local_io_ctx);
} else {
- ceph_assert(false);
+ ceph_abort();
}
m_policy->init({});
usr2 = true;
break;
default:
- ceph_assert(0 == "unexpected signal");
+ ceph_abort_msg("unexpected signal");
}
}
case DEVICE_TYPE_NBD:
return &nbd_operations;
default:
- ceph_assert(0);
+ ceph_abort();
return nullptr;
}
}
if (policy_type == "none" || policy_type == "simple") {
m_policy.reset(image_map::SimplePolicy::create(m_ioctx));
} else {
- ceph_assert(false); // not really needed as such, but catch it.
+ ceph_abort(); // not really needed as such, but catch it.
}
dout(20) << "mapping policy=" << policy_type << dendl;
}
void encode(bufferlist& bl) const {
- ceph_assert(false);
+ ceph_abort();
}
void decode(__u8 version, bufferlist::const_iterator& it) {