mirror of
https://github.com/ceph/ceph
synced 2025-04-01 23:02:17 +00:00
assert: some more assert_warn
This commit is contained in:
parent
af812a0621
commit
c98bb11a39
@ -72,7 +72,9 @@ int main(int argc, const char **argv)
|
|||||||
cout << "starting mds? at " << rank.get_rank_addr() << std::endl;
|
cout << "starting mds? at " << rank.get_rank_addr() << std::endl;
|
||||||
|
|
||||||
Messenger *m = rank.register_entity(entity_name_t::MDS(whoami));
|
Messenger *m = rank.register_entity(entity_name_t::MDS(whoami));
|
||||||
assert(m);
|
assert_warn(m);
|
||||||
|
if (!m)
|
||||||
|
return 1;
|
||||||
|
|
||||||
rank.set_policy(entity_name_t::TYPE_MON, Rank::Policy::lossy_fail_after(1.0));
|
rank.set_policy(entity_name_t::TYPE_MON, Rank::Policy::lossy_fail_after(1.0));
|
||||||
rank.set_policy(entity_name_t::TYPE_MDS, Rank::Policy::lossless());
|
rank.set_policy(entity_name_t::TYPE_MDS, Rank::Policy::lossless());
|
||||||
|
@ -863,9 +863,10 @@ void parse_config_options(std::vector<const char*>& args, bool open)
|
|||||||
cf.dump();
|
cf.dump();
|
||||||
|
|
||||||
for (unsigned i=0; i<args.size(); i++) {
|
for (unsigned i=0; i<args.size(); i++) {
|
||||||
if (strcmp(args[i],"--bind") == 0)
|
if (strcmp(args[i],"--bind") == 0) {
|
||||||
assert(parse_ip_port(args[++i], g_my_addr));
|
assert_warn(parse_ip_port(args[++i], g_my_addr));
|
||||||
else if (strcmp(args[i], "--nummon") == 0)
|
exit(1);
|
||||||
|
} else if (strcmp(args[i], "--nummon") == 0)
|
||||||
g_conf.num_mon = atoi(args[++i]);
|
g_conf.num_mon = atoi(args[++i]);
|
||||||
else if (strcmp(args[i], "--nummds") == 0)
|
else if (strcmp(args[i], "--nummds") == 0)
|
||||||
g_conf.num_mds = atoi(args[++i]);
|
g_conf.num_mds = atoi(args[++i]);
|
||||||
@ -1337,7 +1338,10 @@ void parse_config_options(std::vector<const char*>& args, bool open)
|
|||||||
if (strcmp(args[i], "linear") == 0) g_conf.osd_object_layout = CEPH_OBJECT_LAYOUT_LINEAR;
|
if (strcmp(args[i], "linear") == 0) g_conf.osd_object_layout = CEPH_OBJECT_LAYOUT_LINEAR;
|
||||||
else if (strcmp(args[i], "hashino") == 0) g_conf.osd_object_layout = CEPH_OBJECT_LAYOUT_HASHINO;
|
else if (strcmp(args[i], "hashino") == 0) g_conf.osd_object_layout = CEPH_OBJECT_LAYOUT_HASHINO;
|
||||||
else if (strcmp(args[i], "hash") == 0) g_conf.osd_object_layout = CEPH_OBJECT_LAYOUT_HASH;
|
else if (strcmp(args[i], "hash") == 0) g_conf.osd_object_layout = CEPH_OBJECT_LAYOUT_HASH;
|
||||||
else assert(0);
|
else {
|
||||||
|
assert_warn(0);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(args[i], "--osd_pg_layout") == 0) {
|
else if (strcmp(args[i], "--osd_pg_layout") == 0) {
|
||||||
@ -1346,7 +1350,10 @@ void parse_config_options(std::vector<const char*>& args, bool open)
|
|||||||
else if (strcmp(args[i], "hash") == 0) g_conf.osd_pg_layout = CEPH_PG_LAYOUT_HASH;
|
else if (strcmp(args[i], "hash") == 0) g_conf.osd_pg_layout = CEPH_PG_LAYOUT_HASH;
|
||||||
else if (strcmp(args[i], "hybrid") == 0) g_conf.osd_pg_layout = CEPH_PG_LAYOUT_HYBRID;
|
else if (strcmp(args[i], "hybrid") == 0) g_conf.osd_pg_layout = CEPH_PG_LAYOUT_HYBRID;
|
||||||
else if (strcmp(args[i], "crush") == 0) g_conf.osd_pg_layout = CEPH_PG_LAYOUT_CRUSH;
|
else if (strcmp(args[i], "crush") == 0) g_conf.osd_pg_layout = CEPH_PG_LAYOUT_CRUSH;
|
||||||
else assert(0);
|
else {
|
||||||
|
assert_warn(0);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(args[i], "--kill_after") == 0)
|
else if (strcmp(args[i], "--kill_after") == 0)
|
||||||
|
@ -131,9 +131,13 @@ int main(int argc, const char **argv)
|
|||||||
g_timer.shutdown();
|
g_timer.shutdown();
|
||||||
|
|
||||||
Messenger *m = rank.register_entity(entity_name_t::OSD(whoami));
|
Messenger *m = rank.register_entity(entity_name_t::OSD(whoami));
|
||||||
assert(m);
|
assert_warn(m);
|
||||||
|
if (!m)
|
||||||
|
return 1;
|
||||||
Messenger *hbm = rank.register_entity(entity_name_t::OSD(whoami));
|
Messenger *hbm = rank.register_entity(entity_name_t::OSD(whoami));
|
||||||
assert(hbm);
|
assert_warn(hbm);
|
||||||
|
if (!hbm)
|
||||||
|
return 1;
|
||||||
|
|
||||||
rank.set_policy(entity_name_t::TYPE_MON, Rank::Policy::lossy_fast_fail());
|
rank.set_policy(entity_name_t::TYPE_MON, Rank::Policy::lossy_fast_fail());
|
||||||
rank.set_policy(entity_name_t::TYPE_OSD, Rank::Policy::lossless());
|
rank.set_policy(entity_name_t::TYPE_OSD, Rank::Policy::lossless());
|
||||||
|
@ -51,6 +51,9 @@ extern void __ceph_assert_warn(const char *assertion, const char *file, int line
|
|||||||
((expr) \
|
((expr) \
|
||||||
? __CEPH_ASSERT_VOID_CAST (0) \
|
? __CEPH_ASSERT_VOID_CAST (0) \
|
||||||
: __ceph_assert_warn (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION))
|
: __ceph_assert_warn (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION))
|
||||||
|
|
||||||
|
#define assert_protocol(expr) assert(expr)
|
||||||
|
#define assert_disk(expr) assert(expr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user