Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Konstantin Belyavskiy" <k.belyavskiy@tarantool.org>
To: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [tarantool-patches] Re: [PATCH 2/2] replication: display downstream status at upstream
Date: Tue, 22 May 2018 13:44:06 +0300	[thread overview]
Message-ID: <1526985846.442620261@f468.i.mail.ru> (raw)
In-Reply-To: <20180522070716.fnrhrzkmnmedaspe@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]

Kirill,
thank you for mention that. In earlier version relay could be a NULL pointer but now
it could be deleted only with replica.
So it's outdated code.
> + assert(replica->relay);


>Вторник, 22 мая 2018, 10:08 +03:00 от Kirill Yukhin <kyukhin@tarantool.org>:
>
>Hello Kostya,
>On 21 мая 20:07, Konstantin Belyavskiy wrote:
>> This fix improves 'box.info.replication' output.
>> If downstream fails and thus disconnects from upstream, improve
>> logging by printing 'status: disconnected' and error message on
>> both sides (master and replica).
>> 
>> Closes #3365
>> ---
>> diff --git a/src/box/lua/info.c b/src/box/lua/info.c
>> index 9dbc3f92c..8f358d04e 100644
>> --- a/src/box/lua/info.c
>> +++ b/src/box/lua/info.c
>> @@ -148,6 +148,23 @@ lbox_pushreplica(lua_State *L, struct replica *replica)
>>  	if (relay_get_state(replica->relay) == RELAY_FOLLOW) {
>>  		lua_pushstring(L, "downstream");
>>  		lbox_pushrelay(L, relay);
>> +		lua_settable(L, -3);
>> +	} else if (relay_get_state(replica->relay) == RELAY_STOPPED) {
>> +		lua_pushstring(L, "downstream");
>> +
>> +		lua_newtable(L);
>> +		lua_pushstring(L, "status");
>> +		lua_pushstring(L, "stopped");
>> +		lua_settable(L, -3);
>> +
>> +		assert(replica->relay);
>Few lines above you dereferenced replica (in if-stmt). Why this assert?
>If it is necessary, please note that relay is a pointer and should be compared
>against NULL according to coding style.
>
>--
>Regards, Kirill Yukhin
>


Best regards,
Konstantin Belyavskiy
k.belyavskiy@tarantool.org

[-- Attachment #2: Type: text/html, Size: 2258 bytes --]

  reply	other threads:[~2018-05-22 10:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 17:07 [PATCH 0/2] replication: improve logging Konstantin Belyavskiy
2018-05-21 17:07 ` [PATCH 1/2] replication: do not delete relay on applier disconnect Konstantin Belyavskiy
2018-05-21 18:50   ` Konstantin Osipov
2018-05-21 17:07 ` [PATCH 2/2] replication: display downstream status at upstream Konstantin Belyavskiy
2018-05-22  7:07   ` [tarantool-patches] " Kirill Yukhin
2018-05-22 10:44     ` Konstantin Belyavskiy [this message]
2018-05-22 11:24       ` [tarantool-patches] " Kirill Yukhin
2018-05-29 16:44       ` Konstantin Osipov
2018-05-22  7:08 ` [tarantool-patches] [PATCH 0/2] replication: improve logging Kirill Yukhin

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=1526985846.442620261@f468.i.mail.ru \
    --to=k.belyavskiy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [tarantool-patches] Re: [PATCH 2/2] replication: display downstream status at upstream' \
    /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