Compression and erasure coding plugins are now statically compiled
into libcephd. A new method is added to load them into the
respective registry.
The static libraries are only built when WITH_EMBEDDED is enabled
and existing plugins are unaffected.
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
prior to this change, global_init() could create a new CephContext
and assign it to g_ceph_context. it's our responsibilty to release
the CephContext explicitly using cct->put() before the application
quits. but sometimes, we fail to do so.
in this change, global_init() will return an intrusive_ptr<CephContext>,
which calls `g_ceph_context->put()` in its dtor. this ensures that
the CephContext is always destroyed before main() returns. so the
log is flushed before _log_exp_length is destroyed.
there are two cases where global_pre_init() is called directly.
- ceph_conf.cc: g_ceph_context->put() will be called by an intrusive_ptr<>
deleter.
- rgw_main.cc: global_init() is called later on on the success code
path, so it will be taken care of.
Fixes: http://tracker.ceph.com/issues/17762
Signed-off-by: Kefu Chai <kchai@redhat.com>
In 626360aab0 we made the
OSD cluster loopback connection CEPH_FEATURES_ALL, but
all other loopback connections got features == 0. I
can't come up with any reason we wouldn't want those
connections to have accurate feature bits, so let's just
use CEPH_FEATURES_ALL for all of them.
While we're here, make the cflags argument required.
Signed-off-by: Sage Weil <sage@redhat.com>
Resurrected jerasure_generic, jerasure_sse3, jerasure_sse4, jerasure_neon,
shec_generic, shec_sse3, shec_sse4 and shec_neon. These all are exact
copies of the new jerasure and shec plugins that support SIMD detection.
Moved EC preload code in ceph-mon and ceph-osd to a central location, added
warning when preloading legacy plugins.
OSMonitor::get_erasure_code and OSDMonitor:normalize_profile will now check
if legacy EC plugins are used and log a warning.
Added tests to check that warnings make it to the log.
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
Widen Messenger::create and XioMessenger constructor to support
per-Messenger instance creation parameters.
This introduce a minimalist generic set of flags to describe
the type of Messenger and its associated resources.
We apply the usage of these flags to ceph-osd's "workhorse",
"heartbeat" and "light" Messenger instances, ceph-mon and
other ceph clients Messengers.
Signed-off-by: Vu Pham <vu@mellanox.com>
Otherwise, all you see is errors about the probes that failed (e.g., a
failure to decode a non-bluestore superblock as bluestore).
Signed-off-by: Sage Weil <sage@redhat.com>
In one of our test environments an osd is unable to back to work
due to the journal is totally unrecoverable. The os_flags field
is introduced to handle such a case but never be made an option
and visible to normal user.
This commit tries to make os_flags field a configurable option and
no flags is enabled by default and thus shall cause no compatibility
relevant issues.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
missing nullity check will cause the process to crash in the following cases:
a. bad ms-type is configured in ceph.conf
b. an experimental ms-type is configured (ms-type-async or ms-type-xio) without explicitly enabling the experimental feature in ceph.conf
c. ms-type is configured to "random" and at runtime the random feature yields ms-type which is an experimental feature while in ceph.conf this experimental feature was not explicitly enabled
Signed-off-by: Avner BenHanoch <avnerb@mellanox.com>
The calling chain for generic_server_usage():
generic_server_usage()
->generic_usage(true)
->exit(1)
cout.flush()
any statements after generic_server_usage() would not be reached,so we
need to flush cout in generic_usage().
Signed-off-by: Jiaying Ren <jiaying.ren@umcloud.com>
The calling chain of usage() is:
usage()
->generic_server_usage()
->exit(1)
exit(0)
so the exit(0) after usage() would not be reached.
Signed-off-by: Jiaying Ren <jiaying.ren@umcloud.com>
When we create an osd, mark the type of the backend in the
osd_data dir in the 'type' file. On startup, if this file is
present, us this to decide which ObjectStore to instantiate. If
it is not present, use the osd_objectstore option as before.
Signed-off-by: Sage Weil <sage@redhat.com>
Currently the option name and invocation assume that the block device
is a journal (and FileStore journal, managed by FileJournal). Rework
the interface so that we can probe any block device and other ObjectStore
implementations will have a chance to identify the device (and return the
osd fsid).
Switch to a static method while we are at it so we avoid instantiating
each backend.
Note that only FileStore is probed at the moment; that will change soon!
Signed-off-by: Sage Weil <sage@redhat.com>
Ignore the profile 'directory' field.
This ensures that we can always find plugins even when teh cluster
is installed across a mix of distros.
Rename the option to have no osd_ (or mon_) prefix since anybody
may use the ec factory/plugin code.
We still hard-code .libs in the unit tests... sigh.
Signed-off-by: Sage Weil <sage@redhat.com>
The error stream in the erasure code path is broken and the error
message is sometime not reported back to the user. For instance the
ErasureCodePlugin::factory method has no error stream: when an error
happens the user is left with a cryptic error code that needs lookup in
the sources to figure it out.
The error stream is made more systematic by:
* always pass it as ostream *ss (instead of something passing it as
a reference and sometime as a stringstream)
* ostream *ss is added to ErasureCodePlugin::factory
* define the ErasureCodeInterface::init pure virtual. It is
already implemented by all plugins, only in slightly different
ways. The ostream *ss is added so the init function has a way to
report error in a human readable way to the caller, in addition to
the error code.
The ErasureCodePluginJerasure::init return value was incorrectly ignored
when called from ErasureCodePluginJerasure::factory and now returns when
it fails.
The ErasureCodeLrc::layers_init method is given ostream *ss for error
messages instead of printing them via derr.
The ErasureCodePluginLrc::factory method no longer prints errors via
derr: this workaround is made unnecessary by the ostream *ss argument.
The ErasureCodeShec::init ostream *ss argument is ignored. The
ErasureCodeShec::parse method entirely relies on derr to report errors
and converting it goes beyond the scope of this cleanup. There is a
slight risk of getting it wrong and it deserves a separate commit and
careful and independent review.
The PGBackend, OSDMonitor.{cc,h} changes are only about prototype
changes.
Signed-off-by: Loic Dachary <ldachary@redhat.com>
By default every hardware queue of a network interface is assigned a
pfifo_fast QDisc. When network congestion occurs, the data traffic may
starve out the heartbeat traffic.
To make sure that heartbeat packets are always transmitted(dequeued) first,
Setting the SO_PRIORITY as 6 for the sockets that are used to transmit
heartbeat messages. The length of heartbeat messages are small. And an
OSD Daemon doesn't ping its peers very often. So the heartbeat traffic
is not likely to starve out the data traffic.
Using fq_codel instead of pfifo_fast is another good choice to avoid
bufferbloat. It's not available until Linux 3.5 though.
Signed-off-by: Jian Wen <wenjianhn@gmail.com>
Otherwise, one loses log messages when running with -f or -d. When
daemonizing, stderr is already closed in global_init_postfork_finish.
Fixes: #10010, #10113, #9810
Signed-off-by: Dan Mick <dan.mick@redhat.com>
This was introduced before cuttlefish. We require users to upgrade first
to a newer release, so there is no need to support a mixed cluster with
such old code.
Signed-off-by: Sage Weil <sage@redhat.com>
There is no reason for this level of detail to be exposed to the OSD.
There is one significant change here: we are not touching the SnapMapper
in the FileStore collection removal. This is, most likely, fixing a bug.
Signed-off-by: Sage Weil <sage@redhat.com>
The objecter messenger is only used as a client to initiate client-side
connections to other OSDs. It doesn't need to bind to a port.
This was added in 558d9fc956 to push client
traffic to the cluster interface. This doesn't actually help/work because
we are still connecting to our peers' client-facing addresses.
Signed-off-by: Sage Weil <sage@redhat.com>