find_package(RocksDB 5.14 REQUIRED)
endif()
-option(WITH_SEASTAR "Build seastar components")
-set(HAVE_SEASTAR ${WITH_SEASTAR})
+option(WITH_CRIMSON "Build seastar components")
+set(HAVE_SEASTAR ${WITH_CRIMSON})
# Boost
option(WITH_SYSTEM_BOOST "require and build with system Boost" OFF)
list(APPEND BOOST_COMPONENTS
python${MGR_PYTHON_VERSION_MAJOR}${MGR_PYTHON_VERSION_MINOR})
endif()
-if(WITH_SEASTAR)
+if(WITH_CRIMSON)
list(APPEND BOOST_COMPONENTS timer)
endif()
-DWITH_SYSTEM_QATZIP:BOOL=ON \
%endif
%if 0%{with seastar}
- -DWITH_SEASTAR:BOOL=ON \
+ -DWITH_CRIMSON:BOOL=ON \
-DWITH_JAEGER:BOOL=OFF \
%endif
-DWITH_GRAFANA:BOOL=ON \
# see http://tracker.ceph.com/issues/25209
export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions
endif
-ifeq (,$(findstring WITH_SEASTAR,$(CEPH_EXTRA_CMAKE_ARGS)))
+ifeq (,$(findstring WITH_CRIMSON,$(CEPH_EXTRA_CMAKE_ARGS)))
export CEPH_OSD_BASENAME = ceph-osd
else
export CEPH_OSD_BASENAME = crimson-osd
-D WITH_SYSTEM_NPM=ON \
-D WITH_LTTNG=OFF \
-D WITH_BABELTRACE=OFF \
- -D WITH_SEASTAR=OFF \
+ -D WITH_CRIMSON=OFF \
-D WITH_FUSE=ON \
-D WITH_KRBD=OFF \
-D WITH_XFS=OFF \
Crimson is not enabled by default. Enable it at build time by running::
- $ WITH_SEASTAR=true ./install-deps.sh
- $ ./do_cmake.sh -DWITH_SEASTAR=ON
+ $ WITH_CRIMSON=true ./install-deps.sh
+ $ ./do_cmake.sh -DWITH_CRIMSON=ON
Please note, `ASan`_ is enabled by default if Crimson is built from a source
cloned using ``git``.
set(sysctl_pid_max "kernel.pid_max = 4194304")
endif()
-if(WITH_SEASTAR)
+if(WITH_CRIMSON)
configure_file(90-crimson-osd.conf.in
${CMAKE_CURRENT_SOURCE_DIR}/90-ceph-osd.conf
@ONLY)
sysutils/fusefs-libs \
exit
else
- [ $WITH_SEASTAR ] && with_seastar=true || with_seastar=false
+ [ $WITH_CRIMSON ] && with_seastar=true || with_seastar=false
[ $WITH_PMEM ] && with_pmem=true || with_pmem=false
source /etc/os-release
case "$ID" in
INTERFACE_COMPILE_DEFINITIONS
"BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_LIST_SIZE=30")
-if(WITH_SEASTAR)
+if(WITH_CRIMSON)
find_package(c-ares 1.13.0 QUIET)
if(NOT c-ares_FOUND)
message(STATUS "Could not find c-ares, will build it")
{
// Should add code to only print the SHA1 hash of the key, unless in secure debugging mode
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
ldout(cct,10) << "In get_auth_session_handler for protocol " << protocol << dendl;
#endif
switch (protocol) {
// generate a connection secret
connection_secret->resize(connection_secret_required_len);
if (connection_secret_required_len) {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
std::random_device rd;
std::generate_n(connection_secret->data(),
connection_secret_required_len,
#define dout_subsys ceph_subsys_auth
namespace {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
crimson::common::ConfigProxy& conf(CephContext*) {
return crimson::common::local_conf();
}
#include "common/perf_counters.h"
#include "include/types.h" // for operator<<(std::vector)
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "common/dout.h"
#include "perfglue/heap_profiler.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
virtual ~RefCountedObjectSafe() override {}
};
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
/**
* RefCountedCond
static inline void intrusive_ptr_release(RefCountedWaitObject *p) {
p->put();
}
-#endif // ifndef WITH_SEASTAR
+#endif // ifndef WITH_CRIMSON
static inline void intrusive_ptr_add_ref(const RefCountedObject *p) {
p->get();
#include <sys/syscall.h> /* For SYS_xxx definitions */
#endif
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/os/alienstore/alien_store.h"
#endif
#include "include/Context.h"
#include "common/ThrottleInterface.h"
#include "common/Timer.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "include/spinlock.h"
#include "msg/Message.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#ifndef CEPH_WORKQUEUE_H
#define CEPH_WORKQUEUE_H
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
// for ObjectStore.h
struct ThreadPool {
struct TPHandle {
#include "common/version.h"
#include "common/ceph_mutex.h"
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
#include "common/Cond.h"
#endif
auto reply = new MCommandReply(r, err);
reply->set_tid(m->get_tid());
reply->set_data(outbl);
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
// TODO: crimson: handle asok commmand from alien thread
#else
m->get_connection()->send_message(reply);
auto reply = new MMonCommandAck(m->cmd, r, err, 0);
reply->set_tid(m->get_tid());
reply->set_data(outbl);
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
// TODO: crimson: handle asok commmand from alien thread
#else
m->get_connection()->send_message(reply);
std::ostream& errss,
bufferlist *outbl)
{
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
// TODO: crimson: blocking execute_command() in alien thread
return -ENOSYS;
#else
#ifndef CEPH_COMMON_ADMIN_SOCKET_H
#define CEPH_COMMON_ADMIN_SOCKET_H
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/admin/admin_socket.h"
#else
// like a full memory barrier stalling execution till CPU's store and
// load buffers are drained.
-#if defined(WITH_SEASTAR) && !defined(WITH_BLUESTORE)
+#if defined(WITH_CRIMSON) && !defined(WITH_BLUESTORE)
#include <type_traits>
template <class T> using atomic = dummy_atomic<T>;
} // namespace ceph
-#else // WITH_SEASTAR
+#else // WITH_CRIMSON
namespace ceph {
template <class T> using atomic = ::std::atomic<T>;
} // namespace ceph
-#endif // WITH_SEASTAR
+#endif // WITH_CRIMSON
#include "common/PluginRegistry.h"
#include "common/valgrind.h"
#include "include/spinlock.h"
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
#include "mon/MonMap.h"
#endif
using ceph::HeartbeatMap;
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
namespace crimson::common {
CephContext::CephContext()
: _conf{crimson::common::local_conf()},
}
}
-#else // WITH_SEASTAR
+#else // WITH_CRIMSON
namespace {
#ifdef CEPH_DEBUG_MUTEX
set_mon_addrs(mon_addrs);
}
}
-#endif // WITH_SEASTAR
+#endif // WITH_CRIMSON
#include "common/cmdparse.h"
#include "common/code_environment.h"
#include "msg/msg_types.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/config_proxy.h"
#include "crimson/common/perf_counters_collection.h"
#else
}
}
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
namespace crimson::common {
class CephContext {
public:
#ifdef __cplusplus
}
#endif
-#endif // WITH_SEASTAR
+#endif // WITH_CRIMSON
-#if !defined(WITH_SEASTAR) && defined(__cplusplus)
+#if !defined(WITH_CRIMSON) && defined(__cplusplus)
namespace ceph::common {
inline void intrusive_ptr_add_ref(CephContext* cct)
{
cct->put();
}
}
-#endif // !defined(WITH_SEASTAR) && defined(__cplusplus)
+#endif // !defined(WITH_CRIMSON) && defined(__cplusplus)
#endif
// and make_recursive_mutex() factory methods, which take a string
// naming the mutex for the purposes of the lockdep debug variant.
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include <seastar/core/condition-variable.hh>
#include "crimson/common/log.h"
#define ceph_mutex_is_locked_by_me(m) true
}
-#else // ifdef WITH_SEASTAR
+#else // ifdef WITH_CRIMSON
//
// For legacy Mutex users that passed recursive=true, use
// ceph::make_recursive_mutex. For legacy Mutex users that passed
#endif // CEPH_DEBUG_MUTEX
-#endif // WITH_SEASTAR
+#endif // WITH_CRIMSON
namespace ceph {
#define dout_subsys ceph_subsys_
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
CephContext *common_preinit(const CephInitParameters &iparams,
enum code_environment_t code_env, int flags)
{
}
return cct;
}
-#endif // #ifndef WITH_SEASTAR
+#endif // #ifndef WITH_CRIMSON
void complain_about_parse_error(CephContext *cct,
const std::string& parse_error)
lderr(cct) << parse_error << dendl;
}
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
/* Please be sure that this can safely be called multiple times by the
* same application. */
}
}
-#endif // #ifndef WITH_SEASTAR
+#endif // #ifndef WITH_CRIMSON
CINIT_FLAG_NO_CCT_PERF_COUNTERS = 0x40,
};
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
class CephInitParameters;
/*
*/
CephContext *common_preinit(const CephInitParameters &iparams,
enum code_environment_t code_env, int flags);
-#endif // #ifndef WITH_SEASTAR
+#endif // #ifndef WITH_CRIMSON
/* Print out some parse error. */
void complain_about_parse_error(CephContext *cct,
return values;
}
void set_config_values(const ConfigValues& val) {
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
std::lock_guard l{lock};
#endif
values = val;
#include "config_values.h"
#include "config.h"
-#if WITH_SEASTAR
+#if WITH_CRIMSON
#include "crimson/common/log.h"
#endif
}
subsys.set_log_level(which, log);
subsys.set_gather_level(which, gather);
-#if WITH_SEASTAR
+#if WITH_CRIMSON
crimson::get_logger(which).set_level(crimson::to_log_level(log));
#endif
}
#include "include/ceph_assert.h"
#include "include/common_fwd.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include <seastar/util/log.hh>
#include "crimson/common/log.h"
#include "crimson/common/config_proxy.h"
// generic macros
#define dout_prefix *_dout
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#define dout_impl(cct, sub, v) \
do { \
if (crimson::common::local_conf()->subsys.should_gather(sub, v)) { \
_dout_cct->_log->submit_entry(std::move(_dout_e)); \
} \
} while (0)
-#endif // WITH_SEASTAR
+#endif // WITH_CRIMSON
#define lsubdout(cct, sub, v) dout_impl(cct, ceph_subsys_##sub, v) dout_prefix
#define ldout(cct, v) dout_impl(cct, dout_subsys, v) dout_prefix
Only applied when OSD is doing ``--mkfs``.
default: true
verbatim: |
- #ifdef WITH_SEASTAR
+ #ifdef WITH_CRIMSON
// This is necessary as the Seastar's allocator imposes restrictions
// on the number of threads that entered malloc/free/*. Unfortunately,
// RocksDB sharding in BlueStore dramatically lifted the number of
void PerfCounters::inc(int idx, uint64_t amt)
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return;
#endif
void PerfCounters::dec(int idx, uint64_t amt)
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return;
#endif
void PerfCounters::set(int idx, uint64_t amt)
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return;
#endif
uint64_t PerfCounters::get(int idx) const
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return 0;
#endif
void PerfCounters::tinc(int idx, utime_t amt)
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return;
#endif
void PerfCounters::tinc(int idx, ceph::timespan amt)
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return;
#endif
void PerfCounters::tset(int idx, utime_t amt)
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return;
#endif
void PerfCounters::tset(int idx, ceph::timespan amt)
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return;
#endif
utime_t PerfCounters::tget(int idx) const
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return utime_t();
#endif
void PerfCounters::hinc(int idx, int64_t x, int64_t y)
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return;
#endif
pair<uint64_t, uint64_t> PerfCounters::get_tavg_ns(int idx) const
{
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (!m_cct->_conf->perf)
return make_pair(0, 0);
#endif
m_lower_bound(lower_bound),
m_upper_bound(upper_bound),
m_name(name)
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
,
m_lock_name(std::string("PerfCounters::") + name.c_str()),
m_lock(ceph::make_mutex(m_lock_name))
int prio_adjust = 0;
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
const std::string m_lock_name;
/** Protects m_data */
ceph::mutex m_lock;
#include "common/intrusive_lru.h"
#include "include/utime.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "include/ipaddr.h"
#include "include/str_list.h"
#include "common/ceph_context.h"
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
#include "common/config.h"
#include "common/config_obs.h"
#endif
int grade_with_numa_node(const ifaddrs& ifa, int numa_node)
{
-#if defined(WITH_SEASTAR) || defined(_WIN32)
+#if defined(WITH_CRIMSON) || defined(_WIN32)
return 0;
#else
if (numa_node < 0) {
return best_addr;
}
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
// observe this change
struct Observer : public md_config_obs_t {
const std::string key;
}
}
}
-#endif // !WITH_SEASTAR
+#endif // !WITH_CRIMSON
static std::optional<entity_addr_t> get_one_address(
CephContext *cct,
#define CEPH_PICK_ADDRESS_DEFAULT_MON_PORTS 0x80
#define CEPH_PICK_ADDRESS_PUBLIC_BIND 0x100
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
/*
Pick addresses based on subnets if needed.
*/
void pick_addresses(CephContext *cct, int needs);
-#endif // !WITH_SEASTAR
+#endif // !WITH_CRIMSON
int pick_addresses(CephContext *cct, unsigned flags, entity_addrvec_t *addrs,
int preferred_numa_node = -1);
#include <map>
#include <list>
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include <boost/smart_ptr/local_shared_ptr.hpp>
#else
#include <memory>
template <class K, class V>
class SharedLRU {
CephContext *cct;
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
using VPtr = boost::local_shared_ptr<V>;
using WeakVPtr = boost::weak_ptr<V>;
#else
<< " (" << STRINGIFY(CEPH_GIT_VER) << ") "
<< ceph_release_name(CEPH_RELEASE)
<< " (" << CEPH_RELEASE_TYPE << ")"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
<< " (crimson)"
#endif
;
add_library(crimson::cflags INTERFACE IMPORTED)
-set(crimson_cflag_definitions "WITH_SEASTAR=1")
+set(crimson_cflag_definitions "WITH_CRIMSON=1")
set_target_properties(crimson::cflags PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${crimson_cflag_definitions}"
#include <map>
#include <deque>
#include <queue>
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
#include <atomic>
#include <mutex>
#include <condition_variable>
ClientInfoFunc client_info_f;
static constexpr bool is_dynamic_cli_info_f = U1;
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
static constexpr int data_mtx = 0;
struct DataGuard { DataGuard(int) {} };
#else
RejectThreshold reject_threshold = 0;
double anticipation_timeout;
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
bool finishing;
#else
std::atomic_bool finishing;
}
}; // class PullPriorityQueue
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
// TODO: PushPriorityQueue is not ported to seastar yet
// PUSH version
template<typename C, typename R, bool IsDelayed=false, bool U1=false, unsigned B=2>
}
}
}; // class PushPriorityQueue
-#endif // !WITH_SEASTAR
+#endif // !WITH_CRIMSON
} // namespace dmclock
} // namespace crimson
#include <string.h>
#include "common/ceph_context.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/config_proxy.h"
#endif
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
namespace ceph::global {
int __attribute__((weak)) g_conf_set_val(const std::string& key, const std::string& s) {
return 0;
namespace TOPNSPC::global {
CephContext *g_ceph_context = NULL;
ConfigProxy& g_conf() {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
return crimson::common::local_conf();
#else
return g_ceph_context->_conf;
#endif
}
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
int g_conf_set_val(const std::string& key, const std::string& s)
{
if (g_ceph_context != NULL)
#define CEPH_BUFFER_API
-#ifdef HAVE_SEASTAR
+#ifdef WITH_CRIMSON
namespace seastar {
template <typename T> class temporary_buffer;
namespace net {
class packet;
}
}
-#endif // HAVE_SEASTAR
+#endif // WITH_CRIMSON
class deleter;
template<typename T> class DencDumper;
ceph::unique_leakable_ptr<raw> create_small_page_aligned(unsigned len);
ceph::unique_leakable_ptr<raw> claim_buffer(unsigned len, char *buf, deleter del);
-#ifdef HAVE_SEASTAR
+#ifdef WITH_CRIMSON
/// create a raw buffer to wrap seastar cpu-local memory, using foreign_ptr to
/// make it safe to share between cpus
ceph::unique_leakable_ptr<buffer::raw> create(seastar::temporary_buffer<char>&& buf);
void zero(unsigned o, unsigned l, bool crc_reset = true);
unsigned append_zeros(unsigned l);
-#ifdef HAVE_SEASTAR
+#ifdef WITH_CRIMSON
/// create a temporary_buffer, copying the ptr as its deleter
operator seastar::temporary_buffer<char>() &;
/// convert to temporary_buffer, stealing the ptr as its deleter
operator seastar::temporary_buffer<char>() &&;
-#endif // HAVE_SEASTAR
+#endif // WITH_CRIMSON
};
}
}
-#ifdef HAVE_SEASTAR
+#ifdef WITH_CRIMSON
/// convert the bufferlist into a network packet
operator seastar::net::packet() &&;
#endif
#pragma once
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#define TOPNSPC crimson
#else
#define TOPNSPC ceph
#include <time.h>
#include <errno.h>
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include <seastar/core/lowres_clock.hh>
#endif
tv.tv_nsec = std::max<common_t>((std::chrono::duration_cast<std::chrono::nanoseconds>(dur) %
std::chrono::seconds(1)).count(), 0);
}
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
explicit utime_t(const seastar::lowres_system_clock::time_point& t) {
tv.tv_sec = std::chrono::duration_cast<std::chrono::seconds>(
t.time_since_epoch()).count();
#include "common/debug.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "include/libcephsqlite.h"
#include "SimpleRADOSStriper.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "common/debug.h"
#include "common/StackStringStream.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/config_proxy.h"
#else
#include "common/config_proxy.h"
#include "CInode.h"
#include "Mutation.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
tid(t), client_caps(caps), msg(NULL) {
client_type = m->get_source().type();
client_addrs = m->get_source_addrs();
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
ceph_abort("In crimson, conn is independently maintained outside Message");
#else
if (auto &con = m->get_connection()) {
uint64_t get_features() const {
if (features)
return features;
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
ceph_abort("In crimson, conn is independently maintained outside Message");
#else
return get_connection()->get_features();
spgid,
pg_shard_t(get_source().num(), notify.from),
notify,
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
features
#else
get_connection()->get_features()
virtual PGPeeringEvent *get_event() = 0;
virtual void inner_print(std::ostream& out) const = 0;
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
// In crimson, conn is independently maintained outside Message.
// Instead of get features from the connection later, set features at
// the start of the operation.
#include <sys/stat.h>
#include <fcntl.h>
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include <seastar/core/fstream.hh>
#include <seastar/core/reactor.hh>
#include <seastar/net/dns.hh>
using ceph::DNSResolver;
using ceph::Formatter;
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
namespace {
seastar::logger& logger()
{
}
}
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
seastar::future<> MonMap::read_monmap(const std::string& monmap)
{
}
}
-#else // WITH_SEASTAR
+#else // WITH_CRIMSON
int MonMap::init_with_monmap(const std::string& monmap, std::ostream& errout)
{
calc_legacy_ranks();
return 0;
}
-#endif // WITH_SEASTAR
+#endif // WITH_CRIMSON
#ifndef CEPH_MONMAP_H
#define CEPH_MONMAP_H
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include <seastar/core/future.hh>
#endif
class health_check_map_t;
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
namespace crimson::common {
class ConfigProxy;
}
* @param cct context (and associated config)
* @param errout std::ostream to send error messages too
*/
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
seastar::future<> build_initial(const crimson::common::ConfigProxy& conf, bool for_mkfs);
#else
int build_initial(CephContext *cct, bool for_mkfs, std::ostream& errout);
bool for_mkfs,
std::string_view prefix);
int init_with_config_file(const ConfigProxy& conf, std::ostream& errout);
-#if WITH_SEASTAR
+#if WITH_CRIMSON
seastar::future<> read_monmap(const std::string& monmap);
/// try to build monmap with different settings, like
/// mon_host, mon* sections, and mon_dns_srv_name
#include "auth/none/AuthNoneClientHandler.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "common/Timer.h"
#include "messages/PaxosServiceMessage.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
ceph::bufferlist& data,
Message::ConnectionRef conn)
{
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
// In crimson, conn is independently maintained outside Message.
ceph_assert(conn == nullptr);
#endif
if (front_crc != footer.front_crc) {
if (cct) {
ldout(cct, 0) << "bad crc in front " << front_crc << " != exp " << footer.front_crc
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
<< " from " << conn->get_peer_addr()
#endif
<< dendl;
if (middle_crc != footer.middle_crc) {
if (cct) {
ldout(cct, 0) << "bad crc in middle " << middle_crc << " != exp " << footer.middle_crc
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
<< " from " << conn->get_peer_addr()
#endif
<< dendl;
if (data_crc != footer.data_crc) {
if (cct) {
ldout(cct, 0) << "bad crc in data " << data_crc << " != exp " << footer.data_crc
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
<< " from " << conn->get_peer_addr()
#endif
<< dendl;
class Message : public RefCountedObject {
public:
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
// In crimson, conn is independently maintained outside Message.
using ConnectionRef = void*;
#else
}
public:
const ConnectionRef& get_connection() const {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
ceph_abort("In crimson, conn is independently maintained outside Message");
#endif
return connection;
}
void set_connection(ConnectionRef c) {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
// In crimson, conn is independently maintained outside Message.
ceph_assert(c == nullptr);
#endif
return entity_name_t(header.src);
}
entity_addr_t get_source_addr() const {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
ceph_abort("In crimson, conn is independently maintained outside Message");
#else
if (connection)
return entity_addr_t();
}
entity_addrvec_t get_source_addrs() const {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
ceph_abort("In crimson, conn is independently maintained outside Message");
#else
if (connection)
public:
using Message::Message;
bool is_a_client() const {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
ceph_abort("In crimson, conn is independently maintained outside Message");
#else
return get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_CLIENT;
#include "msg/async/Event.h"
#include "msg/msg_types.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
* @param journal path (or other descriptor) for journal (optional)
* @param flags which filestores should check if applicable
*/
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
static std::unique_ptr<ObjectStore> create(
CephContext *cct,
const std::string& type,
#include "include/ceph_assert.h"
#include "common/admin_socket.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
ClassHandler& ClassHandler::get_instance()
{
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
// the context is being used solely for:
// 1. random number generation (cls_gen_random_bytes)
// 2. accessing the configuration
static ClassHandler single(&cct);
#else
static ClassHandler single(g_ceph_context);
-#endif // WITH_SEASTAR
+#endif // WITH_CRIMSON
return single;
}
match_string = stringify(m->get_reqid().name);
break;
case OSDPerfMetricSubKeyType::CLIENT_ADDRESS:
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
match_string = stringify(op.get_connection()->get_peer_addr());
#else
match_string = stringify(m->get_connection()->get_peer_addr());
ostream &operator<<(ostream &lhs, const ECCommon::ReadOp &rhs)
{
lhs << "ReadOp(tid=" << rhs.tid;
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (rhs.op && rhs.op->get_req()) {
lhs << ", op=";
rhs.op->get_req()->print(lhs);
void ECCommon::ReadOp::dump(Formatter *f) const
{
f->dump_unsigned("tid", tid);
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (op && op->get_req()) {
f->dump_stream("op") << *(op->get_req());
}
<< " tt=" << rhs.trim_to
<< " tid=" << rhs.tid
<< " reqid=" << rhs.reqid;
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (rhs.client_op && rhs.client_op->get_req()) {
lhs << " client_op=";
rhs.client_op->get_req()->print(lhs);
std::move(to_read))).first->second;
dout(10) << __func__ << ": starting " << op << dendl;
if (_op) {
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
op.trace = _op->pg_trace;
#endif
op.trace.event("start ec read");
#include "erasure-code/ErasureCodeInterface.h"
#include "ECUtil.h"
#include "ECTypes.h"
-#if WITH_SEASTAR
+#if WITH_CRIMSON
#include "ExtentCache.h"
#include "crimson/osd/object_context.h"
#include "os/Transaction.h"
ostream &operator<<(ostream &lhs, const ECCommonL::ReadOp &rhs)
{
lhs << "ReadOp(tid=" << rhs.tid;
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (rhs.op && rhs.op->get_req()) {
lhs << ", op=";
rhs.op->get_req()->print(lhs);
void ECCommonL::ReadOp::dump(Formatter *f) const
{
f->dump_unsigned("tid", tid);
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (op && op->get_req()) {
f->dump_stream("op") << *(op->get_req());
}
<< " tt=" << rhs.trim_to
<< " tid=" << rhs.tid
<< " reqid=" << rhs.reqid;
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
if (rhs.client_op && rhs.client_op->get_req()) {
lhs << " client_op=";
rhs.client_op->get_req()->print(lhs);
std::move(to_read))).first->second;
dout(10) << __func__ << ": starting " << op << dendl;
if (_op) {
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
op.trace = _op->pg_trace;
#endif
op.trace.event("start ec read");
#include "erasure-code/ErasureCodeInterface.h"
#include "ECUtilL.h"
#include "ECTypes.h"
-#if WITH_SEASTAR
+#if WITH_CRIMSON
#include "ECExtentCacheL.h"
#include "crimson/osd/object_context.h"
#include "os/Transaction.h"
virtual void cancel_pull(
const hobject_t &soid) = 0;
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
// XXX
virtual pg_shard_t primary_shard() const = 0;
virtual bool pgb_is_primary() const = 0;
#endif
// XXX
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
virtual GenContext<ThreadPool::TPHandle&> *bless_unlocked_gencontext(
GenContext<ThreadPool::TPHandle&> *c) = 0;
#include "crush/CrushWrapper.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include <boost/smart_ptr/local_shared_ptr.hpp>
#endif
WRITE_CLASS_ENCODER_FEATURES(OSDMap)
WRITE_CLASS_ENCODER_FEATURES(OSDMap::Incremental)
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/local_shared_foreign_ptr.h"
using LocalOSDMapRef = boost::local_shared_ptr<const OSDMap>;
using OSDMapRef = crimson::local_shared_foreign_ptr<LocalOSDMapRef>;
void _dump(ceph::Formatter *f) const override;
bool has_feature(uint64_t f) const {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
ceph_abort("In crimson, conn is independently maintained outside Message");
#else
return request->get_connection()->has_feature(f);
set_missing_may_contain_deletes();
}
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
namespace {
struct FuturizedShardStoreLogReader {
#include <unordered_map>
#include <vector>
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include <seastar/core/future.hh>
#include "crimson/os/futurized_store.h"
#include "crimson/os/cyanstore/cyan_collection.h"
<< " log.dups.size()=" << log.dups.size() << dendl;
} // static read_log_and_missing
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
seastar::future<> read_log_and_missing_crimson(
crimson::os::FuturizedStore::Shard &store,
crimson::os::CollectionRef ch,
#include <optional>
#include "common/hobject.h"
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
#include "osd/osd_internal_types.h"
#else
#include "crimson/osd/object_context.h"
psdout(10) << "activate peer osd." << peer << " " << pi << dendl;
- #ifdef WITH_SEASTAR
+ #ifdef WITH_CRIMSON
MURef<MOSDPGLog> m;
#else
MRef<MOSDPGLog> m;
// [primary only] content recovery state
struct BufferedRecoveryMessages {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
std::map<int, std::vector<MessageURef>> message_map;
#else
std::map<int, std::vector<MessageRef>> message_map;
virtual uint64_t get_snap_trimq_size() const = 0;
/// Send cluster message to osd
- #ifdef WITH_SEASTAR
+ #ifdef WITH_CRIMSON
virtual void send_cluster_message(
int osd, MessageURef m, epoch_t epoch, bool share_map_update=false) = 0;
#else
*/
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/log.h"
#include "crimson/osd/pg_interval_interrupt_condition.h"
template <typename ValuesT = void>
return -ENOENT;
}
}
-#endif // WITH_SEASTAR
+#endif // WITH_CRIMSON
SnapMapper::SnapMapper(
CephContext* cct,
}
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
bool SnapMapper::Scrubber::_parse_p()
{
if (!psit->valid()) {
psit = ObjectMap::ObjectMapIterator();
mapit = ObjectMap::ObjectMapIterator();
}
-#endif // !WITH_SEASTAR
+#endif // !WITH_CRIMSON
// -------------------------------------
LEGACY_MAPPING_PREFIX;
}
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
/* Octopus modified the SnapMapper key format from
*
* <LEGACY_MAPPING_PREFIX><snapid>_<shardid>_<hobject_t::to_str()>
}
return 0;
}
-#endif // !WITH_SEASTAR
+#endif // !WITH_CRIMSON
#include "common/hobject.h"
#include "common/map_cacher.hpp"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
# include "crimson/os/futurized_store.h"
# include "crimson/os/futurized_collection.h"
#endif
#include "osd/SnapMapReaderI.h"
class OSDriver : public MapCacher::StoreDriver<std::string, ceph::buffer::list> {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
using ObjectStoreT = crimson::os::FuturizedStore::Shard;
using CollectionHandleT = ObjectStoreT::CollectionRef;
#else
return OSTransaction(ch->get_cid(), hoid, t);
}
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
OSDriver(ObjectStoreT *os, const coll_t& cid, const ghobject_t &hoid) :
OSDriver(os, os->open_collection(cid), hoid) {}
#endif
static const char *PURGED_SNAP_EPOCH_PREFIX;
static const char *PURGED_SNAP_PREFIX;
-#ifndef WITH_SEASTAR
+#ifndef WITH_CRIMSON
struct Scrubber {
CephContext *cct;
ObjectStore *store;
#include <string_view>
#include <boost/variant.hpp>
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include <boost/smart_ptr/local_shared_ptr.hpp>
#endif
* the might_have_unfound set
*/
class PastIntervals {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
using OSDMapRef = boost::local_shared_ptr<const OSDMap>;
#else
using OSDMapRef = std::shared_ptr<const OSDMap>;
#include "osd/scheduler/mClockScheduler.h"
#include "common/debug.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
CephContext* cct;
Scrub::ScrubSchedListener& osd_service;
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
auto& conf() const { return local_conf(); }
#else
auto& conf() const { return cct->_conf; }
#include <unordered_map>
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "common/config.h"
#include "rgw_dmclock.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "rgw_dmclock_sync_scheduler.h"
#include "rgw_dmclock_scheduler_ctx.h"
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
cmake_opts+=" -DWITH_GRAFANA=ON"
cmake_opts+=" -DWITH_SPDK=ON"
cmake_opts+=" -DWITH_RBD_MIRROR=ON"
- if [ $WITH_SEASTAR ]; then
- cmake_opts+=" -DWITH_SEASTAR=ON"
+ if [ $WITH_CRIMSON ]; then
+ cmake_opts+=" -DWITH_CRIMSON=ON"
fi
if [ $WITH_RBD_RWL ]; then
cmake_opts+=" -DWITH_RBD_RWL=ON"
if(WITH_RBD AND NOT WIN32)
add_subdirectory(rbd_mirror)
endif(WITH_RBD AND NOT WIN32)
-if(WITH_SEASTAR)
+if(WITH_CRIMSON)
add_subdirectory(crimson)
endif()
add_subdirectory(system)
#include "include/ceph_assert.h" // fio.h clobbers our assert.h
#include <algorithm>
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
public:
CctCleaner(CephContext* _cct) : cct(_cct) {}
~CctCleaner() {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
delete cct;
#else
cct->put();
public:
CctCleaner(CephContext* _cct) : cct(_cct) {}
~CctCleaner() {
-#ifdef WITH_SEASTAR
+#ifdef WITH_CRIMSON
delete cct;
#else
cct->put();