0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-29 04:08:54 +02:00

ircd::db: RocksDB to 5.12.2.

This commit is contained in:
Jason Volk 2018-04-09 12:55:22 -07:00
parent ecf0efa7be
commit 1268d90fb0
7 changed files with 23 additions and 13 deletions

View file

@ -847,7 +847,7 @@ AC_HELP_STRING([--with-included-rocksdb[[[=shared]]]], [Use the RocksDB sources
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
rocksdb_linkage="shared_lib" rocksdb_linkage="shared_lib"
AC_MSG_NOTICE([Shared RocksDB linkage requires running charybdis with an intact build directory]) AC_MSG_NOTICE([Shared RocksDB linkage requires running charybdis with an intact build directory])
ROCKSDB_LDFLAGS+=" -Wl,-rpath=$PWD/deps/rocksdb/" ROCKSDB_LDFLAGS+=" -Wl,-rpath=$PWD/deps/rocksdb"
AC_SUBST(ROCKSDB_LIBS, ["-lrocksdb"]) AC_SUBST(ROCKSDB_LIBS, ["-lrocksdb"])
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -857,7 +857,7 @@ AC_HELP_STRING([--with-included-rocksdb[[[=shared]]]], [Use the RocksDB sources
AC_SUBST(ROCKSDB_LIBS, ["$PWD/deps/rocksdb/librocksdb.a"]) AC_SUBST(ROCKSDB_LIBS, ["$PWD/deps/rocksdb/librocksdb.a"])
fi fi
bash tools/buildrocks.sh $rocksdb_linkage bash tools/buildrocks.sh $rocksdb_linkage "v5.12.2"
AS_IF([ test $? != 0 ], AS_IF([ test $? != 0 ],
[ [
AC_MSG_ERROR([Failed to build RocksDB]) AC_MSG_ERROR([Failed to build RocksDB])

2
deps/rocksdb vendored

@ -1 +1 @@
Subproject commit 7f5f0e0c03d20f84653a991de324810d16a33822 Subproject commit 8969445642039566214d650cc6614849e7dd5e17

View file

@ -24,7 +24,7 @@ namespace ircd::db
// Property information interface // Property information interface
using prop_int = uint64_t; using prop_int = uint64_t;
using prop_str = std::string; using prop_str = std::string;
using prop_map = std::map<std::string, double>; using prop_map = std::map<std::string, std::string>;
template<class R = prop_int> R property(const database &, const string_view &name); template<class R = prop_int> R property(const database &, const string_view &name);
template<> prop_int property(const database &, const string_view &name); template<> prop_int property(const database &, const string_view &name);

View file

@ -84,6 +84,7 @@ struct ircd::db::database::env final
Status GetThreadList(std::vector<ThreadStatus>* thread_list) noexcept override; Status GetThreadList(std::vector<ThreadStatus>* thread_list) noexcept override;
ThreadStatusUpdater* GetThreadStatusUpdater() const noexcept override; ThreadStatusUpdater* GetThreadStatusUpdater() const noexcept override;
uint64_t GetThreadID() const noexcept override; uint64_t GetThreadID() const noexcept override;
int GetBackgroundThreads(Priority pri) noexcept override;
env(database *const &d); env(database *const &d);
~env() noexcept; ~env() noexcept;

View file

@ -38,7 +38,7 @@ AM_LDFLAGS = \
-Wl,--icf=all \ -Wl,--icf=all \
-Wl,-z -Wl,now \ -Wl,-z -Wl,now \
$(PLATFORM_LDFLAGS) \ $(PLATFORM_LDFLAGS) \
# -Wl,--no-undefined \ -Wl,--no-undefined \
### ###
libircd_LTLIBRARIES = libircd.la libircd_LTLIBRARIES = libircd.la

View file

@ -1085,8 +1085,14 @@ catch(const std::exception &e)
void void
ircd::db::log_rdb_perf_context(const bool &all) ircd::db::log_rdb_perf_context(const bool &all)
{ {
const auto pc
{
rocksdb::get_perf_context()
};
assert(pc);
const bool exclude_zeros(!all); const bool exclude_zeros(!all);
log.debug("%s", rocksdb::perf_context.ToString(exclude_zeros)); log.debug("%s", pc->ToString(exclude_zeros));
} }
uint64_t uint64_t
@ -1740,6 +1746,13 @@ const noexcept
return defaults.GetThreadID(); return defaults.GetThreadID();
} }
int
ircd::db::database::env::GetBackgroundThreads(Priority pri)
noexcept
{
return defaults.GetBackgroundThreads(pri);
}
// //
// writable_file // writable_file
// //
@ -3670,7 +3683,7 @@ ircd::db::prop_map
ircd::db::property(const column &column, ircd::db::property(const column &column,
const string_view &name) const string_view &name)
{ {
std::map<std::string, double> ret; std::map<std::string, std::string> ret;
database::column &c(const_cast<db::column &>(column)); database::column &c(const_cast<db::column &>(column));
database &d(const_cast<db::column &>(column)); database &d(const_cast<db::column &>(column));
d.d->GetMapProperty(c, slice(name), &ret); d.d->GetMapProperty(c, slice(name), &ret);
@ -5191,6 +5204,7 @@ ircd::db::reflect(const rocksdb::Env::Priority &p)
{ {
switch(p) switch(p)
{ {
case rocksdb::Env::Priority::BOTTOM: return "BOTTOM"_sv;
case rocksdb::Env::Priority::LOW: return "LOW"_sv; case rocksdb::Env::Priority::LOW: return "LOW"_sv;
case rocksdb::Env::Priority::HIGH: return "HIGH"_sv; case rocksdb::Env::Priority::HIGH: return "HIGH"_sv;
case rocksdb::Env::Priority::TOTAL: return "TOTAL"_sv; case rocksdb::Env::Priority::TOTAL: return "TOTAL"_sv;

View file

@ -10,11 +10,6 @@ if [ -z $BRANCH ]; then
BRANCH="master" BRANCH="master"
fi fi
JOBS=$3
if [ -z $JOBS ]; then
JOBS=4
fi
run () run ()
{ {
COMMAND=$1 COMMAND=$1
@ -53,5 +48,5 @@ run git submodule update --init deps/rocksdb
run cd deps/rocksdb run cd deps/rocksdb
run git checkout $BRANCH run git checkout $BRANCH
CFLAGS=-fPIC run make -j$JOBS $LINKAGE CFLAGS="-fPIC -frtti -DROCKSDB_USE_RTTI" run make -j4 $LINKAGE
run cd $USERDIR # Return to user's original directory run cd $USERDIR # Return to user's original directory