Skip to content

Making the usage details a little better. - #35

Merged
yehudasa merged 1 commit into
ceph:masterfrom
cholcombe973:master
Jan 23, 2013
Merged

yehudasa merged 1 commit into
ceph:masterfrom
cholcombe973:master

Conversation

@cholcombe973

Copy link
Copy Markdown
Contributor

Improved the usage message.

Improved the usage message.
yehudasa added a commit that referenced this pull request Jan 23, 2013
Making the usage details a little better.
@yehudasa
yehudasa merged commit 371e6fb into ceph:master Jan 23, 2013
@dmick

dmick commented Jan 23, 2013

Copy link
Copy Markdown
Member

lol, or I guess Yehuda is ok with the original text :)

chamdoo pushed a commit to chamdoo/ceph that referenced this pull request Nov 13, 2015
Remove utilities/.DS_Store file.
XinzeChi added a commit to XinzeChi/ceph that referenced this pull request Jan 29, 2016
os: fix perf counter for file journal
ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 13, 2017
a9e777f Merge pull request ceph#35 from joscollin/wip-warning-dmclock
45c63a5 Merge pull request ceph#36 from ceph/wip-fix-functional
40a9fe5 With upgrade to gcc 7.1.1 need to include <functional> in additional header files.
a2dd155 src/dmclock_server.h: silence warning from -Wmaybe-uninitialized
0d6c7c6 Merge pull request ceph#24 from bspark8/wip_online_client_info_f
a5e8cde Add unit test for update_client_info, dynamic_cli_info_f.
1faf352 Modify each client's QoS parameter applied time from client_rec creation time to each request's tagging creation time.

git-subtree-dir: src/dmclock
git-subtree-split: a9e777f
joscollin referenced this pull request in joscollin/ceph Sep 14, 2017
a9e777f Merge pull request #35 from joscollin/wip-warning-dmclock
45c63a5 Merge pull request #36 from ceph/wip-fix-functional
40a9fe5 With upgrade to gcc 7.1.1 need to include <functional> in additional header files.
a2dd155 src/dmclock_server.h: silence warning from -Wmaybe-uninitialized
0d6c7c6 Merge pull request #24 from bspark8/wip_online_client_info_f
a5e8cde Add unit test for update_client_info, dynamic_cli_info_f.
1faf352 Modify each client's QoS parameter applied time from client_rec creation time to each request's tagging creation time.

git-subtree-dir: src/dmclock
git-subtree-split: a9e777f
joscollin referenced this pull request in joscollin/ceph Sep 14, 2017
a9e777f Merge pull request #35 from joscollin/wip-warning-dmclock

git-subtree-dir: src/dmclock
git-subtree-split: a9e777f

Signed-off-by: Jos Collin <[email protected]>
@joscollin joscollin mentioned this pull request Sep 14, 2017
rjfd added a commit to rjfd/ceph that referenced this pull request Jan 26, 2018
mgr/dashboard_v2/frontend: add support for CI coverage and unit testing
sdpeters pushed a commit to sdpeters/ceph that referenced this pull request May 29, 2019
…y existing pool file with the same name should be deleted.

Signed-off-by: Yuan Lu <[email protected]>
sdpeters added a commit to sdpeters/ceph that referenced this pull request May 31, 2019
for Ceph RBD.

Signed-off-by: Scott Peterson <[email protected]>

Resorting to pruning out tests that fail with RWL.

Don't add RWL on images with the MIGRATING feature bit

They src and dest may have the same image name.

Also don't create image writeback at all if there is no image cache
configured.

Make deep copy test use different image names for src and dest

Fix tests for added async completions, used whether RWL is enabled or not.

Signed-off-by: Scott Peterson <[email protected]>

This block guard implementation isn't used anymore

Handle zero length requests

Tighten up block guard release. Remove assert for what wasn't a bug.

Signed-off-by: Scott Peterson <[email protected]>

Skip these tests when RWL is enabled for now.

It's unclear whether they should work with the cache enabled or not.

Signed-off-by: Scott Peterson <[email protected]>

Do a flush() before shut_down() to complete all in-flight writes and append a final sync point.

Flush to RADOS on ::flush()

