-
Notifications
You must be signed in to change notification settings - Fork 924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARTEMIS-5119 Expired Messages on Cluster SNF should to to the original Expiry Queue #5327
base: main
Are you sure you want to change the base?
Conversation
47e931a
to
a3df301
Compare
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
Outdated
Show resolved
Hide resolved
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
Outdated
Show resolved
Hide resolved
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
Outdated
Show resolved
Hide resolved
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
Outdated
Show resolved
Hide resolved
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/activemq/artemis/tests/integration/cluster/expiry/ClusteredExpiryTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/activemq/artemis/tests/integration/cluster/expiry/ClusteredExpiryTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/activemq/artemis/tests/integration/cluster/expiry/ClusteredExpiryTest.java
Outdated
Show resolved
Hide resolved
...rc/test/java/org/apache/activemq/artemis/tests/integration/server/ExpireQueueSuffixTest.java
Show resolved
Hide resolved
e9adf6f
to
71cc83a
Compare
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
Outdated
Show resolved
Hide resolved
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
Outdated
Show resolved
Hide resolved
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
Outdated
Show resolved
Hide resolved
@@ -2129,14 +2130,26 @@ public void expire(final MessageReference ref) throws Exception { | |||
* hence no information about delivering statistics should be updated. */ | |||
@Override | |||
public void expire(final MessageReference ref, final ServerConsumer consumer, boolean delivering) throws Exception { | |||
if (addressSettings.getExpiryAddress() != null) { | |||
createExpiryResources(); | |||
AddressSettings settingsToUse = getMessageAddressSettings(ref.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expireFromScan method goes on to do "SimpleString expiryAddress = settingsToUse.getExpiryAddress();" and then use that variable in [most of] the places the value is used. Its strange for two very similar related methods right next to each other to be differing in that. Would be more readable later to either both use the variable, or neither use the variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will merge these two methods.. I was afraid of touching something unrelated.. but it's the best choice given how it's progressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I wasn't suggesting to combine them as they did seem sufficiently different on the backend to justify the two methods. Its just the initial bits were very similar so it would have been nice for them to be set out the same way for readability.
Combining them seems to have rearranged at least the order of some stuff for one method, or added some stuff around bindings that other method didnt do before...I'd need to take a much fuller look to see what I think of those changes, but I need to finish up just now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only difference I could see is the use of transactions or not. the use of consumers or not...
those could be set as null and they would have the same semantics... I think it should be good.
Testsuite is 100% passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gemmellr since you mentioned you are looking to review this.. I will leave this PR open until next week.. no rush about merging this yet.. although it would be nice before next release.. but it's not happening next week anyways... so I will leave it open for now.
...t/java/org/apache/activemq/artemis/tests/integration/cluster/expiry/ClusteredExpiryTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/activemq/artemis/tests/integration/cluster/expiry/ClusteredExpiryTest.java
Outdated
Show resolved
Hide resolved
dbd5345
to
b7a3b7f
Compare
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
Outdated
Show resolved
Hide resolved
@@ -2129,14 +2130,26 @@ public void expire(final MessageReference ref) throws Exception { | |||
* hence no information about delivering statistics should be updated. */ | |||
@Override | |||
public void expire(final MessageReference ref, final ServerConsumer consumer, boolean delivering) throws Exception { | |||
if (addressSettings.getExpiryAddress() != null) { | |||
createExpiryResources(); | |||
AddressSettings settingsToUse = getMessageAddressSettings(ref.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I wasn't suggesting to combine them as they did seem sufficiently different on the backend to justify the two methods. Its just the initial bits were very similar so it would have been nice for them to be set out the same way for readability.
Combining them seems to have rearranged at least the order of some stuff for one method, or added some stuff around bindings that other method didnt do before...I'd need to take a much fuller look to see what I think of those changes, but I need to finish up just now.
1ede4cf
to
21e436f
Compare
if (bindingList == null || bindingList.getBindings().isEmpty()) { | ||
ActiveMQServerLogger.LOGGER.errorExpiringReferencesNoBindings(expiryAddress); | ||
acknowledge(tx, ref, AckReason.EXPIRED, null, delivering); | ||
} else { | ||
move(tx, expiryAddress, null, ref, false, AckReason.EXPIRED, consumer, null, delivering); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until the most recent commit updates, before you combined the existing 'expire' method with your then-added new 'expireFromScan' method, the existing 'expire' did not do this check and would simply try the move. (Or if there was no expireAddress defined at all, it would log once that there wasnt any.) This seems like it changes things by introducing a potential per-message warning log message about the bindings. Was that desired, given you didn't add it originally when the methods were seperate?
// potentially auto-delete this queue if this expired the last message | ||
refCountForConsumers.check(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing 'expire' method with consumer always did this, before checking the broker plugins. It still did this when you had added the 'expireWithScan' method. Now that you combined the methods, this is only done if there is a tx, and only after checking the broker plugins (and only if there is a message plugin, even though this is a queue-level check). These both seem strange differences from just consolidating some methods. Was one of them wrong before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You updated the behaviour a bit, bit it still differs from before in the sense that for the combined expire method it only runs the refCountForConsumers.check(); if there is a broker message plugin, rather than always doing it before for this old expire method (the other old expire method only did it if there is a plugin). Was it wrong to always check it in this method before, i.e was the other method correct not to do it without a plugin? Essentially, why should it need a broker message plugin to do it?
21e436f
to
85c9f81
Compare
5a9600d
to
2a35892
Compare
@gemmellr I added a commit to be squashed with a change... |
Left a new comment in one of the previous comment 'threads' #5327 (comment) |
2a35892
to
d073f53
Compare
No description provided.