Commit Graph

789 Commits

Author SHA1 Message Date
Timothy Bish e9c06bd9f8 ARTEMIS-5157 Add management for AMQP broker connections
Add basic management views for AMQP broker connections and implement control
types for AMQP federation features along with the broker connection management
views. Some initial work also to provide support for other broker connection
features to add management control and also plan for future views of incoming
broker connections and management of AMQP federation resources.
2024-11-20 12:16:44 +00:00
Timothy Bish d4fff2fd58 ARTEMIS-5155 Race on AMQP large message read and close
When the final frame of a large message is being written to the file in
the session thread and an IO error occurs such that that connection is
torn down, the large message reader can be closed before the message is
fully processed resulting in corruption. The large message file close
logic needs to occur on the session thread so that the processing of the
bytes can finish and the message gets added to the Queue and the close
can react by not deleting the file when it runs following the read task.
2024-11-19 10:37:48 -05:00
Timothy Bish 7555319dd0 ARTEMIS-5153 Mark federation events and control queues as internal
In order to better indicate their nature as broker feature specific queues
we can mark the temporary queues created for AMQP federation events and
control link messages as internal.
2024-11-14 11:14:19 +00:00
Robbie Gemmell 8a912ed209 ARTEMIS-5110: retire/exclude previously-used IDs removed/reassigned in the following older commits:
177e6820b5
e34fd09ce3
e065d25b6f
af9bd7b84a
f4bdacbc4c
74951d9221
fe0ca4d84f
b08b91a32f
85857ab8eb
e02ec69021
bf9f6d213b
2d806807b8
52a4157bbb
53bb3ea183
d5f152c725
b3529dcea4
246bf08391
8a04ee07de
6cb68f2ce9
9873fccf74

See PR for individual commits which were squashed to form this change. This closes #5320
2024-11-01 11:23:13 +00:00
Timothy Bish a3aea7d9a0 ARTEMIS-5135 Use a sequence ID on address federation link names
Prevents unintended link stealing scenarios when link names match for a new
link whose name is in use by another link still awaiting a detach response.
2024-10-29 10:32:14 +00:00
Justin Bertram d01ea80df9 ARTEMIS-5110 add ability to identify retired IDs in log annotations
The broker uses unique IDs for logging statements. As logging changes
over time we need a way to "retire" these IDs (e.g. when certain
logging statements are no longer needed) to ensure they are not used

This commit does the following:

 - Removes all the logging methods which are no longer used and
   "retires" the corresponding ID (i.e. adds them to the `retiredIDs`
   list for that LogBundle).
 - Updates the validation for IDs that have been retired or are in
   active use including a new suggestion about a valid ID to use when an
   invalid ID is found.
 - Fixes all the regular expressions in all the various uses of
   `@LogBundle` to ensure there are no overlaps to prevent duplicates
   between bundles.

Changes from myself and Robbie Gemmell (see PR). This closes #5303.
2024-10-25 15:14:07 +01:00
Timothy Bish c78d87de9b ARTEMIS-5106 Mark any AMQP TXN as rollback on send exceptions
If an exception is thrown in the AMQP send path and there is an
active transaction we should mark that as rollback only so the
client will see an error when it tries to commit a transaction
that had a failed send.
2024-10-18 17:36:34 +01:00
Justin Bertram 9380235a5e [maven-release-plugin] prepare for next development iteration 2024-10-16 10:10:37 -05:00
Justin Bertram 241e76f9da [maven-release-plugin] prepare release 2.38.0 2024-10-16 10:08:10 -05:00
Clebert Suconic 6186805b69 ARTEMIS-5090 MirrorSNF is not supposed to expiry on messages 2024-10-09 17:30:26 +01:00
Timothy Bish 65db6c60c9 ARTEMIS-5074 Fix encoding of bytes properties as Binary in AMQPMessage
When a bytes property is added to an AMQPMessage and it is then reencoded it
will fail without first wrapping the byte array in an AMQP binary as required
by the ApplicationProperties section specification defined type allowances.
2024-09-27 19:30:23 +01:00
Clebert Suconic 5808985a6a ARTEMIS-5067 Fix ClusteredMirrorSoakTest::testAutoCreateQueue 2024-09-26 10:15:18 -04:00
Clebert Suconic 0c4c0542be ARTEMIS-5068 Temporary queue should not be mirrored 2024-09-25 21:58:13 -04:00
Clebert Suconic 9199b1f2dc ARTEMIS-5067 Preventing Race when one side is not connected in the mirror
There was already some verification at AMQPMirrorControllerSource::invalidTarget
however the verification failed on soak test ReplicatedBothNodesMirrorTest,
and an user I was working with also gave me evidence of this happening.

