summaryrefslogtreecommitdiffstats
path: root/src/test/cls_lock (follow)
Commit message (Collapse)AuthorAgeFilesLines
* rgw: adding y2k38 annotations to supress coverity issuesYuval Lifshitz2023-11-051-0/+1
| | | | | | | | | | | the supression comments must be directly above the line where the issue is. this is a followup on these commits: edfb5b9049ee897779863d780bfbaa130a7fbc40 aca2668c88a048ab556c53411dcf2ccd43099d50 Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
* cls_lock: expired lock before unlock and start checkNitzanMordhai2023-08-011-26/+4
| | | | | | | | | If the lock expired, the stat check shouldn't return -ENOENT, We will change the lock duration to prevent lock expired before the stat check. Fixes: https://tracker.ceph.com/issues/56575 Signed-off-by: Nitzan Mordechai <nmordec@redhat.com>
* cls_lock: check expired lock before unlockNitzanMordhai2022-04-131-2/+23
| | | | | | | | Check if the lock was expired, if it is, unlock will return -ENOENT and not 0 that will cause the assert to error. Fixes: https://tracker.ceph.com/issues/38357 Signed-off-by: Nitzan Mordechai <nmordec@redhat.com>
* test: : build without "using namespace std"Kefu Chai2021-08-131-2/+2
| | | | | | | | | | * add "std::" prefix in headers * add "using" declarations in .cc files. so we don't rely on "using namespace std" in one or more included headers. Signed-off-by: Kefu Chai <kchai@redhat.com>
* cls,rados,rbd,mds,common: Avoid name collision with Windows headersLucian Petrut2020-07-081-12/+12
| | | | | | | | | | | | | There are a few name collisions between Windows headers and ceph. Where possible, we'll update Ceph code to avoid redefinitions. The following names overlap with Windows headers: * ERROR, NO_ERROR * DELETE * LocalLock * LOCK_SHARED, LOCK_EXCLUSIVE Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
* librados: revert librados3/libradoscc back to librados2Jason Dillaman2019-02-201-1/+1
| | | | | | | | For backwards compatibility and upgrade reasons, the librados2 API needs to be preserved and it needs to continue to be compatible with dependent libraries like librbd1. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
* rgw: when exclusive lock fails due existing lock, log add'l infoJ. Eric Ivancich2019-02-041-0/+3
| | | | | | | | | | | | | | | | | | This is being added to better understand lock-contention issues in running systems. Here are two sample log output lines: 2019-02-04 14:22:31.228 7f06abb59700 20 <cls> /somedir/ceph/src/cls/lock/cls_lock.cc:221: could not exclusive-lock object, already locked by [{name:client.4139, addr:v1:127.0.0.1:0/2034495868, exp:2019-02-04 14:24:31.0.22272s}] 2019-02-04 14:22:37.219 7f06abb59700 20 <cls> /somedir/ceph/src/cls/lock/cls_lock.cc:221: could not exclusive-lock object, already locked by [{name:client.4147, addr:v1:127.0.0.1:0/141966515, exp:never}] Fixes: http://tracker.ceph.com/issues/38171 Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
* librados: move C++ APIs into libradosppKefu Chai2018-11-012-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the goal is to decouple C++ API from C API, and to version them differently, as they are targeting different consumers. this allows us to change the C++ API and bumping up its soversion without requiring consumer to recompile the librados client for using the new librados. in this way, C++ API can move faster than C API. for example, if bufferlist interface is changed for better performance, and this breaks existing API/ABI, we can bump up the C++ library's soversion, and and the C library's version unchanged but ship the new librados's C binding. so the librados client linked against librados's C library will be able to take advantage of the improvement in C++ library. while the librados client linked against C++ library won't break at runtime due to unresolved symbol or changed structure layout. this is massive change, the genereal idea is to * split librados.cc into two source files: librados_c.cc and librados_cxx.cc, the former for implementing C APIs, the later for C++ APIs. * extract the C++ API in librados into librados-cxx, the library name will be libradospp. but we can change it before nautilus is released. * link these librados libraries with static libraries which it depends on, so "-Wl,--exclude-libs,ALL" link flags can help hide the non-public symbols. * extract the tests exercising librados' C++ API into a different source file named *_cxx.cc. for instance, to move the C++ tests in aio.cc into aio_cxx.cc * extract the shared helper functions which do not use any librados or librados-cxx APIs into test_shared{.cc,h}. the "shared" here means, *shared* by C++ and C tests. * extract the test fixtures, i.e., the subclasses of testing::Test, for testing C++ APIs into testcase_cxx.cc. * update qa/workunits/rados/test.sh accordingly to add the splitted tests * update the consumers of librados to link against librados-cxx instead, if they are using the C++ API. Signed-off-by: Kefu Chai <kchai@redhat.com>
* cls: add exclusive ephemeral locks that auto-cleanJ. Eric Ivancich2018-10-261-0/+106
| | | | | | | | | Add a new type of cls lock -- exclusive ephemeral for which the object only exists to represent the lock and for which the object should be deleted at unlock. This is to prevent the accumulation of unneeded objects in the cluster by automatically cleaning them up. Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
* cls: add semantics for cls locks to require renewal without expiringJ. Eric Ivancich2018-10-241-3/+69
| | | | | | | | | | | Add ability to *require* renewal of an existing lock in addition toexisting ability to *allow* renewal of an existing lock. The key difference is that a MUST_RENEW will fail if the lock has expired (where a MAY_RENEW) will succeed. This provides calling code with the ability to verify that a lock is held continually and that it was never lost/expired. Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
* cmake: link against gtest in a better wayKefu Chai2018-08-171-2/+0
| | | | | | | | | | | | | | * add FindGMock.cmake which allows user to use the libgtest-dev shipped by distro * add GMock::{GMock,Main}, GTest::{GTest,Main} targets to be compatible with FindGTest.cmake and FindGMock.cmake, which expose the built libraries with properties adhered to them. so the consumer of them can import them in a better way. * update tests to drop the commands like set_target_properties(foo PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}), as they are already linked against gmock and gtest. Signed-off-by: Kefu Chai <kchai@redhat.com>
* test: add explicit braces to avoid ambiguous ‘else’ and to silence warningsJos Collin2017-04-121-2/+4
| | | | | | | | | The following warning appears during make for several files in the test submodule: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] Fixed the review comment too. Signed-off-by: Jos Collin <jcollin@redhat.com>
* common: Unskew clockAdam C. Emerson2016-12-221-2/+2
| | | | | | | | In preparation to deglobalizing CephContext, remove the CephContext* parameter to ceph_clock_now() and ceph::real_clock::now() that carries a configurable offset. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* cls_lock: support updating the lock cookie without releasing the lockJason Dillaman2016-08-231-0/+51
| | | | | Fixes: http://tracker.ceph.com/issues/17015 Signed-off-by: Jason Dillaman <dillaman@redhat.com>
* cmake: install some of ceph_test_* and more testsKefu Chai2016-06-091-1/+3
| | | | | | they are used by qa units and some other ceph-qa-suite tasks. Signed-off-by: Kefu Chai <kchai@redhat.com>
* cmake: fix linkage of ceph_test_cls_${name}Kefu Chai2016-06-041-1/+1
| | | | | | | they should link against cls_${name}_client, instead of against cls_${name} directly. Signed-off-by: Kefu Chai <kchai@redhat.com>
* cmake: moved tests into test/cls_lock dirAli Maredia2016-04-151-0/+17
| | | | | | Added a CMakeLists.txt into test/cls_lock. Signed-off-by: Ali Maredia <amaredia@redhat.com>
* cls_lock: New assert_locked operationJason Dillaman2015-01-251-0/+40
| | | | | | | | | The assert_locked operation can be combined with other RADOS ops to prevent an update to a locked object when the client doesn't own the lock. It will not attempt to acquire the lock if the object is not currently locked. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
* cls_lock: fix duration testSage Weil2013-07-181-3/+12
| | | | | | | | | | It's possible for us to just be really slow when getting the reply to the first op or doing the second op, resulting in a successful lock. If we do get a success, assert that at least that amount of time has passed to avoid any false positives. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
* librados: test/rados-api/* -> test/librados/*Sage Weil2012-11-041-1/+1
| | | | Signed-off-by: Sage Weil <sage@inktank.com>
* cls_lock: reorg test_cls_lockSage Weil2012-11-041-0/+291
Signed-off-by: Sage Weil <sage@inktank.com>