Some counters' dump functions accept 3 bool parameters to
determine some dumping behavior. And multiple 'bool' parameters
are considered a code smell.
This is a minor refactor to replace one of these bools
with a 'select_labeled_t' enum.
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
Unfortunately, this code is filling 0s at the beginning of the short-read
buffer.
Fixes: https://tracker.ceph.com/issues/62492
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Presently the libcephsqlite library becomes unusable (by design, at the
time) when the RADOS instance it uses is blocklisted. Unfortunately,
it's fairly common for this to happen during disruptive events. For the
ceph-mgr, it's unacceptable to require manual intervention via the
`ceph mgr fail` command.
So, this commit reworks libcephsqlite to reconnect to RADOS when its
cluster handle is blocklisted. This is safe as any open "file" by
sqlite3 has its own ptr to the open cluster handle. So those open files
will all continually fail until sqlite3 closes the handle (on database
connection shutdown). The application can then reopen the database if
desired using the fresh RADOS handle.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Add the ability to dump labeled perf counters
for a daemon. Labeled perf counters are stored
in a CephContext's PerfCountersCollection.
Labeled and unlabeled perf counters are dumped
to the admin socket via `counters dump` command.
The schema for labeled and unlabeled perf
counters are dumped to the admin socket via
`counters schema` command.
This commit includes docs and additional unit tests
Signed-off-by: Ali Maredia <amaredia@redhat.com>
regex in libcephsqlite, when compiled with GCC12 treats '-' as a range
operator resulting in the following error.
"Invalid start of '[x-x]' range in regular expression"
Fixes: https://tracker.ceph.com/issues/55304
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
* 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>
we don't want to set result to zero at the end.
Otherwise, the if above would be useless and the function cannot be used to check the reserved lock.
Fixes: https://tracker.ceph.com/issues/52001
Signed-off-by: Shuai Wang <shuaiw2@andrew.cmu.edu>
We need to tear down the ceph vfs when sqlite3 (or other binaries) call
exit(). Otherwise global state gets destructed which can cause library
threads to segfault or raise exceptions.
Also pull vfs struct out of appdata. We need to be able to detect double
calls to the atexit handler which, sadly, can happen.
Fixes: https://tracker.ceph.com/issues/50503
Fixes: https://tracker.ceph.com/issues/51372
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This magic number was copied from another VFS but was not adjusted for
the xCurrentTimeInt64 interface.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This is a complete rewrite on top of SimpleRADOSStriper as well as the
API. The VFS is now a loadable extension as well.
Fixes: https://tracker.ceph.com/issues/40609
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This library provides a SQLite front-end to the RADOS objects.
This effort will help alleviate the restriction on number of key-value pairs
that can be stored in an object.
This interface is a generic one without any constraint on the database
schema either. Library clients can enforce any schema and use SQLite API
to store data in the database backed by RADOS Objects.
Signed-off-by: Milind Changire <mchangir@redhat.com>