I'm improving the previous verification, which is actually a simplification that works on every case.
2024-09-25 21:57:45 -04:00
Clebert Suconic 30c5e63e0b ARTEMIS-5066 Disable Divert on Mirror Target 2024-09-25 21:57:45 -04:00
Clebert Suconic 1d1f03ad5e ARTEMIS-4971 Warning on Unacked messages through mirror AckManager 2024-09-25 09:52:37 -04:00
Clebert Suconic f92a846c21 ARTEMIS-5038 Mirrored ACKs are broken if using multiple priorities on producers
PriorityLinkedList has multiple sub-lists, before this commit PriorityLinkedList::setNodeStore would set the same node store between all the lists.
When a removeWithID was called for an item on list[0] the remove from list[4] would always succeed first. This operation would work correctly most of the time except
when tail and head is being used. Many NullPointerExceptions would be seen while iterating on the list for remove operations, and the navigation would be completely broken.

A test was added to PriorityLinkedListTest to make sure the correct lists were used however I was not able to reproduce the NPE condition in that test.
AccumulatedInPageSoakTest reproduced the exact condition for the NPE when significant load is used.
2024-09-23 11:48:24 -04:00
Timothy Bish 5b3b995d61 ARTEMIS-4978 Fix AMQP messages not matching selector on replay
When using the replay functionality the application of filters to
the replayed messages fails to match against AMQP messages due to the
message not getting scanned when some message values are accessed.
2024-09-09 14:34:14 +01:00
Timothy Bish ec8026e4d6 ARTEMIS-5032 Ensure AMQP message priority is honored after restart
Ensure that on server restart the original priority value assigned to an
AMQP message is used when dispatching durable messages from the store.
The AMQP Header section is scanned if present and the priority value
is recovered in an efficient manner.
2024-09-05 13:56:28 -04:00
Clebert Suconic 7fb9aa5f97 ARTEMIS-5010 Addressing deadlock on AckManager
AckManager.flush would hold a lock on ackManager, There was a possible deadlock with MirrorTarget:

