mirror of
https://github.com/matrix-construct/construct
synced 2024-11-20 00:33:15 +01:00
ircd::db: Improve shutdown sequence.
This commit is contained in:
parent
ba10948e9d
commit
495b70ec6d
1 changed files with 9 additions and 13 deletions
22
ircd/db.cc
22
ircd/db.cc
|
@ -1383,7 +1383,7 @@ ircd::db::database::~database()
|
||||||
noexcept try
|
noexcept try
|
||||||
{
|
{
|
||||||
const ctx::uninterruptible::nothrow ui;
|
const ctx::uninterruptible::nothrow ui;
|
||||||
|
const std::unique_lock<decltype(write_mutex)> lock{write_mutex};
|
||||||
log::info
|
log::info
|
||||||
{
|
{
|
||||||
log, "'%s': closing database @ `%s'...",
|
log, "'%s': closing database @ `%s'...",
|
||||||
|
@ -1391,13 +1391,7 @@ noexcept try
|
||||||
path
|
path
|
||||||
};
|
};
|
||||||
|
|
||||||
rocksdb::CancelAllBackgroundWork(d.get(), true); // true = blocking
|
bgcancel(*this, true);
|
||||||
log::debug
|
|
||||||
{
|
|
||||||
log, "'%s': background_errors: %lu; flushing...",
|
|
||||||
name,
|
|
||||||
property<uint64_t>(*this, rocksdb::DB::Properties::kBackgroundErrors)
|
|
||||||
};
|
|
||||||
|
|
||||||
flush(*this);
|
flush(*this);
|
||||||
log::debug
|
log::debug
|
||||||
|
@ -1433,6 +1427,8 @@ noexcept try
|
||||||
d->Close()
|
d->Close()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
env->st.reset(nullptr);
|
||||||
|
|
||||||
log::info
|
log::info
|
||||||
{
|
{
|
||||||
log, "'%s': closed database @ `%s' at sequence number %lu.",
|
log, "'%s': closed database @ `%s' at sequence number %lu.",
|
||||||
|
@ -3480,11 +3476,6 @@ st{std::make_unique<state>(d)}
|
||||||
ircd::db::database::env::~env()
|
ircd::db::database::env::~env()
|
||||||
noexcept
|
noexcept
|
||||||
{
|
{
|
||||||
log::debug
|
|
||||||
{
|
|
||||||
log, "'%s': Shutting down environment...",
|
|
||||||
d.name
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rocksdb::Status
|
rocksdb::Status
|
||||||
|
@ -7394,6 +7385,11 @@ ircd::db::database::env::state::state(database *const &d)
|
||||||
ircd::db::database::env::state::~state()
|
ircd::db::database::env::state::~state()
|
||||||
noexcept
|
noexcept
|
||||||
{
|
{
|
||||||
|
log::debug
|
||||||
|
{
|
||||||
|
log, "'%s': Shutting down environment...",
|
||||||
|
d.name
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue