Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XrdCeph: added more logging when initialisation fails #562

Merged
merged 1 commit into from
Aug 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/XrdCeph/XrdCephPosix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,18 +438,21 @@ inline librados::Rados* checkAndCreateCluster(unsigned int cephPoolIdx,
}
int rc = cluster->init(userId.c_str());
if (rc) {
logwrapper((char*)"checkAndCreateCluster : cluster init failed");
delete cluster;
return 0;
}
rc = cluster->conf_read_file(NULL);
if (rc) {
logwrapper((char*)"checkAndCreateCluster : cluster read config failed, rc = %d", rc);
cluster->shutdown();
delete cluster;
return 0;
}
cluster->conf_parse_env(NULL);
rc = cluster->connect();
if (rc) {
logwrapper((char*)"checkAndCreateCluster : cluster connect failed, rc = %d", rc);
cluster->shutdown();
delete cluster;
return 0;
Expand All @@ -467,18 +470,21 @@ int checkAndCreateStriper(unsigned int cephPoolIdx, std::string &userAtPool, con
// Get a cluster
librados::Rados* cluster = checkAndCreateCluster(cephPoolIdx, file.userId);
if (0 == cluster) {
logwrapper((char*)"checkAndCreateStriper : checkAndCreateCluster failed");
return 0;
}
// create IoCtx for our pool
librados::IoCtx *ioctx = new librados::IoCtx;
if (0 == ioctx) {
logwrapper((char*)"checkAndCreateStriper : IoCtx instantiation failed");
cluster->shutdown();
delete cluster;
g_cluster[cephPoolIdx] = 0;
return 0;
}
int rc = g_cluster[cephPoolIdx]->ioctx_create(file.pool.c_str(), *ioctx);
if (rc != 0) {
logwrapper((char*)"checkAndCreateStriper : ioctx_create failed, rc = %d", rc);
cluster->shutdown();
delete cluster;
g_cluster[cephPoolIdx] = 0;
Expand All @@ -488,6 +494,7 @@ int checkAndCreateStriper(unsigned int cephPoolIdx, std::string &userAtPool, con
// create RadosStriper connection
libradosstriper::RadosStriper *striper = new libradosstriper::RadosStriper;
if (0 == striper) {
logwrapper((char*)"checkAndCreateStriper : RadosStriper instantiation failed");
delete ioctx;
cluster->shutdown();
delete cluster;
Expand All @@ -496,6 +503,7 @@ int checkAndCreateStriper(unsigned int cephPoolIdx, std::string &userAtPool, con
}
rc = libradosstriper::RadosStriper::striper_create(*ioctx, striper);
if (rc != 0) {
logwrapper((char*)"checkAndCreateStriper : striper_create failed, rc = %d", rc);
delete striper;
delete ioctx;
cluster->shutdown();
Expand All @@ -506,7 +514,7 @@ int checkAndCreateStriper(unsigned int cephPoolIdx, std::string &userAtPool, con
// setup layout
rc = striper->set_object_layout_stripe_count(file.nbStripes);
if (rc != 0) {
logwrapper((char*)"getRadosStriper : invalid nbStripes %d", file.nbStripes);
logwrapper((char*)"checkAndCreateStriper : invalid nbStripes %d", file.nbStripes);
delete striper;
delete ioctx;
cluster->shutdown();
Expand All @@ -516,7 +524,7 @@ int checkAndCreateStriper(unsigned int cephPoolIdx, std::string &userAtPool, con
}
rc = striper->set_object_layout_stripe_unit(file.stripeUnit);
if (rc != 0) {
logwrapper((char*)"getRadosStriper : invalid stripeUnit %d (must be non0, multiple of 64K)", file.stripeUnit);
logwrapper((char*)"checkAndCreateStriper : invalid stripeUnit %d (must be non 0, multiple of 64K)", file.stripeUnit);
delete striper;
delete ioctx;
cluster->shutdown();
Expand All @@ -526,7 +534,7 @@ int checkAndCreateStriper(unsigned int cephPoolIdx, std::string &userAtPool, con
}
rc = striper->set_object_layout_object_size(file.objectSize);
if (rc != 0) {
logwrapper((char*)"getRadosStriper : invalid objectSize %d (must be non 0, multiple of stripe_unit)", file.objectSize);
logwrapper((char*)"checkAndCreateStriper : invalid objectSize %d (must be non 0, multiple of stripe_unit)", file.objectSize);
delete striper;
delete ioctx;
cluster->shutdown();
Expand All @@ -550,6 +558,7 @@ static libradosstriper::RadosStriper* getRadosStriper(const CephFile& file) {
std::string userAtPool = ss.str();
unsigned int cephPoolIdx = getCephPoolIdxAndIncrease();
if (checkAndCreateStriper(cephPoolIdx, userAtPool, file) == 0) {
logwrapper((char*)"getRadosStriper : checkAndCreateStriper failed");
return 0;
}
return g_radosStripers[cephPoolIdx][userAtPool];
Expand Down Expand Up @@ -878,6 +887,7 @@ int ceph_posix_fstat(int fd, struct stat *buf) {
// mode is set arbitrarily to 0666 | S_IFREG
libradosstriper::RadosStriper *striper = getRadosStriper(*fr);
if (0 == striper) {
logwrapper((char*)"ceph_stat: getRadosStriper failed");
return -EINVAL;
}
memset(buf, 0, sizeof(*buf));
Expand Down