Thread 1:

        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager.addRetry(AckManager.java:393)
        - waiting to lock <0x00000007990a13e8> (a org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager.ack(AckManager.java:418)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerTarget.performAck(AMQPMirrorControllerTarget.java:479)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerTarget.postAcknowledge(AMQPMirrorControllerTarget.java:461)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerTarget.actualDelivery(AMQPMirrorControllerTarget.java:318)
        at org.apache.activemq.artemis.protocol.amqp.proton.ProtonAbstractReceiver.onMessageComplete(ProtonAbstractReceiver.java:361)

Thread 2:

        at jdk.internal.misc.Unsafe.park(java.base@11.0.8/Native Method)
        - parking to wait for  <0x000000079de0af38> (a java.util.concurrent.CountDownLatch$Sync)
        at java.util.concurrent.locks.LockSupport.parkNanos(java.base@11.0.8/LockSupport.java:234)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(java.base@11.0.8/AbstractQueuedSynchronizer.java:1079)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(java.base@11.0.8/AbstractQueuedSynchronizer.java:1369)
        at java.util.concurrent.CountDownLatch.await(java.base@11.0.8/CountDownLatch.java:278)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerTarget.flush(AMQPMirrorControllerTarget.java:230)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager$$Lambda$601/0x00000008005c3040.accept(Unknown Source)
        at java.lang.Iterable.forEach(java.base@11.0.8/Iterable.java:75)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager.flushMirrorTargets(AckManager.java:184)
        - locked <0x00000007990a13e8> (a org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager.initRetry(AckManager.java:162)
2024-09-04 16:19:52 -04:00
Clebert Suconic ffafbf350a ARTEMIS-5001 Relax consistency requirement on OperationContext for Mirror send operations.
Send operations should ignore replication, while the ack of the message should wait a round trip in replication.
That will allow us to ack the message faster and still have consistency with its replica.
2024-08-29 14:42:48 -04:00
Clebert Suconic 898c09cb93 ARTEMIS-5010 just a better description on a log.warn 2024-08-28 18:59:05 -04:00
Clebert Suconic 4352ebae5f ARTEMIS-5010 Addressing comments from PR https://github.com/apache/activemq-artemis/pull/5186 2024-08-28 14:08:49 -04:00
Clebert Suconic 4ba9f67d80 ARTEMIS-5010 AckManager records are not replicated 2024-08-28 11:53:16 -04:00
Timothy Bish 18e6f1a88d ARTEMIS-5007 Ensure mirror connection recovers from manual closures
If a user for some reason force closes the local mirror connection SNF
consumer or the actual connection but hasn't stopped the broker connection
itself the connection should recover and rebuild. The fix ensures that if
local connections are closed first then local session resources get freed.
2024-08-27 16:20:18 +01:00
Clebert Suconic 38693370c9 Revert "ARTEMIS-5001 Option to relax sync on journal replication for Mirroring"
This reverts commit d41f01a5aa.
2024-08-26 12:49:42 -04:00
Timothy Bish b58191bd52 ARTEMIS-5004 Clean up federation address consumer bindings proactively
When an address consumer explicitly closes or is closed we should remove the
address binding for that consumer right away instead of waiting for possible
configured auto delete as the demand is gone and we don't need to binding to
stick around any longer.
2024-08-21 17:04:18 +01:00
Clebert Suconic d41f01a5aa ARTEMIS-5001 Option to relax sync on journal replication for Mirroring
Say you use Mirroring and journal replication combined.

The target will wait a round trip on replica before sends are done.
It is possible to ignore that rountrip now with an option added into Configuration#mirrorReplicaSync
2024-08-20 16:03:57 -04:00
Timothy Bish c932b75de6 ARTEMIS-4998 Fix Federation link close wrongly closing the connection
The federation sender links can react incorrectly when the source broker
closes a receiver because the demand is gone and they can result in the
remote broker closing its side of the connection causing the whole federation
to need to be rebuilt. Handle the closure events correctly to prevent an
unexpected close and rebuild.
2024-08-20 11:16:16 +01:00
Clebert Suconic c042fb9e13 [maven-release-plugin] prepare for next development iteration 2024-08-16 10:23:18 -04:00
Clebert Suconic 0ec68a93d3 [maven-release-plugin] prepare release 2.37.0 2024-08-16 10:23:17 -04:00
Clebert Suconic 209f293922 [maven-release-plugin] prepare for next development iteration 2024-08-14 14:39:34 -04:00
Clebert Suconic de6efc82d1 [maven-release-plugin] prepare release 2.37.0 2024-08-14 14:39:21 -04:00
Timothy Bish f031481012 ARTEMIS-4982 Cleanup AMQP large message files for rejected sends
When an incoming AMQP large message send is rejected the broker should delete the
large message file as part of the reject handling.
2024-08-12 17:39:51 +01:00
Timothy Bish be4995a530 ARTEMIS-4969 Ensure AMQP senders can target FQQN if authorized
When using targeted FQQN permissions the AMQP sender needs to check that
it can access not only the address but also the queue if sent an FQQN so
that the security can validate if the sender has been granted directed
access to the FQQN as a whole.
2024-08-06 10:21:57 +01:00
Clebert Suconic fa917ae3fd [maven-release-plugin] prepare for next development iteration 2024-07-25 13:47:10 -04:00
Clebert Suconic 75f17ba64d [maven-release-plugin] prepare release 2.36.0 2024-07-25 13:47:09 -04:00
Clebert Suconic db0ba73aa4 ARTEMIS-4941 Remove lazy update after application properties only when it's paging
for regular messages it's quite obvious when the message is leaving the queue but for paged messages it becomes a challenge. We should just ignore the update for paged messages.
2024-07-25 13:01:57 -04:00
Clebert Suconic 1a5c2ec51c Revert "ARTEMIS-4941 Remove lazy update after application properties as it's no longer needed"
This reverts commit fb2a57f3ed.
2024-07-25 13:01:57 -04:00
Clebert Suconic fb2a57f3ed ARTEMIS-4941 Remove lazy update after application properties as it's no longer needed 2024-07-22 15:31:36 -04:00
Timothy Bish 1361e29739 ARTEMIS-4919 Handle Exception from proton transport process
Handle any exceptions from the proton transport and set the error on the
transport for processing in the events dispatch cycle by adding in handling
of the transport error event.
2024-07-15 15:34:21 +01:00
Justin Bertram fea2be6a3a ARTEMIS-4921 include protocol name in disconnection log message 2024-07-11 10:31:17 -07:00
Robbie Gemmell d45349fa67 ARTEMIS-4872: use explicit annotationProcessorPaths compiler config
Updates artemis-log-annotation-processor to use artemis-project so that
artemis-pom can reference artemis-log-annotation-processor without cycle.

Split out its tests to their own module to faciltate, also exercising the
profile mechanism to enable the processor usage with trigger file.

Simplify disabling processing in the module using maven.compiler.proc prop
available since maven-compiler-plugin 3.13.0

Uses a dummy non-processor path at root to 'disable' processsing on JDK < 23,
accounting for Maven 3 not being able to unset maven.compiler.proc from a
parent, and JDKs < 21 requiring newest builds to support -proc:full value
needed otherwise to reenable processing once explicitly disabled.
2024-06-28 16:49:27 +01:00
Justin Bertram ca73dee630 ARTEMIS-4833 remove redundant type arguments 2024-06-24 10:41:39 -07:00
Justin Bertram d7cf5dfa44 ARTEMIS-4829 use lambdas consistently
This commit uses lambdas or method references wherever possible. There
are still a handful of places that appear like they could be changed but
couldn't mainly because they use "this" and the meaning of "this"
changes when using a lambda.
2024-06-21 12:01:16 -04:00
Timothy Bish c6f227cbb8 ARTEMIS-4820 Read Header TTL as unsigned integer to set expiration
When setting expiration on the AMQPMessage the AMQP header TTL value
should be read as an unsigned integer and as such should use the longValue
API of UnsignedInteger to get the right value to set expiration.
2024-06-17 13:32:43 -05:00
Timothy Bish a6ff05ecd7 ARTEMIS-4817 Check policy credits before checking parent credits
When checking if address federation can be done the manager needs to look
at the policy level settings before looking at federation or connector
level settings for amqp credits.
2024-06-13 15:35:00 -07:00
Clebert Suconic f4fd259f07 [maven-release-plugin] prepare for next development iteration 2024-06-12 11:58:53 -04:00
Clebert Suconic b4d3a77649 [maven-release-plugin] prepare release 2.35.0 2024-06-12 11:58:52 -04:00
Clebert Suconic 4eb90765a7 ARTEMIS-4813 Large Message in replication / sync could lose part of the body
This is a regressio after ARTEMIS-4784
2024-06-12 00:31:22 -04:00