Skip to content

Commit

Permalink
mdbx++: добавление обработки MDBX_MVCC_RETARDED в C++ API.
Browse files Browse the repository at this point in the history
  • Loading branch information
erthink committed Aug 2, 2024
1 parent b6b1261 commit d21ae28
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions mdbx.h++
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ MDBX_DECLARE_EXCEPTION(transaction_overlapping);
MDBX_DECLARE_EXCEPTION(duplicated_lck_file);
MDBX_DECLARE_EXCEPTION(dangling_map_id);
MDBX_DECLARE_EXCEPTION(transaction_ousted);
MDBX_DECLARE_EXCEPTION(mvcc_retarded);
#undef MDBX_DECLARE_EXCEPTION

[[noreturn]] LIBMDBX_API void throw_too_small_target_buffer();
Expand Down
2 changes: 2 additions & 0 deletions src/mdbx.c++
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ DEFINE_EXCEPTION(transaction_overlapping)
DEFINE_EXCEPTION(duplicated_lck_file)
DEFINE_EXCEPTION(dangling_map_id)
DEFINE_EXCEPTION(transaction_ousted)
DEFINE_EXCEPTION(mvcc_retarded)
#undef DEFINE_EXCEPTION

__cold const char *error::what() const noexcept {
Expand Down Expand Up @@ -429,6 +430,7 @@ __cold void error::throw_exception() const {
CASE_EXCEPTION(duplicated_lck_file, MDBX_DUPLICATED_CLK);
CASE_EXCEPTION(dangling_map_id, MDBX_DANGLING_DBI);
CASE_EXCEPTION(transaction_ousted, MDBX_OUSTED);
CASE_EXCEPTION(mvcc_retarded, MDBX_MVCC_RETARDED);
#undef CASE_EXCEPTION
default:
if (is_mdbx_error())
Expand Down
4 changes: 4 additions & 0 deletions src/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ __cold const char *mdbx_liberr2str(int errnum) {
case MDBX_OUSTED:
return "MDBX_OUSTED: The parked read transaction was outed for the sake"
" of recycling old MVCC snapshots";
case MDBX_MVCC_RETARDED:
return "MDBX_MVCC_RETARDED: MVCC snapshot used by read transaction"
" is outdated and could not be copied"
" since corresponding meta-pages was overwritten";
default:
return nullptr;
}
Expand Down

0 comments on commit d21ae28

Please sign in to comment.