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>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/1] replication: check rs uuid on subscribe process
Date: Sat, 29 May 2021 00:20:46 +0200	[thread overview]
Message-ID: <705ae468-7849-7928-94ff-0ecefa6fdc07@tarantool.org> (raw)
In-Reply-To: <YLFpWz9ScYOREAq0@grain>

On 29.05.2021 00:06, Cyrill Gorcunov wrote:
> On Fri, May 28, 2021 at 10:35:42PM +0200, Vladislav Shpilevoy wrote:
>> +	if (!tt_uuid_is_equal(&peer_replicaset_uuid, &REPLICASET_UUID)) {
>> +		tnt_raise(ClientError, ER_REPLICASET_UUID_MISMATCH,
>> +			  tt_uuid_str(&REPLICASET_UUID),
>> +			  tt_uuid_str(&peer_replicaset_uuid));
>> +	}
> 
> Vlad, I didn't dive into the patch context yet but this
> use of *two* sequential calls of tt_uuid_str() is somehow
> suspicious. The tt_uuid_str uses single common buffer
> for any call which means some of tt_uuid_str() result
> will be overwritten, no?

Nope, the static buffer is cyclic. Each tt_uuid_str()
call uses only a part of it. In total it is safe to
make ~12 tt_uuid_str() calls in a row. Because the
static buffer size is 12KB, and one tt_uuid_str()
wastes 1KB (which is not necessary, it could be much
more compact).

  reply	other threads:[~2021-05-28 22:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 20:35 Vladislav Shpilevoy via Tarantool-patches
2021-05-28 22:06 ` Cyrill Gorcunov via Tarantool-patches
2021-05-28 22:20   ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-05-28 22:30     ` Cyrill Gorcunov via Tarantool-patches
2021-06-01  7:52     ` Cyrill Gorcunov via Tarantool-patches
2021-06-01  8:29 ` Serge Petrenko via Tarantool-patches
2021-06-01 21:34   ` Vladislav Shpilevoy via Tarantool-patches
2021-06-02  6:36     ` Serge Petrenko via Tarantool-patches
2021-06-02 20:16       ` Vladislav Shpilevoy via Tarantool-patches
2021-06-03  7:14         ` Serge Petrenko via Tarantool-patches
2021-06-03  7:18         ` Serge Petrenko 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=705ae468-7849-7928-94ff-0ecefa6fdc07@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] replication: check rs uuid on subscribe process' \
    /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