Signed-off-by: Scott Peterson <[email protected]>

Make DiscardCopyup test not simultaneously open the same image > once

Signed-off-by: Scott Peterson <[email protected]>

Replaced ineffective pmem_bl copies. TestInternal passes now with RWL enabled.

Signed-off-by: Scott Peterson <[email protected]>

TestFUA is incompatible with RWL (multiple open of same image)

Signed-off-by: Scott Peterson <[email protected]>

Internal flush may be called before init succeeds

Signed-off-by: Scott Peterson <[email protected]>

Make RWL perf logging configurable

Signed-off-by: Scott Peterson <[email protected]>

Require !RWL for tests that open images > once

Signed-off-by: Scott Peterson <[email protected]>

Log image name and ID in key ops.

Use async completion to avoid a deadlock seen during testing

Signed-off-by: Scott Peterson <[email protected]>

Flush/invalidate image cache during Resize

Signed-off-by: Scott Peterson <[email protected]>

Disable more tests that open images > once. DeepCopy tests shoudl work on RWL, but don't.

Signed-off-by: Scott Peterson <[email protected]>

Make invalidate after flush configurable

Signed-off-by: Scott Peterson <[email protected]>

When RWL is enabled, set environment variable to skip actual PMDK persist work

Signed-off-by: Scott Peterson <[email protected]>

All migration tests skipped when RWL is enabled.

Migration probably needs to disable ImageCache first.

One more DeepCopy test that dosn't work with RWL.

Tweak tests to not open images > once

Tests can close all images before fixture teardown. Avoids reopens that fil with write-back cache.

Allow saved image_ctxs to be closed by name

Close the image before re-opening it

Skip tests that reopen images when RWL is enabled

Signed-off-by: Scott Peterson <[email protected]>

Disable slow PMDK persistence in tests

Signed-off-by: Scott Peterson <[email protected]>

Consolidate constructors

Signed-off-by: Scott Peterson <[email protected]>

Force init, shutdown, and flush() completions to op_work_queue

Signed-off-by: Scott Peterson <[email protected]>

Didn't need a special case for image cache after all

Signed-off-by: Scott Peterson <[email protected]>

Fix apparent copy-and-paste error from KernelDevice.cc

Signed-off-by: Scott Peterson <[email protected]>

Revert gratuitous whitespace changes

Signed-off-by: Scott Peterson <[email protected]>

Adds IMAGE_CACHE feature bit. Moves image cache init logic to ImageState

This is in prep. for initializing ImageCache during exclusive lock acquire.

Add types for image cache config

Can fetch image cache state during open

Record ImageCache state on image close

Init & shut down image cache in exclusive lock acquire/release

Disable checks for dirty.

Signed-off-by: Scott Peterson <[email protected]>

Lock tests expect specific feature tests

Signed-off-by: Scott Peterson <[email protected]>

Remove deprecated io prio calls

Signed-off-by: Scott Peterson <[email protected]>

Include image-cache feature options

Signed-off-by: Scott Peterson <[email protected]>

Make mock tests work with IMAGE_CACHE feature on

Signed-off-by: Scott Peterson <[email protected]>

Make more tests work with IMAGE_CACHE feature enabled

Signed-off-by: Scott Peterson <[email protected]>

More adaptation to the feature bit universe

Signed-off-by: Scott Peterson <[email protected]>

Reworked ImageRequestWQ<>::flush() to use ::aio_flush() again, but with a FlushSource arg.

Avoids use of flush_image(), which I think was getting blocked with the user requests in the
DeepCopy test, which was failing.

Signed-off-by: Scott Peterson <[email protected]>

Flush to journal for internal or user flush.

Signed-off-by: Scott Peterson <[email protected]>

Undo previous.

Signed-off-by: Scott Peterson <[email protected]>

Add IMAGE_CACHE cases to RBD unit test

Signed-off-by: Scott Peterson <[email protected]>

Fix apparent copy-and-paste error

Signed-off-by: Scott Peterson <[email protected]>

Don't build PMDK or RWL on ARM while PMDK on ARM64 is still experimental

Signed-off-by: Scott Peterson <[email protected]>

