<HTML><BODY>Kirill,<br>thank you for mention that. In earlier version relay could be a NULL pointer but now<br>it could be deleted only with replica.<br>So it's outdated code.<br>> + assert(replica->relay);<br><br><br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
Вторник, 22 мая 2018, 10:08 +03:00 от Kirill Yukhin <kyukhin@tarantool.org>:<br>
<br>
<div id="">
<div class="js-helper js-readmsg-msg">
<style type="text/css"></style>
<div>
<base target="_self" href="https://e.mail.ru/">
<div id="style_15269728860000001015_BODY">Hello Kostya,<br>
On 21 мая 20:07, Konstantin Belyavskiy wrote:<br>
<div class="mail-quote-collapse">> This fix improves 'box.info.replication' output.<br>
> If downstream fails and thus disconnects from upstream, improve<br>
> logging by printing 'status: disconnected' and error message on<br>
> both sides (master and replica).<br>
> <br>
> Closes #3365<br>
> ---<br>
> diff --git a/src/box/lua/info.c b/src/box/lua/info.c<br>
> index 9dbc3f92c..8f358d04e 100644<br>
> --- a/src/box/lua/info.c<br>
> +++ b/src/box/lua/info.c<br>
> @@ -148,6 +148,23 @@ lbox_pushreplica(lua_State *L, struct replica *replica)<br>
> if (relay_get_state(replica->relay) == RELAY_FOLLOW) {<br>
> lua_pushstring(L, "downstream");<br>
> lbox_pushrelay(L, relay);<br>
> + lua_settable(L, -3);<br>
> + } else if (relay_get_state(replica->relay) == RELAY_STOPPED) {<br>
> + lua_pushstring(L, "downstream");<br>
> +<br>
> + lua_newtable(L);<br>
> + lua_pushstring(L, "status");<br>
> + lua_pushstring(L, "stopped");<br>
> + lua_settable(L, -3);<br>
> +<br>
> + assert(replica->relay);<br>
</div>Few lines above you dereferenced replica (in if-stmt). Why this assert?<br>
If it is necessary, please note that relay is a pointer and should be compared<br>
against NULL according to coding style.<br>
<br>
--<br>
Regards, Kirill Yukhin<br>
<br>
</div>
<base target="_self" href="https://e.mail.ru/">
</div>
</div>
</div>
</blockquote>
<br>
<br>Best regards,<br>Konstantin Belyavskiy<br>k.belyavskiy@tarantool.org<br></BODY></HTML>