Commit a6cba183 authored by Eric Cano's avatar Eric Cano
Browse files

Disabled the rados based test by default.

Added tolerance to BackendRados::ScopedLock::release() when releasing a deleted object's lock.
Switched back to old style m_radosCtx.objects_begin() for compatibility with older releases of ceph.
parent fd952bb6
......@@ -103,8 +103,8 @@ bool BackendRados::exists(std::string name) {
std::list<std::string> BackendRados::list() {
std::list<std::string> ret;
for (auto o=m_radosCtx.nobjects_begin(); o!=m_radosCtx.nobjects_end(); o++) {
ret.push_back(o->get_oid());
for (auto o=m_radosCtx.objects_begin(); o!=m_radosCtx.objects_end(); o++) {
ret.push_back(o->first);
}
return ret;
}
......@@ -112,10 +112,19 @@ std::list<std::string> BackendRados::list() {
void BackendRados::ScopedLock::release() {
if (!m_lockSet) return;
cta::exception::Errnum::throwOnReturnedErrno(
-m_context.unlock(m_oid, "lock", m_clientId),
std::string("In cta::objectstore::ScopedLock::release, failed unlock ") +
m_oid);
// We should be tolerant with unlocking a deleted object, which is part
// of the lock-remove-(implicit unlock) cycle when we delete an object
// we hence overlook the ENOENT errors.
int rc=m_context.unlock(m_oid, "lock", m_clientId);
switch (-rc) {
case ENOENT:
break;
default:
cta::exception::Errnum::throwOnReturnedErrno(-rc,
std::string("In cta::objectstore::ScopedLock::release, failed unlock ") +
m_oid);
break;
}
m_lockSet = false;
}
......
......@@ -31,6 +31,7 @@ add_library (CTAObjectStore
GarbageCollector.cpp
SchedulerGlobalLock.cpp)
target_link_libraries(CTAObjectStore Utils rados)
set_source_files_properties(BackendRados.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations)
set(ObjectStoreUnitTests
BackendTest.cpp
......
......@@ -644,7 +644,7 @@ INSTANTIATE_TEST_CASE_P(OStoreSchedulerDatabaseTestVFS, SchedulerDatabaseTest,
#endif
#define TEST_RADOS
#undef TEST_RADOS
#ifdef TEST_RADOS
static cta::OStoreDBFactory<cta::objectstore::BackendRados> OStoreDBFactoryRados("rados://tapetest@tapetest");
......
......@@ -2623,7 +2623,7 @@ INSTANTIATE_TEST_CASE_P(OStoreDBPlusMockSchedulerTestVFS, SchedulerTest,
::testing::Values(SchedulerTestParam(mockNsFactory, OStoreDBFactoryVFS)));
#endif
#define TEST_RADOS
#undef TEST_RADOS
#ifdef TEST_RADOS
static cta::OStoreDBFactory<cta::objectstore::BackendRados> OStoreDBFactoryRados("rados://tapetest@tapetest");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment