From d21ae28bb9a13cb18a13bc7c27d629f13a0cea17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Fri, 2 Aug 2024 19:03:34 +0300 Subject: [PATCH] =?UTF-8?q?mdbx++:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B8=20`MDBX=5FMVCC=5FRETARDED`=20=D0=B2=20C++=20?= =?UTF-8?q?API.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdbx.h++ | 1 + src/mdbx.c++ | 2 ++ src/misc.c | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/mdbx.h++ b/mdbx.h++ index 7ef55c18..0d2e8d09 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -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(); diff --git a/src/mdbx.c++ b/src/mdbx.c++ index adef7c34..d6ca4c11 100644 --- a/src/mdbx.c++ +++ b/src/mdbx.c++ @@ -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 { @@ -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()) diff --git a/src/misc.c b/src/misc.c index 415eee1c..bf8246ab 100644 --- a/src/misc.c +++ b/src/misc.c @@ -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; }