Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>,
	tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v2 09/10] wal: fix say_x format
Date: Wed, 24 Feb 2021 23:41:18 +0100	[thread overview]
Message-ID: <f2a95b6a-df2a-19c3-abf9-6a5d252876be@tarantool.org> (raw)
In-Reply-To: <20210224153626.121506-10-gorcunov@gmail.com>

Thanks for the patch!

On 24.02.2021 16:36, Cyrill Gorcunov via Tarantool-patches wrote:
>  - vclock_get returns int64_t
>  - vclock_sum returns int64_t
> 
> Part-of #5846
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> ---
>  src/box/wal.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/src/box/wal.c b/src/box/wal.c
> index 937d47ba9..1c0076f26 100644
> --- a/src/box/wal.c
> +++ b/src/box/wal.c
> @@ -993,13 +993,14 @@ wal_assign_lsn(struct vclock *vclock_diff, struct vclock *base,
>  			int64_t diff = (*row)->lsn - vclock_get(base, (*row)->replica_id);
>  			if (diff <= vclock_get(vclock_diff,
>  					       (*row)->replica_id)) {
> +				int64_t confirmed_lsn =
> +					vclock_get(base, (*row)->replica_id) +
> +					vclock_get(vclock_diff, (*row)->replica_id);
>  				say_crit("Attempt to write a broken LSN to WAL:"
> -					 " replica id: %d, confirmed lsn: %d,"
> -					 " new lsn %d", (*row)->replica_id,
> -					 vclock_get(base, (*row)->replica_id) +
> -					 vclock_get(vclock_diff,
> -						    (*row)->replica_id),
> -						    (*row)->lsn);
> +					 " replica id: %d, confirmed lsn: %lld,"

`replica_id` is uint32_t. So it should be %u and cast to (unsigned) I suppose.

> +					 " new lsn %lld", (*row)->replica_id,
> +					 (long long)confirmed_lsn,
> +					 (long long)(*row)->lsn);
>  				assert(false);
>  			} else {
>  				vclock_follow(vclock_diff, (*row)->replica_id, diff);
> @@ -1241,7 +1242,7 @@ wal_write_async(struct journal *journal, struct journal_entry *entry)
>  		 */
>  		say_error("Aborting transaction %llu during "
>  			  "cascading rollback",
> -			  vclock_sum(&writer->vclock));
> +			  (long long)vclock_sum(&writer->vclock));

Long long should use %lld, not %llu. I have no idea why is the format checker
silent about this.

  reply	other threads:[~2021-02-24 22:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 18:20 [Tarantool-patches] [PATCH] say: fix format for fiber()->fid Cyrill Gorcunov via Tarantool-patches
2021-02-22 18:23 ` Cyrill Gorcunov via Tarantool-patches
2021-02-23 20:41 ` Vladislav Shpilevoy via Tarantool-patches
2021-02-23 21:49   ` Cyrill Gorcunov via Tarantool-patches
2021-02-23 22:47     ` Vladislav Shpilevoy via Tarantool-patches
2021-02-24  8:28       ` Cyrill Gorcunov via Tarantool-patches
2021-02-24 22:39         ` Vladislav Shpilevoy via Tarantool-patches
2021-02-24 15:36 ` [Tarantool-patches] [PATCH v2 00/10] say: fix format strings Cyrill Gorcunov via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 01/10] say: use unsigned format for fiber()->fid Cyrill Gorcunov via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 02/10] popen: fix say_x format arguments Cyrill Gorcunov via Tarantool-patches
2021-02-24 22:39     ` Vladislav Shpilevoy via Tarantool-patches
2021-02-25  7:27       ` Cyrill Gorcunov via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 03/10] raft: fix say_x arguments Cyrill Gorcunov via Tarantool-patches
2021-02-24 22:39     ` Vladislav Shpilevoy via Tarantool-patches
2021-02-25  7:50       ` Cyrill Gorcunov via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 04/10] box/error: fix argument for CustomError Cyrill Gorcunov via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 05/10] xlog: fix say_x format Cyrill Gorcunov via Tarantool-patches
2021-02-24 22:40     ` Vladislav Shpilevoy via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 06/10] box/vynil: " Cyrill Gorcunov via Tarantool-patches
2021-02-24 22:43     ` Vladislav Shpilevoy via Tarantool-patches
2021-02-26  8:13       ` Nikita Pettik via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 07/10] txn: " Cyrill Gorcunov via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 08/10] limbo: " Cyrill Gorcunov via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 09/10] wal: " Cyrill Gorcunov via Tarantool-patches
2021-02-24 22:41     ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-02-25  7:52       ` Cyrill Gorcunov via Tarantool-patches
2021-02-24 15:36   ` [Tarantool-patches] [PATCH v2 10/10] say: fix CFORMAT specification Cyrill Gorcunov via Tarantool-patches
2021-02-24 22:41     ` Vladislav Shpilevoy via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f2a95b6a-df2a-19c3-abf9-6a5d252876be@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 09/10] wal: fix say_x format' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox