<HTML><BODY>Ok, so we can keep relay state and get last error from it.<br>For example in case of disconnect (broken pipe) we got SocketError<br>and in case of LSN gap, XlogGapError.<br>So for diagnostic if state is STOPPED just print last error from relay.<br><br>So changes to do:<br>1. Align relay state to match applier state (OFF, FOLLOW and STOPPED).<br>2. Do not destroy relay on error.<br>3. To simplify diagnostic, box.info.replication print last error if STOPPED.<br><br>Kostya, Georgy are you OK?<br><br><br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
        Суббота, 28 апреля 2018, 23:30 +03:00 от Konstantin Osipov <kostja@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_15249474480000000036_BODY">* Konstantin Belyavskiy <<a href="mailto:k.belyavskiy@tarantool.org">k.belyavskiy@tarantool.org</a>> [18/04/27 13:43]:<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'.<br>
> Add relay_state { NONE, CONNECTED, DISCONNECTED } to track replica<br>
> presence, once connected it either CONNECTED or DISCONNECTED until<br>
> master is reset.<br>
> <br>
> Closes #3365<br>
</div><br>
Hi,<br>
<br>
the patch is very good, almost ready to push, but I would like to<br>
request  more work.<br>
<br>
First, a very minor reason why I'm not pushing it right away is<br>
that I believe relay states should be matched with applier states.<br>
<br>
The matching applier states are OFF, FOLLOW and STOPPED. <br>
I think it would be easier for users if we don't invent new states<br>
on relay side. <br>
<br>
Second, we allocate relay object on stack; this seems to be a historical<br>
artifact, we have had struct relay before we got struct replica.<br>
Relay has a diagnostics area, so by keeping the relay around we<br>
will be able to display the last error in a way similar to<br>
applier. <br>
<br>
I'm not talking about pushing the message back from the applier to<br>
relay - this seems to be an unnecessary hassle and will complicate<br>
things quite a bit.<br>
<br>
<br>
-- <br>
Konstantin Osipov, Moscow, Russia, <span class="js-phone-number">+7 903 626 22 32</span><br>
<a href="http://tarantool.io" target="_blank">http://tarantool.io</a> - <a href="http://www.twitter.com/kostja_osipov" target="_blank">www.twitter.com/kostja_osipov</a><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>