When Formatter::create replaced new_formatter, the handling of an
invalid format was also incorrectly changed. When an invalid format (for
instance "plain") was specified, new_formatter returned a NULL pointer
which was sometime handled by creating a json-pretty formatter and
sometimes differently.
A new Formatter::create prototype with a fallback argument is added and
is used if it is not the empty string and that the format is not
known. This prototype is used where new_formatter returning NULL was
replaced by a json-pretty formatter.
http://tracker.ceph.com/issues/10547Fixes: #10547
Signed-off-by: Loic Dachary <ldachary@redhat.com>
These can happen with split or with state changes due to reordering
results within the hash range requested. It's easy enough to filter
them out at this stage.
Backport: giant, firefly
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
Because fs reset opens a brief window for the previously
failed MDSs to spring back into life.
Fixes: #10539
Signed-off-by: John Spray <john.spray@redhat.com>
Replace ceph-helpers.sh check for ms_nocrc with the new formula
for this. Fixes make check for default build.
Additionally, fix linkage of several unittests when building with
--enable-xio.
xio: add missing noinst headers
The common/address_helper.h file was not mentioned, also
msg/xio/XioSubmit.h.
Fix for Message.cc compilation error when Xio disabled.
Mention simple_dispatcher.h and xio_dispatcher.h in noinst_HEADERS.
xio: require boost-regex.
Make address_helper conditional on Xio.
This carries over to simple_client/simple_server,
for convenience.
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Enable accelio debug (mostly on connection) on level 2
and sync with XioConnection debug events
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Get the right Accelio errno code on xio_send_msg in
order to correctly requeue or fail the xmsg
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
If a message send hard fails, don't omit to remove it from the
send_q--this results in an assert when the queue is in safe-mode,
but with safe mode disabled, send_q would be corrupted.
Dont fall through and erase the iterator twice. Continue the loop,
as in the incoming release case.
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
In SubmitQueue::deq, scan up to nlanes, exit immediately with
found work, recalling last lane.
Yield to Accelio iff a full scan finds no work.
xio: avoid starving run loop, don't stop loop in shutdown()
Fix 2 issues flagged in review by Alex Rosenbaum.
* In the XioPortal main loop, the recent reduce lock contention change
also made easier to starve Accelio under steady send work. Restore
the original behavior.
* Remove the call to xio_context_stop_loop() in XioPortal::shutdown(),
to ensure that Accelio can finish cleaning up.
Move queue guard check.
Release der spinlock.
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
This changes implements explicit support for Accelio sender-side
flow control, which requires queuing messages for later delivery
when the connection is ready to send.
This rquirement to queue messages for later delivery, and related
connection state logic, is substantially shared with new session
reset behavior, so we've pulled a subset of that logic foward.
Again due to shared implementation logic, this change also adds
implementations of mark_down(), mark_down_all(), mark_disposable(),
and related methods from Messenger, which were required to be
implemented after Hammer.
Add XioSubmit.h.
For now, start at state UP, READY.
When considering if a flow-controlled connection can be unblocked,
consider only the computed queue depth. Re-activate and flush the
connection iff the computed queue depth <= 1/2 of the queue
high-water mark.
Placeholder added for byte-throttled case.
Fix lock flags abuse (found by Casey).
Discard deferred and unsent messages on unplanned disconnect.
The change causes discard_input_queue() to be called in Accelio's
on_disconnect_event() handler, as well as on mark_down().
xio: Change new established connection's state to up and ready
Change the new established passive connection's state to up and
ready then flush all pending msgs in input_queue
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
* Enable Accelio flow control in general
* Read out policy for messages and bytes throttlers from connection's peer_type
* Set Accelio connection flow control with policy throttlers or default values
* Set q_high_mark for xio_connection (80% of queue_depth)
xio: Correct q_high_mark setting
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Temporarily hardcoded all 6 allocators + growing quantum and max size
1k allocator - quantum 4k - max 256k
4k allocator - quantum 4k - max 256k
16k allocator - quantum 4k - max 256k
64k allocator - quantum 1k - max 64k
256k allocator - quantum 512 - max 16k
1m allocator - quantum 128 - max 8k
Later we need to calculate the sustainable workload and dynamically
configure Accelio's interal pool accordingly
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
XioMessenger implements a Ceph Messenger provider for Accelio,
a high-performance messaging transport by Mellanox. Current
Accelio is layered on ibverbs, and supports Infiniband, ROCE,
and other RDMA transports. Future Accelio verions will support
alternative transports (including TCP), and flexible transport
selection.
config: cluster_rdma drives messenger creation
ceph_mds ceph_mon and ceph_osd use XioMessengers for cluster
communication when cluster_rdma is set
Move XioMessenger to msg/xio.
This matches the other new Messenger locations.
test: tests for tcp and xio messengers
(Not tests only.)
buffer: add subclass for xio buffers
xio: convert to Connection::send_message interface
config: -x, --xio as aliases for client_rdma
ceph-fuse: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
ceph-syn: create xio messenger if client_rdma
librados: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
Restore non-abort from Xio Mon integration.
Fix xio_client send count, again.
xio: must signal cond under mutex lock
xio: dispatch strategies support ms_fast_dispatch
xio: config variable xio_port_shift
remove set_port_shift() from XioMessenger, and just use the value
from the configuration
xio: don't depend on g_ceph_context for dout
XioMessenger now uses its own cct for all logging operations
the accelio log function, however, still depends on a global
CephContext. so we maintain an extra one, separate from g_ceph_context,
in XioMessenger.cc that is initialized on first construction and a
reference is held indefinitely
script: cephfsnew to automate pool and fs creation
Use new on_ow_msg_send_complete hook.
Replaces on_msg_delivered for one-way message style.
Prototype new xio_discon behavior.
On shutdown, XioPortal threads should not exit before Accelio
finalizes all sessions.
Inline join_sessions, it needs sh_mtx held across wait loop.
Fix assert on Cond::Signal. Adds Cond2.
Avoid deadlock, xio_disconnect can deliver a session teardown event.
Also Mutex2.
(Note, Mutex2 and Cond2 are replaced by standard C++ downstream.)
Restore SimpleDispatcher Timings.
The simple_client/simple_server timings are based on a ping/pong
of messages between the client and server, unlike those of the
xio_client/server programs, which are one-way (so their corresponding
1-way bandwidth is appx. 2x what the test reports). We assert
that the results are in general comparable, because in both setups,
a fixed number of messages (def. 50) is maintained in flight.
Wrap Accelio mempool in XioPool, add stats.
To enable stat prints, set xio_trace_mempool. Currently, prints
to stdout at each 64K messages sent or received.
Restore _send_message(..).
Fix merge errors in simple_client, simple_dispatcher.
xio: fix for size in pool stats
Add in/outbound msg counters to XioPoolStats.
Pool stats are easier to read.
Pool stats are easier to read, and if enabled, print on session
teardown. This is a convenient time to view stats, and with a small
Make pool stats counters atomic.
Track requests using hook ctor/dtor.
Lockless, portal thread provides atomicity.
Adapt to recent changes on Accelio for_next
* Accelio options now of opaque type
* on_msg_err with extra direction param
* RDMA behavior now governed by 2 new options
XIO_OPTNAME_MAX_INLINE_DATA
XIO_OPTNAME_MAX_INLINE_HEADER
* Separated send and recv queue depth
xio_messenger: Change xio optname queue depth msgs
* Set 16k threshold to rdma buffers instead of send
* Change xio optname for queue depth msgs
XIO_OPTNAME_SND/RCV_QUEUE_DEPTH_MSGS
xio_messenger: Protect Accelio queue depth.
(Minimal send flow control.)
The guard is per xio_connection, and considering batches.
Increment happens only if xio_send_msg succeeded, decrement in
on_ms_ow_send_complete and on_msg_error. Note that we don't need
atomics because counters are touched only in the correct portal
thread.
Find XioMsg.h in msg/xio
Find XioMessenger.h and QueueStrategy.h in msg/xio (tests).
Adapt to 2 Accelio API changes.
1. xio_context_stop loop takes only 1 argument
2. xio_connect() now takes a structure argument, by reference
Set CMP0046 iif CMake version >= 3
Move XioMessenger to msg/xio
xio: fix for segfault on xio_connect()
No more Mutex2, Cond2.
xio: number of portal threads is configurable
xio: only create additional portals on bind()
xio: use QueueStrategy(1) as default
xio: Messenger factory accepts ms_type "xio"
xio: use ms_type instead of client,cluster_rdma
removing the ability to configure the client and cluster networks
separately in favor of a single global messenger type
--xio is now a command-line alias for --ms_type xio
all daemons now use the Messenger::create() factory function instead of
conditionally creating XioMessengers
the OSD and Monitor classes no longer need separate messengers to
deal with both tcp/rdma clients
xio: portal binding honors ms_bind_port_min,max
xio: remove xio_port_shift
port shifting is no longer necessary, because we won't create both tcp
and xio messengers for the same service
Use Accelio sglist helper macros.
xio: make xio buffer unshareable
xio: Nuke special_handling.
Replace GENERIC with MON (requested by Sage).
Signed-off-by: Casey Bodley <casey@cohortfs.com>
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
This is currently used by XioMessenger dispatch strategies, but
could be extended to other Messenger types.
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Adds custom buffer::raw type xio_mempool, with hooks into Accelio
memory lifecycle.
The xio_mempool type is non-sharable by default.
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Add new header_crc and data_crc configuration booleans, and use
them consistently to govern whether CRC is performed in the
Message encode, decode, and transit paths.
Remove ms_nocrc, changes per Sage.
Mimimally adapt AsyncMessenger for crcflags.
Signed-off-by: Casey Bodley <casey@linuxbox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
the monitor now defines its own subclass of Connection to use for
Monitor::handle_forward(), rather than tying it to the Messenger
interface
Signed-off-by: Casey Bodley <casey@linuxbox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
CMake Ceph Build System (Firefly)
CMake. Add tests.
Respace src/CMakeLists.txt.
CMake. Spacing cleanups.
CMake for Firefly is Triumphant
CMake for Giant
Adapt to Giant.
Fix installation for scripts and man pages
Fix CEPH_LIBDIR and CEPH_PKGLIBDIR defines
Add erasure-code libraries
uses try_compile() to detect support for -msse flags
Fix rados object classes
Propagate Casey's cls library change to src/test.
Fix CMake build for Hammer.
Try-add rados and common to librbd link.
Fix name and linkage of libec_lrc.
Rename arch/neon.c arm.c
Fix libcommon.a dependencies (some unit tests).
Authors:
Ali Maredia <ali@cohortfs.com>
Casey Bodley <casey@cohortfs.com>
Adam Emerson <aemerson@cohortfs.com>
Marcus Watts <mdw@cohortfs.com>
Matt Benjamin <matt@cohortfs.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Coverity flagged two variables as uninitialized prior to use.
Explicitly initialize the variables in the constructors to remove
the false-positives.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
In a bucket aio operation, wait for completions only if there are no
completions available. Otherwise we might wait forever, as everything
already complete.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>