When building on 32 bit platforms (tested on armhf), 2 errors were detected:
The first involves the compiler being unable to disambiguate a call to
deserialize an integer (apparently because there isn't a specialization for it).
The second involves invalid usage of the builtin reinterpret_cast.
Signed-off-by: Luciano Lo Giudice <luciano.logiudice@canonical.com>
Patrick Donnelly [Tue, 26 Jul 2022 12:59:56 +0000 (08:59 -0400)]
Merge PR #47218 into main
* refs/pull/47218/head:
mon/MDSMonitor: fix check for standby reversion
mds: update comment about standby-replay daemons holding a rank
qa: test for standby-replay removal in MDSMonitor::prepare_beacon
mds: add inject config for synthetic health message
crimson/osd: don't capture a local, on-stack address of MOSDRepOpReply
This flaw can explain the following crash observed at Sepia:
```
ceph-osd: /home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos8/DIST/centos8/MACHINE_SIZE/gigantic/release/17.0.0-13661-g3a14f283/rpm/el8/BUILD/ceph-17.0.0-13661-g3a14f283/x86_64-redhat-linux-gnu/boost/include/boost/smart_ptr/intrusive_ptr.hpp:199: T* boost::intrusive_ptr<T>::operator->() const [with T = MOSDRepOpReply]: Assertion `px != 0' failed.
Aborting on shard 0.
Backtrace:
0# gsignal in /lib64/libc.so.6
1# abort in /lib64/libc.so.6
2# 0x00007FB1346F4CD9 in /lib64/libc.so.6
3# 0x00007FB13471A3F6 in /lib64/libc.so.6
4# crimson::osd::OSD::handle_rep_op_reply(seastar::shared_ptr<crimson::net::Connection>, boost::intrusive_ptr<MOSDRepOpReply>) in ceph-osd
5# 0x000055C4100FF8D0 in ceph-osd
6# 0x000055C410100639 in ceph-osd
7# crimson::osd::OSD::ms_dispatch(seastar::shared_ptr<crimson::net::Connection>, boost::intrusive_ptr<Message>) in ceph-osd
8# crimson::net::ChainedDispatchers::ms_dispatch(seastar::shared_ptr<crimson::net::Connection>, boost::intrusive_ptr<Message>) in ceph-osd
9# 0x000055C4165220EF in ceph-osd
10# 0x000055C416532791 in ceph-osd
11# 0x000055C4165328B2 in ceph-osd
12# 0x000055C40FDD33D5 in ceph-osd
13# 0x000055C40FDEE2CE in ceph-osd
14# 0x000055C40FDEEEF0 in ceph-osd
15# 0x000055C41CA41215 in ceph-osd
16# 0x000055C41CA97959 in ceph-osd
17# 0x000055C41CBF73A0 in ceph-osd
18# 0x000055C41CBF93F5 in ceph-osd
19# 0x000055C41C629A46 in ceph-osd
20# 0x000055C41C62E012 in ceph-osd
21# main in ceph-osd
22# __libc_start_main in /lib64/libc.so.6
23# _start in ceph-osd
```
crimson/os/seastore/async_cleaner: fix and improve update_journal_tails()
* Accept JOURNAL_SEQ_NULL dirty_tail when it is pending.
* Enforce monotone increasing to the journal tails.
* Enforce journal tails to be always behind the journal head.
include/types_fmt: use fmt::join() to format containers
* add formatter for classes with stream insertion operator.
as in fmtlib v6.1.2, which is the one shipped with ubuntu focal,
fmt::join() requires the printed element to have formatter.
see https://github.com/fmtlib/fmt/issues/2040 and
https://github.com/fmtlib/fmt/issues/1462
* use template parameter pack to represent container template argument,
simpler this way. also, this enables us to print specialized
classes which uses non-default template parameters.
* use fmt::join() to print container elements. see also
https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view
otherwise we'd have following FTBFS with MinGW, like:
../src/fmt/include/fmt/chrono.h: In lambda function:
../src/fmt/include/fmt/chrono.h:952:5: error: '_tzset' was not declared
in this scope; did you mean 'tzset'?
952 | _tzset();
| ^~~~~~
| tzset
Patrick Donnelly [Thu, 21 Jul 2022 20:34:05 +0000 (16:34 -0400)]
mon/MDSMonitor: fix check for standby reversion
A standby-replay daemon always has a rank, so this check is completely
wrong. If a beacon from a standby-replay daemon reaches
MDSMonitor::prepare_beacon, it will always be evicted/removed by the
mons. This is rare (usually a reply occurs directly from
MDSMonitor::preprocess_beacon) but can happen in certain circumstances,
like a health warning included in the beacon.
Fixes: https://tracker.ceph.com/issues/56666 Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
collection default has pool(0), and NO_SHARD,
so the ghobject_t should have the same setting.
and ghobject_t default hash not within 1<<(32-4),
so set collection bits to be 0.
test/encoding: verify that e.what() starts with expected str
boost changes the way how it prints boost::system::system_error in
boost 1.79 -- it appends the stringified error_category at end of
exception::what(), and our buffer::malformed_input is a subclass
of boost::system::system_error.
so we cannot just compare the return value of what() with the
expected string, to be more future proof, let's check if i
starts with the expected string instead.
to avoid the conflicting declaration of NTSTATUS from bcrypt.h and our
own typedef. as after switching to boost 1.79, we would have following compiling
failure:
In file included from ../src/dokan/options.cc:14:
../src/dokan/ceph_dokan.h:16:15: error: conflicting declaration 'typedef DWORD NTSTATUS'
16 | typedef DWORD NTSTATUS;
| ^~~~~~~~
In file included from ../build.deps/mingw/boost/include/boost/asio/impl/connect_pipe.ipp:29,
from ../build.deps/mingw/boost/include/boost/asio/connect_pipe.hpp:79,
from ../build.deps/mingw/boost/include/boost/asio.hpp:64,
from ../src/include/win32/winsock_wrapper.h:20,
from <command-line>:
/usr/share/mingw-w64/include/bcrypt.h:27:16: note: previous declaration as 'typedef LONG NTSTATUS'
27 | typedef LONG NTSTATUS,*PNTSTATUS;
| ^~~~~~~~
Kotresh HR [Fri, 4 Feb 2022 09:58:39 +0000 (15:28 +0530)]
qa: validate subvolume discover on upgrade
Validate subvolume discover on upgrade from
legacy subvolume to v1. The handcrafted
`.meta' file on legacy subvolume root should
not be used for any subvolume apis like getpath,
authorize.
mgr/volumes: Fix subvolume discover during upgrade
Fixes the subvolume discover to use the correct
metadata file after an upgrade from legacy subvolume
to v1. The fix makes sure, it doesn't use the
handcrafted metadata file placed in the subvolume
root of legacy subvolume.
Co-authored-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch> Co-authored-by: Dan van der Ster <daniel.vanderster@cern.ch> Co-authored-by: Ramana Raja <rraja@redhat.com> Signed-off-by: Kotresh HR <khiremat@redhat.com>
* append latest dirty tail as journal delta, in order to simplify and
drop journal_tail_committed in the cleaner.
* simplify misc journal tails into alloc_tail and dirty_tail, with
proper renaming.
* move journal-tail recovery logic from cleaner to journal.
include/compat: define aligned_free() as a function not a macro
so it does not get substituted by the preprocessor unconditionally.
this change helps to address the compiling failure when using boost
1.79 using MinGW, like:
../build.deps/mingw/boost/include/boost/align/aligned_allocator.hpp: In member function 'void boost::alignment::aligned_allocator<T, Alignment>::deallocate(boost::alignment::aligned_allocator<T, Alignment>::pointer, boost::alignment::aligned_allocator<T, Alignment>::size_type)':
../src/include/compat.h:352:27: error: '_aligned_free' is not a member of 'boost::alignment'; did you mean 'aligned_free'?
352 | #define aligned_free(ptr) _aligned_free(ptr)
| ^~~~~~~~~~~~~
Soumya Koduri [Thu, 24 Jun 2021 18:00:45 +0000 (23:30 +0530)]
JSONFormattable incorrectly sets a string starting with digit as int
JSONFormattable::set calls JSONParser::parse() to check if the given string
is a valid JSON object, which internally uses json_spirit::read to determine
the string type and copy it into data.
This routine incorrectly sets data type to integer if the string starts with
digit and copies only the first set of numeric values of the string.
To work-around this issue, verify if the entire string is parsed to
determine if its valid json data type.