-
Notifications
You must be signed in to change notification settings - Fork 912
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-4570 filter not applied to all brokers in cluster #4744
Conversation
9fafc54
to
8c41fe6
Compare
@@ -4322,7 +4322,9 @@ public QueueConfiguration getQueueConfiguration() { | |||
.setTemporary(temporary) | |||
.setInternal(internalQueue) | |||
.setTransient(refCountForConsumers instanceof TransientQueueManagerImpl) | |||
.setAutoCreated(autoCreated); | |||
.setAutoCreated(autoCreated) |
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.
this change does not seem related, what is going on here?
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.
This is related to the test, where I get the QueueConfiguration from the queue and use it as the base, change the filter and call PostOffice to updateQueue with it. If I don't add them the test throws exception, like so:
`java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "org.apache.activemq.artemis.api.core.QueueConfiguration.isGroupRebalancePauseDispatch()" is null
at org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl.updateQueue(PostOfficeImpl.java:776)
at org.apache.activemq.artemis.tests.integration.cluster.distribution.MessageLoadBalancingTest.testMessageLoadBalancingWithFiltersUpdate(MessageLoadBalancingTest.java:128)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
`
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.
hmm. I don't know whether the update needs to be smarter or every QueueConfiguration must be fully defined. I think the update needs to be smarter b/c there is a semantic meaning to null afaik.
I see another partial QueueConfiguration at
Line 695 in 8c41fe6
return updateQueue(new QueueConfiguration(name) |
there are a few in PostOfficeImpl. This suggests that the update logic needs to check for the null. I think.
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.
Both things are true. The update needs to be smarter to not throw an NPE, but getQueueConfiguration
should also be setting all the relevant properties on the QueueConfiguration
it returns. In short, I think this is fine and we can follow-up with another PR to deal with the update.
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 agree, the update needs to be smarter and also the returned queue config should be complete. I'll do update PR quickly. Thanks guys!
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.
On second thought it would be better to do it in a separate commit/PR as @jbertram said. :)
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 could do it similarly to how I did AddessSettings and that Metadata thingy, on a separate PR.
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.
@clebertsuconic Hi Clebert can you point me to where you did it? Thanks.
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.
a cluster is expected to be symmetrical, but if for some reason it is not, then there will be an error logged on an unrecognised notification type, which is fine.
yeah that's true. |
8c41fe6
to
83014ca
Compare
@clebertsuconic had an interesting observation that changing a filter was previously not allowed, a queue needed to be deleted and recreated with a new filter and those events would be propagated across a cluster. I wonder if there is any potential for having stuck messages with dynamic filters, when the filter becomes more restrictive that would result on unmatched messages that are already on the queue? I guess we could recommend a purge before mod if that is a problem. The bigger question is if a filter should be something that is dynamic? |
I think for topic subscriptions (jms) if you changed the filter the effect is the sub-queue will be recreated (unsubscribed). |
83014ca
to
f73d9d6
Compare
Queues are not supposed to be changed... that's something recently added. I don't think your user (I know your user) is actually hitting an update queue.. Did you confirm that? |
f73d9d6
to
5bc87a3
Compare
it can happen from config reload, it seems a valid use case. |
yep we should either 1) forbid filter update on both local binding and remote binding, or 1) allow both. |
No description provided.