[
https://issues.apache.org/jira/browse/AMQ-7070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16650496#comment-16650496
]
Alan Protasio commented on AMQ-7070:
------------------------------------
Hi [~gtully]
I ran the test with this change:
https://github.com/alanprot/activemq/commit/3dc691335f6ae749c2d40602d6b33cb02f7eb0b3
Seems the only test that failed were:
{quote}{{StoreQueueCursorOrderTest.testNoSetBatchWithUnOrderedFutureCurrentSync:204
expected:<0> but was:<1>}}
{{ StoreQueueCursorOrderTest.tesBlockedFuture:136 expected:<0> but was:<1>}}
{{ StoreQueueCursorOrderTest.testSetBatchWithFuture:362 setBatch set
expected:<2> but was:<0>}}
{{ StoreQueueCursorOrderTest.testSetBatchWithOrderedFutureCurrentFuture:269
setBatch set expected:<1> but was:<0>}}
{{ StoreQueueCursorOrderTest.testSetBatch:435 setBatch set expected:<2> but
was:<0>}}
{{ TopicProducerDurableSubFlowControlTest.testTopicProducerFlowControl:184 Has
a decent usage}}
{quote}
The first ones (StoreQueueCursorOrderTest) failed because the Storage and the
cache has different orders. As I'm purging the cache.. the order of messages
dispatched changed (now they are being dispatched in the same order as they
were store - with I think is the right behaviour as the store should be the
source of truth).
The TopicProducerDurableSubFlowControlTest failed because one of the asserts
was to check if the cursor was using more then 5% of memory but as I purged
the cache, this was not the case.
But, to be honest here.. i donno if this change worth... as this change is not
solving 100% of the cases. Even if i purge the cache when disabling the cache,
i can still receive messages with wrong priority in the case where i'm sending
messages with higher priority and the cursor was filled with messages with
lower priority from the disk. At least in this case the cursor is filled in
batch of 200 messages instead of the case when we are disabling the cache and
this cursor can be filled with GBs of messages.
Thanks
> Priority is not being respected when the cursor cache flips
> -----------------------------------------------------------
>
> Key: AMQ-7070
> URL: https://issues.apache.org/jira/browse/AMQ-7070
> Project: ActiveMQ
> Issue Type: Test
> Components: Broker
> Reporter: Alan Protasio
> Priority: Minor
> Attachments: AMQ7070Test.java
>
>
> Messages are being dispatched with wrong priority when the cache is flipped.
> See:
> https://github.com/apache/activemq/blob/master/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java#L258
> All messages that could get cached in the cursor are dispatched before even
> though massages with higher priority is in the cache.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)