Skip test_librbd when features includes IMAGE_CACHE, but WITH_RWL is not defined.

Signed-off-by: Scott Peterson <[email protected]>

Make read_only flag const, since that's how it's used

Signed-off-by: Scott Peterson <[email protected]>

Fix message

Signed-off-by: Scott Peterson <[email protected]>

Don't init image cache when opening R/O unless there's a dirty one

Signed-off-by: Scott Peterson <[email protected]>

Add evn vars to inhibit flush and retire on close for RWL debugging

Signed-off-by: Scott Peterson <[email protected]>

Add ImageCache action to build

Signed-off-by: Scott Peterson <[email protected]>

Add env vars for testing image cache rbd tool actions

There's a regression here, but I'm committing anyway so I can migrate
to gitlab now.

Signed-off-by: Scott Peterson <[email protected]>

Fix lockdep issue in shutdown when not flushing/retiring.

Signed-off-by: Scott Peterson <[email protected]>

Use FLUSH_SOURCE_SHUTDOWN to identify shutown flushes.

In general, a whoile lot of plumbing to get the ability to suppress RWL flushing
on close, so we can test removing and discarding the image-cache with the rbd tool.

Signed-off-by: Scott Peterson <[email protected]>

Fix rbd cli test output for new image-cache comand and --no-flush option to bench

Signed-off-by: Scott Peterson <[email protected]>

Clean up logging from previous test

Signed-off-by: Scott Peterson <[email protected]>

Fix expected calls of block_writes() which now include the flush source.

Signed-off-by: Scott Peterson <[email protected]>

Always init exclusive lock when the image cache feature is enabled.

Signed-off-by: Scott Peterson <[email protected]>

Remove bogus assert

Signed-off-by: Scott Peterson <[email protected]>

Checkpoint rbd image-cache command

Signed-off-by: Scott Peterson <[email protected]>

Revert "Always init exclusive lock when the image cache feature is enabled."

This reverts commit 314c82f7603f3d6eaceeee417716d09a288b4668.

Signed-off-by: Scott Peterson <[email protected]>

Fix message

Signed-off-by: Scott Peterson <[email protected]>

Track image-cache option changes

Signed-off-by: Scott Peterson <[email protected]>

Fixed some things clang didn't like, which may have broken rtags

Signed-off-by: Scott Peterson <[email protected]>

Split WITH_PMEM into WITH_PMEM_DEVICE and WITH_PMDK

WITH_PMDK causes the PMDK (/NVML) to be built.

WITH_PMEM_DEVICE causes the PMEM OSD to be built.

WITH_PMEM_DEVICE, or WITH_RWL requires WITH_PMDK

Primordial support for WITH_PMDK_PKG enables use of PMDK
installed on platform. We'd probably like finer grained
control over this (build most of Ceph without PMDK installed,
and make PMDK an install dependency for only a few selected
things).

We can now enable RWL without requiring the PMEM OSD to build
and pass tests.

Signed-off-by: Scott Peterson <[email protected]>

Don't assert if exclusive lock release failed.

On failure, these things may not have been done.
Signed-off-by: Scott Peterson <[email protected]>

Also make etags file

ctags -e, into src/TAGS.

Signed-off-by: Scott Peterson <[email protected]>

Revert "Don't assert if exclusive lock release failed."

This reverts commit 184ba6f5e97357380d30f8012f28c34c38e6818c

Signed-off-by: Scott Peterson <[email protected]>

Disable almost all deep copy tests when RWL is enabled

These used to pass, and made interesting test cases, but it
probably doesn't make sense to do this with the cache enabled
anyway.

Signed-off-by: Scott Peterson <[email protected]>

Ignore etags file TAGS

Signed-off-by: Scott Peterson <[email protected]>

Adds ReplicatedWriteLogInternal.h

Hopefully trims enough off of ReplicatedWriteLog.cc that gitlab will
show the diffs in a merge request.

Signed-off-by: Scott Peterson <[email protected]>

Shift more things from RWL.cc to RWLInternal.h

Signed-off-by: Scott Peterson <[email protected]>

Finish moving lines

Signed-off-by: Scott Peterson <[email protected]>

One more try for gitlab-friendly file sizes.

