we pack the asset() params for smaller code size, but this creates a
inlined `assert_data_ctx` instance for every compilation unit which
call ceph_assert() defined in .h .
__PRETTY_FUNCTION__ is likely to be referenced by `assert_data_ctx`
sections which are included by different compiled object files. if the
ceph_assert() call is used by header file, then there will be multiple
`assert_data_ctx` sections sharing the same identifier. these sections are
defined as "COMDAT" group sections, i.e. common data sections. when linker
see multiple COMDAT sections with the same identifer, it will simply discard
the duplicated ones, and only keep a single copy of them. without enabling
ASan, GCC can always handle this problem just fine. but the dedup feature
does not work well with ASan. if ASan is enabled, and we link the objects
with the wrong order, some references will be pointing to the discarded
sections.
to address this issue, we could audit the link command line and inspect
all .o files to make sure they are properly ordered. but this is
non-trivial. as a workaround, in this change, the assert params are not
packed, and sent to the __ceph_assert_fail() overrides which accepts
unpacked params directly, so the COMDAT section is not created.
Signed-off-by: Kefu Chai <kchai@redhat.com>
If there is a workunit task associated with the same client, the two
tasks will attempt to clone the suite repo to the same directory.
Worse, if it's parallel tasks, the two clones will clobber each
other.
Fixes: http://tracker.ceph.com/issues/36542
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
- rename from foo to bar
- foo onode is moved to bar in onode_map
- keys removed at position foo as part of txc
- new onode for foo is installed at foo in map
...
- cache trims foo
...
- new txn B does get_onode on foo, reads old foo (now bar) onode into foo ***
- txn A commits
-> onode cache has foo with stale bar content
Fix by holding a ref to the replacement foo onode so that get_onode cannot
read stale metadata out of kvdb before txn A commits.
Fixes: http://tracker.ceph.com/issues/36541
Signed-off-by: Sage Weil <sage@redhat.com>
ErasureCodeProfileService was being provided twice and that was causing
problems in production mode.
Fixes: https://tracker.ceph.com/issues/36544
Signed-off-by: Tiago Melo <tmelo@suse.com>
When initializing the Device structure, it have to run is_valid() to
ensure the data structures (_is_valid & rejected_reasons) to be
populated accordingly to the device state.
Signed-off-by: Erwan Velu <erwan@redhat.com>
If we cannot open a block device in O_RDWR in exclusive mode, it means
someone is actually using it like a raw database or similar.
In that case, the device should be considered as unusable as OSDs will
not be in a position to use it.
Signed-off-by: Erwan Velu <erwan@redhat.com>
We are already reporting the rotational & scheduler of a disk device.
Reporting the nr_requests could be useful to get how many concurrent IOs
the device supports/reports.
That could help detecting badly detected/configured devices.
Signed-off-by: Erwan Velu <erwan@redhat.com>
We are already reporting model & vendor of a given disk, let's also
report the revision of the firmware. That is useful to filter-out some
known broken revisions.
Signed-off-by: Erwan Velu <erwan@redhat.com>
If a devices is said to be read-only, there is no chance we can actually
use it. So let's report it as unusable.
Signed-off-by: Erwan Velu <erwan@redhat.com>
A block device can be filtered-out/ignored because it have features that
doesn't match Ceph's expectations.
As of today, the current code was rejected removable devices but it was
pretty hidden from the user, and implicit in the get_devices() function.
This patch is creating a new is_valid() function to perform all the
rejection tests and returns if this device can be used in the Ceph
context or not.
If is_valid() is returning False, the 'rejected_reasons' list reports all
the reasons why that devices got rejected.
Signed-off-by: Erwan Velu <erwan@redhat.com>
otherwise we will have
/usr/bin/ld: libzstd/lib/libzstd.a(error_private.c.o): relocation
R_X86_64_32S against `.rodata' can not be used when making a shared
object; recompile with -fPIC
Signed-off-by: Kefu Chai <kchai@redhat.com>
in python's distutils.ccompiler, linker_exe is composed using CC instead
of LDFLAGS. the latter only effects how it builds (shared) library.
and put CMAKE_C_FLAGS into the cflags for the compiler for building
python C extensions, it's more consistent this way. more importantly,
if we build with ASan enabled, the canary program, a.k.a. rados_dummy.c,
won't link without proper CFLAGS.
without this change, rados.so fails to build with errors like:
/usr/bin/ld: /var/ssd/ceph/build/lib/librados.so: undefined reference to
`__asan_stack_free_10'
/usr/bin/ld: /var/ssd/ceph/build/lib/librados.so: undefined reference to
`__asan_report_exp_store8'
...
...
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Link Error: RADOS library not found
make[3]: ***
[src/pybind/rados/CMakeFiles/cython_rados.dir/build.make:57:
src/pybind/rados/CMakeFiles/cython_rados] Error 1
Signed-off-by: Kefu Chai <kchai@redhat.com>
otherwise "cmake -DWITH_ASAN=ON -DCMAKE_BUILD_TYPE=Debug" will fail to
build with
/usr/bin/ld: //var/ssd/ceph/build/lib/libceph-common.so.0: undefined
reference to `TextTable::endrow'
Signed-off-by: Kefu Chai <kchai@redhat.com>
- manifest unset op to foo-chunk object
- remove manifest flag
- commit
- send an ack to a client
- send decrement mesages ("chunk_put") to old chunks (bar-chunk)
Current unit test(ManifestUnset) send "chunk_read" command (to bar-chunk)
in order to see whether chunk's reference count is decreased.
But, as described above, "chunk_read" event can be triggered after a client
(test application) receives an ack. Therefore, there is a corner case
such as bar-chunk (in chunk pool) receives "chunk_read" first instead of "chunk_put"
Reference count model of dedup/tiering is based on false-positive (#24230).
So decreasing reference count is not guaranteed. If reference mismatch occur,
chunk-scrub (this is WIP) will fix it.
One guaranteed thing is that existing manifest flag is removed.
So, the solution of this commit is just re-send unset op, and then
chenk that return value is -EOPNOTSUPP (this means manifest flags is removed).
Fixes: http://tracker.ceph.com/issues/24485
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
so the recent entries are still available if dump_recent is called
again. This is the case e.g. when the signal handler wants to dump the
recent entries both to the regular log and to the crash log.
Signed-off-by: Mykola Golub <mgolub@suse.com>
Remove any pg_upmap[_items] on pgs that are merging to ensure that they
land on the same OSDs.
This is a bit sloppy: we *could* set the source upmap to match the target
upmap (vs potentially moving both PGs to a third location, and/or then
having the balancer move the resulting PG somewhere else again), but for
now assume upmaps are not a common case and Keep It Simple.
Signed-off-by: Sage Weil <sage@redhat.com>
Before AsyncConnection was split into two classes as part of the
multi-protocol refactor, we only had AsyncConnection::is_queued().
It checked both out_q and outcoming_bl because out_q was part of
AsyncConnection.
out_q is now part of ProtocolV1. AsyncConnection should no longer be
concerned with out_q, only with outcoming_bl. Checking whether out_q
is empty in _try_send() is particuarly wrong because if the write is
fininished (i.e. outcoming_bl is empty) but out_q has something in it,
the write callback isn't invoked.
Although probably not strictly necessary, this commit preserves the
semantics of connection->is_queued() in Protocol.cc.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>