[
https://issues.jboss.org/browse/JGRP-1767?page=com.atlassian.jira.plugin....
]
Bela Ban commented on JGRP-1767:
--------------------------------
In a nutshell, for OOB messages, we only use Table as a means to keep track of which
seqnos have been delivered, to prevent duplicate delivery. We're not interested in the
messages themselves, as they've been delivered by the processing thread from the OOB
thread pool.
UNICAST3: processing of OOB messages and message batches
--------------------------------------------------------
Key: JGRP-1767
URL:
https://issues.jboss.org/browse/JGRP-1767
Project: JGroups
Issue Type: Enhancement
Reporter: Bela Ban
Assignee: Bela Ban
Fix For: 3.5
Currently, when OOB message batches are received, the following happens:
* All messages from the batch are added to the table
* We iterate through the batch and remove those message whose {{OOB_DELIVERED}} flag
cannot be set (already processed and delivered by a different thread).
* The batch is passed up
* Then we try to remove as many messages from the table as possible and pass them up (as
a batch again)
** Messages whose {{OOB_DELIVERED}} flag is set, are discarded
This is a lot of work and we're accessing the table more than needed for OOB batches.
A few things can be changed to make this more efficient:
* The thread which processes a message ot message batch will deliver the message to the
application if the message or batch hasn't been delivered yet
** Batch
*** we only add those messages from list L to table T if they haven't yet been added
*** Messages from L which couldn't be added to T are removed from L
*** All messages from L are added to a new batch and that batch is then passed up
(delivered)
** Single message
*** If the message was added successfuly, we deliver it, else we drop it
* When removing messages from the table ({{Table.removeMany()}}), we skip OOB messages.
This is done with a new Table.add() method (including a filter)
* Further optimization: when adding an OOB message to T, we add a reference to a static
OOB message, so *all OOB messages in a table point to the same instance !* Since we skip
OOB messages when removing messages, this doesn't matter. However, this reduces the
memory needed by Table if there are many OOB messages
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira