mirror of
https://github.com/matrix-construct/construct
synced 2024-10-01 21:28:53 +02:00
ircd::db: Add some exception handlers on these envs.
This commit is contained in:
parent
b5c2270e8c
commit
b8936261b5
1 changed files with 34 additions and 3 deletions
37
ircd/db.cc
37
ircd/db.cc
|
@ -2921,7 +2921,7 @@ noexcept
|
||||||
rocksdb::Status
|
rocksdb::Status
|
||||||
ircd::db::database::env::random_access_file::Prefetch(uint64_t offset,
|
ircd::db::database::env::random_access_file::Prefetch(uint64_t offset,
|
||||||
size_t length)
|
size_t length)
|
||||||
noexcept
|
noexcept try
|
||||||
{
|
{
|
||||||
#ifdef RB_DEBUG_DB_ENV
|
#ifdef RB_DEBUG_DB_ENV
|
||||||
log::debug
|
log::debug
|
||||||
|
@ -2934,16 +2934,32 @@ noexcept
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
fs::prefetch(fd, length, offset);
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
catch(const fs::filesystem_error &e)
|
||||||
|
{
|
||||||
|
log::error
|
||||||
|
{
|
||||||
|
log, "'%s': rfile:%p prefetch offset:%zu length:%zu :%s",
|
||||||
|
d.name,
|
||||||
|
this,
|
||||||
|
offset,
|
||||||
|
length,
|
||||||
|
e.what()
|
||||||
|
};
|
||||||
|
|
||||||
|
return Status::InvalidArgument();
|
||||||
|
}
|
||||||
|
|
||||||
rocksdb::Status
|
rocksdb::Status
|
||||||
ircd::db::database::env::random_access_file::Read(uint64_t offset,
|
ircd::db::database::env::random_access_file::Read(uint64_t offset,
|
||||||
size_t length,
|
size_t length,
|
||||||
Slice *result,
|
Slice *result,
|
||||||
char *scratch)
|
char *scratch)
|
||||||
const noexcept
|
const noexcept try
|
||||||
{
|
{
|
||||||
|
assert(result);
|
||||||
#ifdef RB_DEBUG_DB_ENV
|
#ifdef RB_DEBUG_DB_ENV
|
||||||
log::debug
|
log::debug
|
||||||
{
|
{
|
||||||
|
@ -2957,7 +2973,6 @@ const noexcept
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
assert(result);
|
|
||||||
const mutable_buffer buf
|
const mutable_buffer buf
|
||||||
{
|
{
|
||||||
scratch, length
|
scratch, length
|
||||||
|
@ -2972,6 +2987,22 @@ const noexcept
|
||||||
|
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
catch(const fs::filesystem_error &e)
|
||||||
|
{
|
||||||
|
log::error
|
||||||
|
{
|
||||||
|
log, "'%s': rfile:%p read:%p offset:%zu length:%zu scratch:%p :%s",
|
||||||
|
d.name,
|
||||||
|
this,
|
||||||
|
result,
|
||||||
|
offset,
|
||||||
|
length,
|
||||||
|
scratch,
|
||||||
|
e.what()
|
||||||
|
};
|
||||||
|
|
||||||
|
return Status::InvalidArgument();
|
||||||
|
}
|
||||||
|
|
||||||
rocksdb::Status
|
rocksdb::Status
|
||||||
ircd::db::database::env::random_access_file::InvalidateCache(size_t offset,
|
ircd::db::database::env::random_access_file::InvalidateCache(size_t offset,
|
||||||
|
|
Loading…
Reference in a new issue