[Tarantool-patches] [PATCH v2 2/8] txn_limbo: fix promote term filtering
Cyrill Gorcunov
gorcunov at gmail.com
Fri Jun 18 01:05:07 MSK 2021
On Fri, Jun 18, 2021 at 12:07:36AM +0300, Serge Petrenko wrote:
> txn_limbo_process() used to filter out promote requests whose term was
> equal to the greatest term seen. This wasn't correct for PROMOTE entries
> with term 1.
...
> + if (term > limbo->promote_greatest_term) {
> + limbo->promote_greatest_term = term;
> + } else if (req->type == IPROTO_PROMOTE &&
> + limbo->promote_greatest_term > 1) {
> + /* PROMOTE for outdated term. Ignore. */
> + say_info("RAFT: ignoring PROMOTE request from instance "
> + "id %"PRIu32" for term %"PRIu64". Greatest term seen "
> + "before (%"PRIu64") is bigger.", origin, term,
> + limbo->promote_greatest_term);
> + return;
> }
Serge, please don't use PRIx helper, they are completely unreadable.
As far as I remember we agreed to use %llu with explicit long long
conversion. Ie
say_info("RAFT: ignoring PROMOTE request from instance "
"id %u for term %lld . Greatest term seen "
"before (%llu) is bigger.", origin, (long long)term,
(long long)limbo->promote_greatest_term);
surely we can fix it on top of the series.
More information about the Tarantool-patches
mailing list