[ejabberd] Redis Connection errors during testing

Steven Livingstone steven at livz.org
Fri Feb 19 02:45:52 MSK 2016


Hi.

I have ejabberd using Redis for C2S backed by HA Proxy and a master/slave
config of Redis nodes. All works well.

However, I am now testing failover and that almost works perfectly except
when sending test messages between two clients and bring down my Redis
Master, some of the messages are lost during the time the Redis master is
down and the new Redis slave is promoted. Then it all starts working again
but the lost message never come through.

However, I can see them in the log (see below) along with the "no
connection" error that i suspect happens during the promotion (this is my
first time getting this working). The first set of messages in the log see
the successful send of the letter "i" [yes, my life is really that
exciting] and the second shows the failure to send "j" (as well as k,l,m
and o) before it starts working again for "p" and so on.

Is there some setting I can use to avoid losing these messages? I'd expect
either a time window, number of tries or something and that indeed may be
the intention of some of the parameters in
https://docs.ejabberd.im/admin/guide/configuration/#redis ... but i don't
want to go hacking them quite yet until i fully understand what is going on.

Many Thanks,
/steven


===================

23:30:34.277 [debug] Received XML on stream = <<"<message type='chat'
id='purple55391543'
to='test at alchemy.local/15244248501564432370104988424493447723256800312291573867645'><active
xmlns='http://jabber.org/protocol/chatstates'/><body>i</body></message>">>
23:30:34.278 [debug] route
from
{jid,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>}
to
{jid,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>}
packet
{xmlel,<<"message">>,[{<<"type">>,<<"chat">>},{<<"id">>,<<"purple55391543">>},{<<"to">>,<<"test at alchemy.local
/15244248501564432370104988424493447723256800312291573867645">>}],[{xmlel,<<"active">>,[{<<"xmlns">>,<<"
http://jabber.org/protocol/chatstates
">>}],[]},{xmlel,<<"body">>,[],[{xmlcdata,<<"i">>}]}]}
23:30:34.278 [debug] local route
from
{jid,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>}
to
{jid,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>}
packet
{xmlel,<<"message">>,[{<<"type">>,<<"chat">>},{<<"id">>,<<...>>},{<<...>>,...}],[{xmlel,<<...>>,...},{xmlel,...}]}
23:30:34.278 [debug] session manager
from
{jid,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>}
to
{jid,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>}
packet
{xmlel,<<"message">>,[{<<"type">>,<<"chat">>},{<<"id">>,<<...>>},{<<...>>,...}],[{xmlel,<<...>>,...},{xmlel,...}]}
23:30:34.279 [debug] sending to process <0.904.0>
23:30:34.280 [debug] Send XML on stream = <<"<message
from='admin at alchemy.local/alchemy'
to='test at alchemy.local/15244248501564432370104988424493447723256800312291573867645'
type='chat' id='purple55391543'><active xmlns='
http://jabber.org/protocol/chatstates'/><body>i</body></message>">>
23:30:35.355 [debug] Received XML on stream = <<"<message type='chat'
id='purple55391544'
to='test at alchemy.local/15244248501564432370104988424493447723256800312291573867645'><active
xmlns='http://jabber.org/protocol/chatstates'/><body>j</body></message>">>
23:30:35.356 [error] failed to get sessions from redis:
{error,no_connection}
23:30:35.356 [debug] route
from
{jid,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>}
to
{jid,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>}
packet
{xmlel,<<"message">>,[{<<"type">>,<<"chat">>},{<<"id">>,<<"purple55391544">>},{<<"to">>,<<"test at alchemy.local
/15244248501564432370104988424493447723256800312291573867645">>}],[{xmlel,<<"active">>,[{<<"xmlns">>,<<"
http://jabber.org/protocol/chatstates
">>}],[]},{xmlel,<<"body">>,[],[{xmlcdata,<<"j">>}]}]}
23:30:35.356 [debug] local route
from
{jid,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>}
to
{jid,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>}
packet
{xmlel,<<"message">>,[{<<"type">>,<<"chat">>},{<<"id">>,<<...>>},{<<...>>,...}],[{xmlel,<<...>>,...},{xmlel,...}]}
23:30:35.356 [debug] session manager
from
{jid,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>,<<"admin">>,<<"alchemy.local">>,<<"alchemy">>}
to
{jid,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>,<<"test">>,<<"alchemy.local">>,<<"15244248501564432370104988424493447723256800312291573867645">>}
packet
{xmlel,<<"message">>,[{<<"type">>,<<"chat">>},{<<"id">>,<<...>>},{<<...>>,...}],[{xmlel,<<...>>,...},{xmlel,...}]}
23:30:35.357 [error] failed to get sessions from redis:
{error,no_connection}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20160218/2ce14917/attachment.html>


More information about the ejabberd mailing list