• zhaozhao.zz's avatar
    Calculate the incremental rehash time more precisely (#13063) · 8876d264
    zhaozhao.zz authored
    In the `databasesCron()`, the time consumed by
    `kvstoreIncrementallyRehash()` is used to calculate the exit condition.
    However, within `kvstoreIncrementallyRehash()`, the loop first checks
    for timeout before performing rehashing. Therefore, the time for the
    last rehash isn't accounted for, making the consumed time inaccurate. We
    need to precisely calculate all the time spent on rehashing.
    Additionally, the time allocated to `kvstoreIncrementallyRehash()`
    should be the remaining time, which is
    `INCREMENTAL_REHASHING_THRESHOLD_US` minus the already consumed
    `elapsed_us`.
    8876d264
kvstore.c 28.2 KB