You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2012/09/28 18:28:54 UTC
svn commit: r1391519 -
/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueEntry.scala
Author: chirino
Date: Fri Sep 28 16:28:54 2012
New Revision: 1391519
URL: http://svn.apache.org/viewvc?rev=1391519&view=rev
Log:
Fixes APLO-176 : "Detected store change in range" warning message are occasionally displayed once a queue grows large.
Seems we were growing the range after we had initiated a range load, when the range load completed, the number of messages loaded would not match up to what the new range size was. The fix is to not grow the range while it is being loaded.
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueEntry.scala
Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueEntry.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueEntry.scala?rev=1391519&r1=1391518&r2=1391519&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueEntry.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueEntry.scala Fri Sep 28 16:28:54 2012
@@ -223,10 +223,20 @@ class QueueEntry(val queue:Queue, val se
def swapped_range = state.swap_range
def can_combine_with_prev = {
- getPrevious !=null &&
- getPrevious.is_swapped_range &&
+ var prev = getPrevious
+ if ( prev == null ) {
+ false
+ } else {
+ val prev_range = prev.as_swapped_range
+ if ( prev_range == null ) {
+ false
+ } else {
+ (!prev_range.loading) &&
+ (!is_loading) &&
( (is_swapped && !is_acquired) || is_swapped_range ) &&
- (getPrevious.count + count < queue.tune_swap_range_size) && !is_loading
+ (prev.count + count < queue.tune_swap_range_size)
+ }
+ }
}
trait EntryState {