From 2e7d325cf1ac5ff0bb093e21516223b54d261bce 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: Wed, 24 Jul 2024 15:27:48 +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=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=D0=B6=D0=BA=D0=B8=20`MDBX=5FOUSTED`=20=D0=B2=20`mdbx=5Fstrerro?= =?UTF-8?q?r()`=20=D0=B8=20C++=20API.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdbx.h | 3 ++- mdbx.h++ | 1 + src/mdbx.c++ | 3 ++- src/misc.c | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mdbx.h b/mdbx.h index edfd3df2..9ae8b798 100644 --- a/mdbx.h +++ b/mdbx.h @@ -1982,7 +1982,8 @@ typedef enum MDBX_error { * corresponding DBI-handle could be (re)used */ MDBX_DANGLING_DBI = -30412, - /** Транзакция была асинхронно отменена/вытеснена */ + /** The parked read transaction was outed for the sake of + * recycling old MVCC snapshots. */ MDBX_OUSTED = -30411, /* The last of MDBX-added error codes */ diff --git a/mdbx.h++ b/mdbx.h++ index 58a2b7ce..9d2197bb 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -582,6 +582,7 @@ MDBX_DECLARE_EXCEPTION(transaction_full); MDBX_DECLARE_EXCEPTION(transaction_overlapping); MDBX_DECLARE_EXCEPTION(duplicated_lck_file); MDBX_DECLARE_EXCEPTION(dangling_map_id); +MDBX_DECLARE_EXCEPTION(transaction_ousted); #undef MDBX_DECLARE_EXCEPTION [[noreturn]] LIBMDBX_API void throw_too_small_target_buffer(); diff --git a/src/mdbx.c++ b/src/mdbx.c++ index 583b46a4..adef7c34 100644 --- a/src/mdbx.c++ +++ b/src/mdbx.c++ @@ -339,7 +339,7 @@ DEFINE_EXCEPTION(transaction_full) DEFINE_EXCEPTION(transaction_overlapping) DEFINE_EXCEPTION(duplicated_lck_file) DEFINE_EXCEPTION(dangling_map_id) - +DEFINE_EXCEPTION(transaction_ousted) #undef DEFINE_EXCEPTION __cold const char *error::what() const noexcept { @@ -428,6 +428,7 @@ __cold void error::throw_exception() const { CASE_EXCEPTION(transaction_overlapping, MDBX_TXN_OVERLAPPING); CASE_EXCEPTION(duplicated_lck_file, MDBX_DUPLICATED_CLK); CASE_EXCEPTION(dangling_map_id, MDBX_DANGLING_DBI); + CASE_EXCEPTION(transaction_ousted, MDBX_OUSTED); #undef CASE_EXCEPTION default: if (is_mdbx_error()) diff --git a/src/misc.c b/src/misc.c index 5c61d641..b6839c11 100644 --- a/src/misc.c +++ b/src/misc.c @@ -168,6 +168,9 @@ __cold const char *mdbx_liberr2str(int errnum) { case MDBX_DANGLING_DBI: return "MDBX_DANGLING_DBI: Some cursors and/or other resources should be" " closed before subDb or corresponding DBI-handle could be (re)used"; + case MDBX_OUSTED: + return "MDBX_OUSTED: The parked read transaction was outed for the sake" + " of recycling old MVCC snapshots"; default: return nullptr; }