From 5fd05db6eaedcb06a643226f538983c342bb6a57 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 17 Jan 2019 23:14:25 +0300 Subject: [PATCH] mdbx: minor fix/refine mdbx_txn_straggler() for r/w-txn. Change-Id: Id44a1db414de457d74a3e1d9d5c96064a7278080 --- mdbx.h | 4 ++-- src/mdbx.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mdbx.h b/mdbx.h index ddf1a040..e3ee6cef 100644 --- a/mdbx.h +++ b/mdbx.h @@ -1,4 +1,4 @@ -/* LICENSE AND COPYRUSTING ***************************************************** +/* LICENSE AND COPYRUSTING ***************************************************** * * Copyright 2015-2018 Leonid Yuriev * and other libmdbx authors: please see AUTHORS file. @@ -1601,7 +1601,7 @@ LIBMDBX_API int mdbx_env_set_syncbytes(MDBX_env *env, size_t bytes); * [out] percent Percentage of page allocation in the database. * * Returns Number of transactions committed after the given was started for - * read, or -1 on failure. */ + * read, or negative value on failure. */ LIBMDBX_API int mdbx_txn_straggler(MDBX_txn *txn, int *percent); /* A callback function for killing a laggard readers, diff --git a/src/mdbx.c b/src/mdbx.c index 1f9357d2..6e59a42b 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -12810,7 +12810,7 @@ int mdbx_txn_straggler(MDBX_txn *txn, int *percent) *percent = (int)((txn->mt_next_pgno * UINT64_C(100) + txn->mt_end_pgno / 2) / txn->mt_end_pgno); - return -1; + return 0; } txnid_t recent;