Signed-off-by: Scott Peterson <[email protected]>

To fix IO hange problem caused by aio_flush.

Signed-off-by: Scott Peterson <[email protected]>

Add IO test for RWL

It does IO test with RWL, and tries to cover the test case when
RWL cache is full. But it is not guranteed.

Signed-off-by: Scott Peterson <[email protected]>

Fix the bug 'First IO hangs if RWL can't be initialized'.

Signed-off-by: Scott Peterson <[email protected]>

Update default and minimum value of rwl_size.

Signed-off-by: Scott Peterson <[email protected]>

Fixes the image-cache show command

Signed-off-by: Scott Peterson <[email protected]>

Update RWL full case to use default value.

Signed-off-by: Scott Peterson <[email protected]>

Add pool name in the name of rwl cache file.

Signed-off-by: Scott Peterson <[email protected]>

Fixed rebase issues.

Look closer at whether FLUSH_SOURCE_WRITEBACK should be a no-op in
RWL, or an assert.

Look closer at discard granularity passed to lower cache. This replaces
skip_partial. We were always passing skip_partial = false, so the RWL
and the image got the same discard results (regions which read as zero,
vs. whatever was there before).

Signed-off-by: Scott Peterson <[email protected]>

Fix expected usage output

Signed-off-by: Scott Peterson <[email protected]>

Probably rebase noise

Signed-off-by: Scott Peterson <[email protected]>

Repeat compare buffer as necessary to match length of read in compare-and-write

Signed-off-by: Scott Peterson <[email protected]>

Disable some more migration tests when IMAGE_CACHE feature is enabled.

Signed-off-by: Scott Peterson <[email protected]>

fix image-cache disable feature command

Signed-off-by: Scott Peterson <[email protected]>

Start rwl threads after rwl_init.

Signed-off-by: Li Xiaoyan <[email protected]>

change ENOENT to EPERM when open image cache failed;

Signed-off-by: Yuan Lu <[email protected]>

fixed issue ceph#35: If the image metadata says there is no cache, any existing pool file with the same name should be deleted.

Signed-off-by: Yuan Lu <[email protected]>

only image cache state.present=0 and has pool file, then del the pool file with the same name;

Signed-off-by: Yuan Lu <[email protected]>

do this in rwl_int() function;

Signed-off-by: Yuan Lu <[email protected]>

Pass through everything to writeback interface

Signed-off-by: Scott Peterson <[email protected]>

fix ceph#41:IO hang when rwl_size = 10G or 20G and without rate_iops limit, While there's no IO problem when rwl_size=1G

Signed-off-by: Yuan Lu <[email protected]>

add high/low water log entries threshold and trigger it to retire entries when there's no enough log entries;

Signed-off-by: Yuan Lu <[email protected]>

clean indent issue;

Signed-off-by: Yuan Lu <[email protected]>

modify indentation based on Scott's feedback;

Signed-off-by: Yuan Lu <[email protected]>

Fix the issue of flushing rwl cache when showing image cache.

Signed-off-by: Xiaoyan Li <[email protected]>

Fix image-cache show issue.

Signed-off-by: Xiaoyan Li <[email protected]>

image-cache discard-dirty CLI command

Signed-off-by: Mahati Chamarthy <[email protected]>

pmemobj_close won't fail.

Signed-off-by: Xiaoyan Li <[email protected]>

Rebase repairs. Mostly trivial except async op handling in flush.

Signed-off-by: Scott Peterson <[email protected]>

Make imageFlushRequest::send_request() more like it was before the rebase.

All in pursuit of issue ceph#48 after the latest rebase.

The aio_comp() operations in comments there cause an assert in init or open now.

FLUSH_SOURCE_WRITEBACK requests complete synchonously now, like they did before the rebase.

None of this fixes the test assert in issue ceph#48.

Signed-off-by: Scott Peterson <[email protected]>

Replace namespace declaration that is present in master but not our branch

Signed-off-by: Scott Peterson <[email protected]>

Supplied initial values for things not initialized by all constructors

