mdbx: fix percent in mdbx_txn_straggler().

fix 75ab3716fb7cc9ffec0dd4336666bc0d2b25c60c

Change-Id: Ia63d89d189640c617da6e5e5c4567f5f8a2b84f8
This commit is contained in:
Leo Yuriev 2016-02-08 13:10:17 +03:00
parent b949bbd169
commit a47cdfebba

2
mdb.c
View File

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