[ejabberd] Clustered ejabberd pubsub error.

Max Kalika max.kalika at gmail.com
Thu May 20 04:07:27 MSD 2010


Hi all.

I'm getting an error creating a pubsub node from a custom module, and
hoping someone here can help.  Everything works just fine when
ejabberd is not clustered.  I recently moved to a clustered setup, and
started getting errors.  Here's a bit of info.

pertinent mnesia configuration:

(ejabberd at jabber02)1> mnesia:info().
===> System info in version "4.4.13", debug level = none <===
opt_disc. Directory "/var/lib/ejabberd/db" is used.
use fallback at restart = false
running db nodes   = ['ejabberd at jabber01','ejabberd at jabber02']
stopped db nodes   = []
master node tables = []
remote             = []
ram_copies         = [anonymous,captcha,http_bind,iq_response,mod_register_ip,
                      pubsub_subscription,reg_users_counter,route,s2s,session,
                      session_counter]
disc_copies        = [acl,caps_features,config,local_config,motd,motd_users,
                      passwd,privacy,private_storage,pubsub_index,pubsub_item,
                      pubsub_node,pubsub_state,roster,roster_version,schema,
                      vcard,vcard_search]
disc_only_copies   = []
[{'ejabberd at jabber01',disc_copies},{'ejabberd at jabber02',disc_copies}] = [schema,

          roster,

          motd_users,

          motd,

          passwd,

          config,

          vcard_search,

          privacy,

          acl,

          roster_version,

          pubsub_index,

          pubsub_state,

          pubsub_node,

          pubsub_item,

          private_storage,

          vcard]
[{'ejabberd at jabber01',ram_copies},{'ejabberd at jabber02',ram_copies}] = [captcha,

        session_counter,

        reg_users_counter,

        anonymous,

        s2s,

        http_bind,

        iq_response,

        route,

        session,

        pubsub_subscription]
[{'ejabberd at jabber02',disc_copies}] = [caps_features,local_config]
[{'ejabberd at jabber02',ram_copies}] = [mod_register_ip]


>From the module, I construct and send a pubsub create request

send_pubsub() ->
   To = "pubsub." ++ ?MYNAME,
   From = #jid{user = "master", luser = "master", server = ?MYNAME,
lserver = ?MYNAME, resource = "pubsub", lresource = "pubsub"},
   Message = {xmlelement, "iq",
              [{"type", "set"},
               {"from", jlib:jid_to_string(From)},
               {"to", To}],
              [{xmlelement, "pubsub",
                [{"xmlns", "http://jabber.org/protocol/pubsub"}],
                [{xmlelement, "create", [{"node", "Test"}], []},
                 {xmlelement, "configure", [], []}]}]},

   ejabberd_router:route(From, jlib:string_to_jid(To), Message).


And in the ejabberd log I see:

=ERROR REPORT==== 2010-05-19 17:01:02 ===
E(<0.312.0>:mod_pubsub:3686) : transaction return internal error: {atomic,
                                                                   {'EXIT',
                                                                    {aborted,
                                                                     {cyclic,

'ejabberd at jabber01',

{pubsub_index,
                                                                       node},
                                                                      write,
                                                                      write,
                                                                      {tid,
                                                                       1146520,

<10205.297.0>}}}}}


=ERROR REPORT==== 2010-05-19 17:01:02 ===
E(<0.312.0>:mod_pubsub:3686) : transaction return internal error: {atomic,
                                                                   {'EXIT',
                                                                    {aborted,
                                                                     {cyclic,

'ejabberd at jabber02',

{pubsub_index,
                                                                       node},
                                                                      read,
                                                                      read,
                                                                      {tid,
                                                                       1146520,

<10205.297.0>}}}}}


It's suspicious that there are two messages within the same second for
both nodes.  Seems like an mnesia deadlock?  Is it because I have RAM
and Disc copy set for the pubsub tables on both nodes or something
else entirely?  Any help would be greatly appreciated.  Thanks.


More information about the ejabberd mailing list