I saw compiler warnings about these fields being used uninitialized and thought it
might be related to the rebase regression (it probably isn't).

It does look like these could be left uninitialized if the ReplicatedWriteLogSpec
constructor with no argumets was used.

Signed-off-by: Scott Peterson <[email protected]>

Bad merge

Signed-off-by: Scott Peterson <[email protected]>

Fix unit test problem.

Signed-off-by: Xiaoyan Li <[email protected]>
galsalomon66 pushed a commit that referenced this pull request Jan 14, 2021
Signed-off-by: Albin Antony <[email protected]>

Co-authored-by: Albin Antony <[email protected]>
m-ildefons pushed a commit to m-ildefons/ceph that referenced this pull request Sep 7, 2022
jmolmo pushed a commit to jmolmo/ceph that referenced this pull request Dec 19, 2023
mgr/call_home_agent: fix reports frequency
Moisi pushed a commit to Moisi/ceph that referenced this pull request Oct 14, 2024
…libstdc++

Merge in STORAGEENG/ceph from bugfix/OBJGEN1-917-osd-crashes-in-ceph-v18.2.1-13 to aka_version_18.2.1

* commit '5ed8f5be3008cd240b41287a697bf361ea4c590a':
  strip that LDFlags for all
  removing a link flag when building with static libstdc++
athanatos pushed a commit to athanatos/ceph that referenced this pull request Feb 14, 2025
src/dmclock_server.h: silence warning from -Wmaybe-uninitialized
tchaikov added a commit to tchaikov/ceph that referenced this pull request Mar 25, 2026
rbd_features_from_string() uses boost::lexical_cast which throws
bad_lexical_cast when the input is not numeric. The exception is caught
and handled as "parse as feature name list instead".

This is normal control flow, but when ASAN's __cxa_throw interceptor is
misconfigured (e.g. with intercept_cxx_exceptions=0 leaving real___cxa_throw
NULL), any exception causes a CHECK failure. Even with a correctly configured
ASAN, throwing exceptions during config initialization adds overhead.

Replace the try/catch pattern with boost::conversion::try_lexical_convert,
which returns false on parse failure instead of throwing. This eliminates
the exception entirely, making the code more efficient and avoiding any
interaction with ASAN's exception interceptor.

The ASan report:

```
AddressSanitizer: CHECK failed: asan_interceptors.cpp:320 "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0) (tid=30529)
    #0 0x7d668fac9a09 in CheckUnwind ../../../../src/libsanitizer/asan/asan_rtl.cpp:67
    #1 0x7d668faec105 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:86
    #2 0x7d668fa4b194 in __interceptor___cxa_throw ../../../../src/libsanitizer/asan/asan_interceptors.cpp:320
    #3 0x7d668ae4ec0f in void boost::throw_exception<boost::bad_lexical_cast>(boost::bad_lexical_cast const&) /opt/ceph/include/boost/throw_exception.hpp:165
    #4 0x7d668c1e1e0b in void boost::conversion::detail::throw_bad_cast<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long>() /opt/ceph/include/boost/lexical_cast/bad_lexical_cast.hpp:93
    #5 0x7d668c1e0e05 in unsigned long boost::lexical_cast<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /opt/ceph/include/boost/lexical_cast.hpp:43
    #6 0x7d668c1df609 in librbd::rbd_features_from_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream*) /ceph/src/librbd/Features.cc:67
    #7 0x7d668b255a35 in get_rbd_options()::$_2::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const src/common/options/rbd_options.cc:44
    #8 0x7d668b255806 in int std::__invoke_impl<int, get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(std::__invoke_other, get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&) /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:61
    #9 0x7d668b255754 in std::enable_if<is_invocable_r_v<int, get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>, int>::type std::__invoke_r<int, get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&) /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:114
    #10 0x7d668b25563c in std::_Function_handler<int (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*), get_rbd_options()::$_2>::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&) /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_function.h:290
    #11 0x7d668af924f1 in std::function<int (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)>::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_function.h:591
    #12 0x7d668af8c495 in Option::pre_validate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const /ceph/src/common/options.cc:94
    #13 0x7d668aef9ec3 in md_config_t::md_config_t(ConfigValues&, ConfigTracker const&, bool) /ceph/src/common/config.cc:208
    ceph#14 0x7d668ae0040d in ceph::common::ConfigProxy::ConfigProxy(bool) /ceph/src/common/config_proxy.h:70
    ceph#15 0x7d668adf3f5d in ceph::common::CephContext::CephContext(unsigned int, ceph::common::CephContext::create_options const&) /ceph/src/common/ceph_context.cc:730
    ceph#16 0x7d668adf3785 in ceph::common::CephContext::CephContext(unsigned int, code_environment_t, int) /ceph/src/common/ceph_context.cc:724
    ceph#17 0x7d668aef5ee6 in common_preinit(CephInitParameters const&, code_environment_t, int) /ceph/src/common/common_init.cc:40
    ceph#18 0x7d668d4a47af in rados_create_cct(char const*, CephInitParameters*) /ceph/src/librados/librados_c.cc:120
    ceph#19 0x7d668d4a49db in _rados_create2 /ceph/src/librados/librados_c.cc:168
    ceph#20 0x7d668d94dc4b in __pyx_pf_5rados_5Rados_2__setup /ceph/build/src/pybind/rados/rados_processed.c:13219
    ceph#21 0x7d668d94dc4b in __pyx_pw_5rados_5Rados_3__setup /ceph/build/src/pybind/rados/rados_processed.c:12703
    ceph#22 0x7d668d94a347 in __Pyx_CyFunction_CallAsMethod /ceph/build/src/pybind/rados/rados_processed.c:93157
    ceph#23 0x58ac5086d0ba in _PyObject_MakeTpCall (/usr/bin/python3.10+0x1810ba)
    ceph#24 0x58ac508843da  (/usr/bin/python3.10+0x1983da)
    ceph#25 0x58ac50885076 in PyVectorcall_Call (/usr/bin/python3.10+0x199076)
    ceph#26 0x7d668d94cdd7 in __Pyx_PyObject_Call /ceph/build/src/pybind/rados/rados_processed.c:90994
    ceph#27 0x7d668d94cdd7 in __pyx_pf_5rados_5Rados___init__ /ceph/build/src/pybind/rados/rados_processed.c:12474
    ceph#28 0x7d668d94cdd7 in __pyx_pw_5rados_5Rados_1__init__ /ceph/build/src/pybind/rados/rados_processed.c:12443
    ceph#29 0x58ac5086d43a  (/usr/bin/python3.10+0x18143a)
    ceph#30 0x58ac50884d3a in PyObject_Call (/usr/bin/python3.10+0x198d3a)
    ceph#31 0x58ac508637de in _PyEval_EvalFrameDefault (/usr/bin/python3.10+0x1777de)
    ceph#32 0x58ac5087702b in _PyFunction_Vectorcall (/usr/bin/python3.10+0x18b02b)
    ceph#33 0x58ac508615fe in _PyEval_EvalFrameDefault (/usr/bin/python3.10+0x1755fe)
    ceph#34 0x58ac5087702b in _PyFunction_Vectorcall (/usr/bin/python3.10+0x18b02b)
    ceph#35 0x58ac508615fe in _PyEval_EvalFrameDefault (/usr/bin/python3.10+0x1755fe)
```

Signed-off-by: Kefu Chai <[email protected]>
tchaikov added a commit to tchaikov/ceph that referenced this pull request Apr 29, 2026
…race (ceph#35)

BackfillDaemon::shutdown moves the live ImageBackfillers into a local
to_stop vector, calls stop() on each, and lets the vector go out of scope
at function return.  But m_threads.reset() and m_rados.shutdown() run
BEFORE the vector destructs — so ~ImageBackfiller's image_ctx->state->close
fires librbd::ManagedLock::complete_shutdown asynchronously onto the
librbd ThreadPool, that callback ends up in Watcher::unregister_watch
→ Mutex::lock on a Watcher mutex inside the (now-closing) ImageCtx,
and pthread_mutex_lock returns non-zero against a half-destroyed mutex.
The ceph_assert(r == 0) trips and the daemon then hangs forever in
abort()'s event-dump path because the rados context is already gone.

In test_backfill_restart_recovery (test-s3-backfill.sh) this manifested
as the second `stop_backfill_daemon` blocking 22 minutes per call —
shell `wait` waiting on a SIGABRT'd process whose signal handler had
deadlocked.  Fix is mechanical: explicitly to_stop.clear() before
m_threads.reset() / m_rados.shutdown() so ImageState::close drains all
librbd cleanup while the ThreadPool and rados connection are still
alive.

Also harden test helper stop_backfill_daemon: SIGTERM, then SIGKILL
after a 10 s grace, so a future regression of this class doesn't hang
the harness for tens of minutes.

Verified by re-running test_backfill_restart_recovery with phase
timing: TOTAL went from 1352 s (22 min hang on daemon2 stop) to 7.4 s,
each stop now ~0.5 s, no assertion in daemon log.

Signed-off-by: Kefu Chai <[email protected]>
tchaikov added a commit to tchaikov/ceph that referenced this pull request Apr 29, 2026
…e-delete

ImageState<I>::close() takes ownership of the ImageCtx and runs
`delete m_image_ctx` after the close completes (src/librbd/ImageState.cc:279).
ImageBackfiller's destructor was calling `m_image_ctx->state->close()` and
then letting the unique_ptr<ImageCtx> member run its own delete on the
already-freed ImageCtx — a double-free.

Pre-ceph#35 (07616804b34) this was masked by the deadlock in
Watcher::unregister_watch's mutex assertion; once ceph#35 unblocked the
shutdown path, the second delete went through, the heap allocator
later zeroed the cct field on the freed memory, and the next
~ImageCtx (heap reuse for an unrelated allocation, then freed too)
hit `cct->get_perfcounters_collection()` with a NULL cct and segfaulted.

The integration suite (run-s3-tests.sh default) passed semantically
both before and after, but every test that started a daemon reported
"Segmentation fault" from rbd-backfill's exit because of this.

Fix: release the unique_ptr first, hand the raw pointer to
state->close(), and let close() own the delete — same pattern
src/librbd/internal.cc uses (e.g. lines 565-592).

Verified: full integration suite still 6/6 PASS in 159s; zero
"Segmentation fault" events from rbd-backfill (was 9+ before the fix).

Signed-off-by: Kefu Chai <[email protected]>
AnuragRaut08 pushed a commit to AnuragRaut08/ceph that referenced this pull request Sep 30, 2026
rbd_features_from_string() uses boost::lexical_cast which throws
bad_lexical_cast when the input is not numeric. The exception is caught
and handled as "parse as feature name list instead".

This is normal control flow, but when ASAN's __cxa_throw interceptor is
misconfigured (e.g. with intercept_cxx_exceptions=0 leaving real___cxa_throw
NULL), any exception causes a CHECK failure. Even with a correctly configured
ASAN, throwing exceptions during config initialization adds overhead.

Replace the try/catch pattern with boost::conversion::try_lexical_convert,
which returns false on parse failure instead of throwing. This eliminates
the exception entirely, making the code more efficient and avoiding any
interaction with ASAN's exception interceptor.

The ASan report:

```
AddressSanitizer: CHECK failed: asan_interceptors.cpp:320 "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0) (tid=30529)
    #0 0x7d668fac9a09 in CheckUnwind ../../../../src/libsanitizer/asan/asan_rtl.cpp:67
    ceph#1 0x7d668faec105 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:86
    ceph#2 0x7d668fa4b194 in __interceptor___cxa_throw ../../../../src/libsanitizer/asan/asan_interceptors.cpp:320
    ceph#3 0x7d668ae4ec0f in void boost::throw_exception<boost::bad_lexical_cast>(boost::bad_lexical_cast const&) /opt/ceph/include/boost/throw_exception.hpp:165
    ceph#4 0x7d668c1e1e0b in void boost::conversion::detail::throw_bad_cast<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long>() /opt/ceph/include/boost/lexical_cast/bad_lexical_cast.hpp:93
    ceph#5 0x7d668c1e0e05 in unsigned long boost::lexical_cast<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /opt/ceph/include/boost/lexical_cast.hpp:43
    ceph#6 0x7d668c1df609 in librbd::rbd_features_from_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream*) /ceph/src/librbd/Features.cc:67
    ceph#7 0x7d668b255a35 in get_rbd_options()::$_2::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const src/common/options/rbd_options.cc:44
    ceph#8 0x7d668b255806 in int std::__invoke_impl<int, get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(std::__invoke_other, get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&) /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:61
    ceph#9 0x7d668b255754 in std::enable_if<is_invocable_r_v<int, get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>, int>::type std::__invoke_r<int, get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(get_rbd_options()::$_2&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&) /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:114
    ceph#10 0x7d668b25563c in std::_Function_handler<int (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*), get_rbd_options()::$_2>::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*&&) /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_function.h:290
    ceph#11 0x7d668af924f1 in std::function<int (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)>::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_function.h:591
    ceph#12 0x7d668af8c495 in Option::pre_validate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const /ceph/src/common/options.cc:94
    ceph#13 0x7d668aef9ec3 in md_config_t::md_config_t(ConfigValues&, ConfigTracker const&, bool) /ceph/src/common/config.cc:208
    ceph#14 0x7d668ae0040d in ceph::common::ConfigProxy::ConfigProxy(bool) /ceph/src/common/config_proxy.h:70
    ceph#15 0x7d668adf3f5d in ceph::common::CephContext::CephContext(unsigned int, ceph::common::CephContext::create_options const&) /ceph/src/common/ceph_context.cc:730
    ceph#16 0x7d668adf3785 in ceph::common::CephContext::CephContext(unsigned int, code_environment_t, int) /ceph/src/common/ceph_context.cc:724
    ceph#17 0x7d668aef5ee6 in common_preinit(CephInitParameters const&, code_environment_t, int) /ceph/src/common/common_init.cc:40
    ceph#18 0x7d668d4a47af in rados_create_cct(char const*, CephInitParameters*) /ceph/src/librados/librados_c.cc:120
    ceph#19 0x7d668d4a49db in _rados_create2 /ceph/src/librados/librados_c.cc:168
    ceph#20 0x7d668d94dc4b in __pyx_pf_5rados_5Rados_2__setup /ceph/build/src/pybind/rados/rados_processed.c:13219
    ceph#21 0x7d668d94dc4b in __pyx_pw_5rados_5Rados_3__setup /ceph/build/src/pybind/rados/rados_processed.c:12703
    ceph#22 0x7d668d94a347 in __Pyx_CyFunction_CallAsMethod /ceph/build/src/pybind/rados/rados_processed.c:93157
    ceph#23 0x58ac5086d0ba in _PyObject_MakeTpCall (/usr/bin/python3.10+0x1810ba)
    ceph#24 0x58ac508843da  (/usr/bin/python3.10+0x1983da)
    ceph#25 0x58ac50885076 in PyVectorcall_Call (/usr/bin/python3.10+0x199076)
    ceph#26 0x7d668d94cdd7 in __Pyx_PyObject_Call /ceph/build/src/pybind/rados/rados_processed.c:90994
    ceph#27 0x7d668d94cdd7 in __pyx_pf_5rados_5Rados___init__ /ceph/build/src/pybind/rados/rados_processed.c:12474
    ceph#28 0x7d668d94cdd7 in __pyx_pw_5rados_5Rados_1__init__ /ceph/build/src/pybind/rados/rados_processed.c:12443
    ceph#29 0x58ac5086d43a  (/usr/bin/python3.10+0x18143a)
    ceph#30 0x58ac50884d3a in PyObject_Call (/usr/bin/python3.10+0x198d3a)
    ceph#31 0x58ac508637de in _PyEval_EvalFrameDefault (/usr/bin/python3.10+0x1777de)
    ceph#32 0x58ac5087702b in _PyFunction_Vectorcall (/usr/bin/python3.10+0x18b02b)
    ceph#33 0x58ac508615fe in _PyEval_EvalFrameDefault (/usr/bin/python3.10+0x1755fe)
    ceph#34 0x58ac5087702b in _PyFunction_Vectorcall (/usr/bin/python3.10+0x18b02b)
    ceph#35 0x58ac508615fe in _PyEval_EvalFrameDefault (/usr/bin/python3.10+0x1755fe)
```

Signed-off-by: Kefu Chai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants