Project

General

Profile

Packet duplication in cluster environment

HaXkil The
Added almost 5 years ago

Hi.

We are using latest Tigase version available in your Maven repo.

Our basic setup consists of two Tigase+ACS nodes.

[node_1] -- [node_2]
   |            |
(user_1)    (user_2)

When user_1 sends message to user_2, user_2 obtains two messages and vice versa.

From our perspective this happens because packet from user_1 is processed on both nodes: on node_1 and node_2, i.g. on senders and recipients nodes.

Also packets are duplicated on cluster, which consists of three or more nodes.

Could you, please give a suggestion how to deal with this situation? The intention is to process packet on single node, no matter node_1 or node_2.

Some of the properties used in configuration are:

--cl-conn-repo-class=tigase.cluster.repo.ClConConfigRepository
--sm-cluster-strategy-class=tigase.cluster.strategy.OnlineUsersCachingStrategy
--cluster-mode=true
--cluster-nodes=node_1:node_1_passwd:5277,node_2:node_2_passwd:5277
message-router/components/msg-receivers/s2s.active[B]=false

--sm-plugins=
+xxx:custom:message-plugin,\
+xxx:custom:presence-plugin,\
-amp,\
-message-carbons,\
-domain-filter,\
-http://jabber.org/protocol/stats,\
-jabber:iq:auth,\
-jabber:iq:private,\
-jabber:iq:privacy,\
-message,\
-msgoffline,\
-presence,\
-vcard-temp,\
-zlib

This properties are same for both nodes.


Replies (15)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 5 years ago

Does this message duplication happens when you use our standard message plugins (AMP for example) instead of your custom?

Also, what kind of client software do you use for your tests?

Added by HaXkil The almost 5 years ago

Unfortunately message duplication happens even when all our plugins are disabled and only one standard plugin ( AMP ) is used to process messages.

We are using Smack API jabber client for tests.

Added by Wojciech Kapcia TigaseTeam almost 5 years ago

Could you please share example console output from both clients as well as log excerpts from the test time (with --debug=server,cluster,xmpp setting)?

Added by HaXkil The almost 5 years ago

Hi. I've attached logs archive. In those logs is displayed same scenario and setup, described in the initial question.

There are two clients (user_1 and user_2), which are running from the same machine (ip: client-ip). Tigase cluster has two nodes (node_1 and node_2).

Whole scenario is:

  • node_1 started

  • node_2 started

  • user_1 connected to node_1

  • user_2 connected to node_2

  • user_1 sends message to user_2 through node_1 in format:

<message xml:lang="en" id="ro4kY-8" to="user_2@xxx-domain" from="user_1@xxx-domain">
    <body>message_from_user_1_to_user_2</body>
    <location room="chat-client-room" xmlns="xxx:location">xxxlocation</location>
    <product xmlns="xxx:product">xxxproduct</product>
</message> 
  • then user_2 sends message to user_1 through node_2 in format:
<message xml:lang="en" id="ro4kY-9" to="user_1@xxx-domain" from="user_2@xxx-domain/node_2">
    <body>message_from_user_2_to_user_1</body>
    <location room="chat-client-room" xmlns="xxx:location">xxxlocation</location>
    <product xmlns="xxx:product">xxxproduct</product>
</message>
  • user_2 disconnected

  • user_1 disconnected

  • node_2 stopped

  • node_1 stopped

In first message stanza user's JID contains no resource part, in second message stanza it does; but despite of that each of the recipients receives duplicated messages.

Couple of times I noticed, that sometimes messages either from user_2, either from user_1 are not duplicated; May be, this is somehow depended of the nodes starting sequence.

Added by Wojciech Kapcia TigaseTeam almost 5 years ago

Similar issue was reported a while back (v. Tigase Presence Issue thread) and the duplication is caused by including from attribute. In the meantime, while we are working on fixing it, could you try to reproduce the issue by with sending stanza that does not include from attribute?

Added by HaXkil The almost 5 years ago

Hi Wojciech. You are right, this issue is not reproduced in case 'from' attribute is omitted.

Added by HaXkil The over 4 years ago

Hi guys. Is there any update on this thing?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

No update for this yet but we have it on our TODO list.

Added by ag joyo over 4 years ago

Hi guys,the lastest version 5.2.1 has same question,my test client is spark,i hope you can solve this problem.

Added by ag joyo over 4 years ago

Hi guys,the lastest version 5.2.1 has same question,my test client is spark and my configuration is:

suse

jdk 1.7.0_25

init.properties:

config-type=--gen-config-def

--admins=admin@cc.com

--virt-hosts=cc.com

--debug=server,cluster,xmpp.impl,db

--monitoring=jmx:9050,http:9080,snmp:9060

--user-db=mysql

--user-db-uri=jdbc:mysql://ip:3306/tigasedb?user=abc&password=123&useUnicode=true&characterEncoding=UTF-8

--cluster-mode=true

my init.properties is ok?

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Your init.properties is ok - the issue stems from internal processing of stanzas.

Added by ag joyo over 4 years ago

Wojciech Kapcia wrote:

Your init.properties is ok - the issue stems from internal processing of stanzas.

Could you tell me how should i do to fix this issue,or give me some suggestions,the version which i am using is tigase.5.2.1,thank you.

Added by Wojciech Kapcia TigaseTeam over 4 years ago

It was resolved recently - v. #2019

Added by Anant Goswami over 3 years ago

hey guys whats the solution for this ?

recently i downloaded tigase from repository >> git clone git://repository.tigase.org/git/tigase-server.git

I am facing same problem. I can read that problem is solved, but I m still facing that problem.

Did you update that repository with updated code ?

Can one tell me what is solution for this problem?

I have tried it with spark to spark and spark to pidgin.

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Anant Goswami wrote:

recently i downloaded tigase from repository >> git clone git://repository.tigase.org/git/tigase-server.git

I am facing same problem. I can read that problem is solved, but I m still facing that problem.

Did you update that repository with updated code ?

Yes, tigase-server master branch contains the latest code with all the fixes.

Can one tell me what is solution for this problem?

I have tried it with spark to spark and spark to pidgin.

Please share both stanza exchange from clients as well as complete server configuration and logs, i.e. shut down server, configure debugging with @--debug=server,cluster,xmpp.impl@, remove all logs from logs/ directory and share:

  • etc/init.properties

  • all files from logs/ directory (compressed!)

    (1-15/15)