[ejabberd] pubsub_item.DAT getting big

Christophe Romain cromain at process-one.net
Tue Sep 30 16:12:06 MSD 2008


Hi

i can not reproduce your case. I'm using ejabberd-2.0.2.
here is what i sent as test at localhost:

<iq type='set'
     to='pubsub.localhost'
     id='create1'>
     <pubsub xmlns='http://jabber.org/protocol/pubsub'>
       <create node='home/localhost/test'/>
       <configure>
       <x xmlns='jabber:x:data' type='submit'>
         <field var='FORM_TYPE' type='hidden'>
           <value>http://jabber.org/protocol/pubsub#node_config</value>
         </field>
         <field var='pubsub#max_items'><value>2</value></field>
       </x>
       </configure>
     </pubsub>
</iq>

<iq type='set'
     to='pubsub.localhost'
     id='publish1'>
   <pubsub xmlns='http://jabber.org/protocol/pubsub'>
     <publish node='home/localhost/test'>
       <item id='1'>
	<text>Message1</text>
       </item>
     </publish>
   </pubsub>
</iq>

<iq type='set'
     to='pubsub.localhost'
     id='publish2'>
   <pubsub xmlns='http://jabber.org/protocol/pubsub'>
     <publish node='home/localhost/test'>
       <item id='2'>
	<text>Message2</text>
       </item>
     </publish>
   </pubsub>
</iq>

<iq type='set'
     to='pubsub.localhost'
     id='publish3'>
   <pubsub xmlns='http://jabber.org/protocol/pubsub'>
     <publish node='home/localhost/test'>
       <item id='3'>
	<text>Message3</text>
       </item>
     </publish>
   </pubsub>
</iq>

then i subscribe to the node and fetch all items

<iq type='set'
     to='pubsub.localhost'
     id='sub1'>
   <pubsub xmlns='http://jabber.org/protocol/pubsub'>
     <subscribe
         node='/home/localhost/test'
         jid='test at localhost'/>
   </pubsub>
</iq>

<iq type="get" to='pubsub.localhost'>
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <items node="/home/localhost/test" />
  </pubsub>
</iq>

here is what i get:

<iq from="pubsub.localhost" type="result" to="test at localhost/macbook" >
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<items node="/home/localhost/test" >
<item id="2" >
	<text>Message2</text>
       </item>
<item id="3" >
	<text>Message3</text>
       </item>
</items>
</pubsub>
</iq>

the item '1' has been removed, i have only 2 items in the database.
we see the same thing from the database:
(ejabberd at localhost)1> mnesia:dirty_all_keys(pubsub_item).
[{"2",{"pubsub.localhost",["home","localhost","test"]}},
  {"3",{"pubsub.localhost",["home","localhost","test"]}}]

so i guess you are doing something wrong.

regards.



More information about the ejabberd mailing list