[Tarantool-patches] [PATCH v2 03/10] raft: fix say_x arguments

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Feb 25 01:39:47 MSK 2021


Thanks for the patch!

On 24.02.2021 16:36, Cyrill Gorcunov wrote:
> Use explicit "%lld" for int64_t type.

In the changes you use %llu in both cases.

> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> ---
>  src/lib/raft/raft.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lib/raft/raft.c b/src/lib/raft/raft.c
> index 4ea4fc3f8..261ff072b 100644
> --- a/src/lib/raft/raft.c
> +++ b/src/lib/raft/raft.c
> @@ -322,7 +322,8 @@ raft_process_msg(struct raft *raft, const struct raft_msg *req, uint32_t source)
>  	/* Outdated request. */
>  	if (req->term < raft->volatile_term) {
>  		say_info("RAFT: the message is ignored due to outdated term - "
> -			 "current term is %u", raft->volatile_term);
> +			 "current term is %llu",
> +			 (long long)raft->volatile_term);

It is unsigned. So the cast must be 'unsigned long long'.
The same below.

>  		return 0;
>  	}
>  
> @@ -653,7 +654,7 @@ raft_sm_become_candidate(struct raft *raft)
>  static void
>  raft_sm_schedule_new_term(struct raft *raft, uint64_t new_term)
>  {
> -	say_info("RAFT: bump term to %llu, follow", new_term);
> +	say_info("RAFT: bump term to %llu, follow", (long long)new_term);
>  	assert(new_term > raft->volatile_term);
>  	assert(raft->volatile_term >= raft->term);
>  	raft->volatile_term = new_term;
> 


More information about the Tarantool-patches mailing list