1

I know db-xx.log is the journal file and db.redo is the reference file?

db-xx.log stores messages which are not consumed, yet. Those messages will be deleted from db-xx.log after being consumed. db.redo stores references of messages (which are stored in db-xx.log) by message id.

  1. But, what are db.data and db.free?
  2. What are their functions?

My understanding is that broker stores messages in cache (which is volatile memory) first, and then those messages are moved (appended) to db-xx.log when checkpoint or cache size is full.

  1. Is that correct?

Thanks

dvdgsng
  • 1,691
  • 16
  • 27
Lwin Htoo Ko
  • 2,326
  • 4
  • 26
  • 38

2 Answers2

5

db.data holds btree pages which reference the un-consumed messages. The db.redo is a redo log of the updates that are about to be performed against the db.data. The db.free keeps track of the free pages in the db.data.

Hiram Chirino
  • 4,103
  • 1
  • 22
  • 21
  • When I started activemq, I did not see db.free. It was only found when I stopped activemq. I produced millions of messages that made many data-xx.log files and big db.data file. When I consumed all messages, all data-xx.log were deleted except last one but why did db.data remain unchanged (still big file). Is there anything wrong? – Lwin Htoo Ko Oct 11 '12 at 04:03
  • I am trying to find the source of this problem http://stackoverflow.com/questions/12725505/slow-kahadb-access – Lwin Htoo Ko Oct 11 '12 at 04:06
2

db.redo is the recovery file for the indexes (db.data). db.free is read and loaded into memory during the start of activemq. The file is deleted once the free list is loaded into memory. Once the message database is unloaded, the free list is written back to db.free.

Once a message is removed, the behavior is different for queue/topic.

  • In case of queue, it will be removed from the index file. B-tree structure will be modified accordingly.
  • In case of topic, only when the message is acknowledged by all the subs, it will be removed.
Satish
  • 421
  • 5
  • 5