mdbx: minor fix/refine mdbx_txn_straggler() for r/w-txn.

Change-Id: Id44a1db414de457d74a3e1d9d5c96064a7278080
This commit is contained in:
Leonid Yuriev 2019-01-17 23:14:25 +03:00
parent 4708e0cf79
commit 5fd05db6ea
2 changed files with 3 additions and 3 deletions

4
mdbx.h
View File

@ -1,4 +1,4 @@
/* LICENSE AND COPYRUSTING *****************************************************
/* LICENSE AND COPYRUSTING *****************************************************
*
* Copyright 2015-2018 Leonid Yuriev <leo@yuriev.ru>
* 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,

View File

@ -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;