mirror of
https://github.com/isar/libmdbx.git
synced 2025-02-01 06:48:21 +08:00
mdbx: fix percent in mdbx_txn_straggler().
fix 75ab3716fb7cc9ffec0dd4336666bc0d2b25c60c Change-Id: Ia63d89d189640c617da6e5e5c4567f5f8a2b84f8
This commit is contained in:
parent
b949bbd169
commit
a47cdfebba
2
mdb.c
2
mdb.c
@ -3106,7 +3106,7 @@ int mdbx_txn_straggler(MDB_txn *txn, int *percent)
|
||||
size_t last = meta->mm_last_pg + 1;
|
||||
if (env->me_txn)
|
||||
last = env->me_txn0->mt_next_pgno;
|
||||
*percent = (last + maxpg / 2) * 100u / maxpg;
|
||||
*percent = (last * 100ull + maxpg / 2) / maxpg;
|
||||
}
|
||||
lag = meta->mm_txnid - txn->mt_u.reader->mr_txnid;
|
||||
return (0 > (long) lag) ? ~0u >> 1: lag;
|
||||
|
Loading…
x
Reference in New Issue
Block a user