Commit Graph

2181 Commits

Author SHA1 Message Date
Clebert Suconic 6d3dbc4383 ARTEMIS-4233 Large Message Issues After Failed Clients
- interrupted message breaking reference counting
After the server writing to the client is interrupted in AMQP, the reference counting was broken what would require the server restarted
in order to cleanup the files of any interrupted sends.

- Removed consumer during large message delivery damaging large messages
If the consumer failed to deliver messages for any reason, the message on the queue would be duplicated. what would wipe out the body of the message
and other journal errors would happen because of this.

extra debug capabilities added into RefCountMessage as part of ARTEMIS-4206 in order to identify these issues
2023-04-06 07:40:01 -07:00
Clebert Suconic 23bbf76bdf ARTEMIS-4233 Avoiding holder.iter=null with a compile time validation 2023-04-06 07:40:01 -07:00
Justin Bertram 8ba9727b78 ARTEMIS-4210 refactor connection audit logging
This commit fixes the following things:

 - Moves connection audit logging to the resource audit logger instead
   of using a dedicated logger as that would adversely impact upgrading
   users, and arguably didn't make sense in the first place.
 - Mitigates an potential NPE w.r.t. connection ID.
 - Updates the "dummy" management connection to return a valid
   connection ID.
2023-03-30 14:37:17 -07:00
Clebert Suconic a8d828a510 ARTEMIS-4224 cert-users-LARGE.properties is too big for certain CI machines 2023-03-29 15:00:46 -05:00
Justin Bertram d2e5ddfe86 ARTEMIS-4210 audit connection creation & destruction 2023-03-28 16:21:04 -05:00
Clebert Suconic 15d39a14ea ARTEMIS-4207 Improved fix on LargeMessage Redistribution
This fix will delay the message.copy to the redistributor itself.
Meaning no copy would be performed if the redistribution itself failed.

No need to remove a copy any longer
2023-03-27 10:45:07 -07:00
Clebert Suconic 6d9bd71901 NO-JIRA I meant to remove this line 2023-03-18 18:48:07 -04:00
Clebert Suconic d730d1a684 NO-JIRA Testsuite speedup: proper JDBC drop from derby 2023-03-18 15:44:03 -07:00
Domenico Francesco Bruscino aaa8627795 ARTEMIS-4211 Fix record message id for federated queue consumers
The federated queue consumer has to generate a new id for the messages
received from the upstream broker because they have an id generated by
the store manager of the upstream broker.

Co-authored-by: Clebert Suconic <clebertsuconic@apache.org>
2023-03-18 08:52:21 -07:00
Clebert Suconic f43d3c4bde ARTEMIS-4207 Removing logger.info added by accident (temporary debug) 2023-03-15 18:01:03 -04:00
Clebert Suconic 8b2be8ef3b ARTEMIS-4207 Removing logger.info added by accident (temporary debug) 2023-03-15 16:24:25 -04:00
Clebert Suconic 3a5601572e ARTEMIS-4207 Redistribution could leave messages stranded in the folder
- redistribute received the handle call, it then copies the message
- the routing table changes
- the message is left behind

With the new version of the server these messages will be removed. But we should remove these right away
2023-03-15 12:46:50 -07:00
Clebert Suconic 4babdab18c NO-JIRA Cleanup MBeanServer usage in the testsuite as it is leaking
Basically I started the testsuite and attached check leak with "java -jar check-leak.jar --pid <pid> --report testsuite-report --sleep 1000" and saw the allocations of this were pretty high.
2023-03-15 12:42:12 -07:00
Clebert Suconic 2c037386b6 ARTEMIS-4206 Unreferenced AMQP Large Messages not removed right away, requiring a reboot 2023-03-15 05:57:51 -07:00
Justin Bertram 39b0f01ca9 ARTEMIS-4202 expand coverage of noCacheExceptions in LDAPLoginModule 2023-03-10 17:49:13 -06:00
Clebert Suconic 294daa0ff6 ARTEMIS-4162 Remove EMPTY_ROUTING_TYPES from AddressInfo
I have seen a werid intermittent failure in the testsuite
caused by some race where the EMPTY_SET ends up Not Empty! Causing weird failures that were really difficult to be investigated
2023-03-10 09:52:27 -08:00
Clebert Suconic 257dd86ae2 ARTEMIS-4193 Large Message Files orphaned after server killed
This fix is scanning journal and paging for existing large messages. We will remove any large messages that do not have a corresponding record in journals or paging.
2023-03-09 08:35:51 -08:00
Domenico Francesco Bruscino 7a0bf52ed8 ARTEMIS-4190 Fix config-delete-queues when address changes 2023-03-09 09:42:57 -06:00
Domenico Francesco Bruscino bb08a573eb ARTEMIS-3640 Use client connectors for HA 2023-03-09 11:20:51 +00:00
Gary Tully 00cae02ca4 ARTEMIS-4196 - set message routing type in mqtt publish 2023-03-08 14:30:30 -06:00
Clebert Suconic dc93f01542 ARTEMIS-4199 PageCounter could leave a record pending in the journal
This is just an annoying thing. as the functionality would work properly if there was a previous value.
No other harm other than the cannot find TX record on startup for this, hence I'm fixing it.
2023-03-07 17:18:43 -05:00
Clebert Suconic 08a81a7402 I had a mistake reapplying the large message fix. I'm still reworking the commit.
I apologize for this spam

This reverts commit 14536bf311.
2023-03-06 20:05:18 -05:00
Clebert Suconic 14536bf311 Revert "I'm temporarily reverting "ARTEMIS-4193 Large Message Files orphaned after server killed""
This reverts commit 7e6ce5a259.
2023-03-06 17:04:18 -08:00
Clebert Suconic 7e6ce5a259 I'm temporarily reverting "ARTEMIS-4193 Large Message Files orphaned after server killed"
while I figure out a better fix

This reverts commit 9f1927d3fa.
2023-03-06 12:31:54 -05:00
Justin Bertram 97c78525da ARTEMIS-4181 make try-with-resources style consistent 2023-03-03 08:40:51 -06:00
Clebert Suconic 9f1927d3fa ARTEMIS-4193 Large Message Files orphaned after server killed 2023-03-02 19:03:37 -08:00
Justin Bertram b76c672305 ARTEMIS-4162 support deleting addresses & queues w/o usage check
There are certain use-cases where addresses will be auto-created and
never have a direct binding created on them. Because of this they will
never be auto-deleted. If a large number of these addresses build up
they will consume a problematic amount of heap space.

One specific example of this use-case is an MQTT subscriber with a
wild-card subscription and a large number of MQTT producers sending one
or two messages a large number of different MQTT topics covered by the
wild-card. Since no bindings are ever created on any of these individual
addresses (e.g. from a subscription queue) they will never be
auto-deleted, but they will eventually consume a large amount of heap.
The only way to deal with these addresses is to manually delete them.

There are also situations  where queues may be created and never have
any messages sent to them or never have a consumer connect. These
queues will never be auto-deleted so they must be deleted manually.

This commit adds the ability to configure the broker to skip the usage
check so that these kinds of addresses and queues can be deleted
automatically.
2023-03-02 19:17:03 -06:00
Gary Tully dc7d1e25cc NO-JIRA - add test for ENC of tls params for broker amqp connection via props 2023-03-02 12:53:30 +00:00
Clebert Suconic 8078dd098c ARTEMIS-4171 Messages leaking thorugh AMQP Delivery
there are two leaks here:

* QueueImpl::delivery might create a new iterator if a delivery happens right after a consumer was removed, and that iterator might belog to a consumer that was already closed
             as a result of that, the iterator may leak messages and hold references until a reboot is done. I have seen scenarios where messages would not be dleivered because of this.

* ProtonTransaction holding references: the last transaction might hold messages in the memory longer than expected. In tests I have performed the messages were accumulating in memory. and I cleared it here.
2023-02-28 14:36:32 -05:00
Justin Bertram fb169bc4af ARTEMIS-4172 sending large msg via core skips plugins & audit log 2023-02-16 13:34:29 -08:00
Justin Bertram 82fc42987a ARTEMIS-4171 potential large message file leak 2023-02-16 13:34:29 -08:00
Clebert Suconic a2ba6ed298 ARTEMIS-4161 AMQP and OpenWire leaking leaking objects in certain conditions
The issue identified with AMQP was under Transaction usage, and while opening and closing sessions.
It seems the leak would be released once the connection is closed.

We added a new testsuite under ./tests/leak-tests To fix and validate these issues
2023-02-16 12:10:54 -08:00
Rakhi Kumari 17c760ab7b ARTEMIS-4157: Fix error setting broker properties for AddressSettings 2023-02-10 09:53:22 +00:00
Gary Tully 94516b8b37 fix mirror test that validates autostart 2023-02-08 16:44:42 +00:00
Clebert Suconic ed5f63538e ARTEMIS-4155 Fixing deadlock on LargeMessage conversion and retention 2023-02-06 09:27:18 -05:00
Justin Bertram 8f30347b18 ARTEMIS-4143 improve mitigation against split-brain with shared-storage
Configurations employing shared-storage with NFS are susceptible to
split-brain in certain scenarios. For example:

  1) Primary loses network connection to NFS.
  2) Backup activates.
  3) Primary reconnects to NFS.
  4) Split-brain.

In reality this situation is pretty unlikely due to the timing involved,
but the possibility still exists. Currently the file lock held by the
primary broker on the NFS share is essentially worthless in this
situation. This commit adds logic by which the timestamp of the lock
file is updated during activation and then routinely checked during
runtime to ensure consistency. This effectively mitigates split-brain in
this situation (and likely others). Here's how it works now.

  1) Primary loses network connection to NFS.
  2) Backup activates.
  3) Primary reconnects to NFS.
  4) Primary detects that the lock file's timestamp has been updated and
     shuts itself down.

When the primary shuts down in step #4 the Topology on the backup can be
damaged. Protections were added for this via ARTEMIS-2868 but only for
the replicated use-case. This commit applies the protection for
removeMember() so that the Topology remains intact.

There are no tests for these changes as I cannot determine how to
properly simulate this use-case. However, there have never been robust,
automated tests for these kinds of NFS use-cases so this is not a
departure from the norm.
2023-02-03 10:40:08 -05:00
Clebert Suconic 2378d187af [maven-release-plugin] prepare for next development iteration 2023-01-31 07:22:48 -05:00
Clebert Suconic 893e1e7916 [maven-release-plugin] prepare release 2.28.0 2023-01-31 07:22:47 -05:00
Robbie Gemmell 031788dbe8 ARTEMIS-3178: remove erroneous comment 2023-01-31 11:48:43 +00:00
Clebert Suconic bbf1baf3b2 ARTEMIS-3178 Fixing validation on PagingStoreImpl for parameters set 2023-01-31 06:40:57 -05:00
Clebert Suconic 764db34e9b ARTEMIS-3178 Page Limitting (max messages and max bytes)
I am adding three attributes to Address-settings:

* page-limit-bytes: Number of bytes. We will convert this metric into max number of pages internally by dividing max-bytes / page-size. It will allow a max based on an estimate.
* page-limit-messages: Number of messages
* page-full-message-policy: fail or drop

We will now allow paging, until these max values and then fail or drop messages.

Once these values are retracted, the address will remain full until a period where cleanup is kicked in by paging. So these values may have a certain delay on being applied, but they should always be cleared once cleanup happened.
2023-01-30 18:19:45 -05:00
Gary Tully b5ae95c376 ARTEMIS-4149 - add watch to login.config dir to trigger periodic update to jass reloadable properties status in the absence of login attempts 2023-01-30 15:25:58 -05:00
Ryan Highley 1c987ff129 ARTEMIS-3139 Anonymous types in Artemis config XSD
Moves embedded XSD element definitions and associated complexTypes
from XSD element definitions to top-level types available for XML
schema validation in IDEs.
2023-01-30 14:15:53 -05:00
Justin Bertram 49f8846861 ARTEMIS-4146 reauthenticated subjects are not cached 2023-01-30 12:02:08 -05:00
Domenico Francesco Bruscino ac7b0e85fb ARTEMIS-4113 Fix NPE for backup brokers with connection routers
The nodeID on backup brokers is available only after they become live.
2023-01-26 09:55:31 -05:00
Clebert Suconic 0d3cd8d880 ARTEMIS-4136 Mirrored sync replica
I am adding an option sync=true or false on mirror. if sync, any client blocking operation will wait a roundtrip to the mirror
acting like a sync replica.
2023-01-23 12:38:11 -05:00
Justin Bertram b0ba8cae24 ARTEMIS-4137 MQTT sub-queue clean-up can fail due to auth 2023-01-23 16:18:03 +01:00
Justin Bertram bd99a11780 ARTEMIS-4135 mitigate NPE when browsing 2023-01-17 12:18:58 -06:00
iliya e68034518d ARTEMIS-4129 Add max-saved-replicated-journals-size parameter to primary and replicated policy configuration
Allow override default max-saved-replicated-journals-size value when the server is configured as primary or replicated.
2023-01-17 12:07:10 -06:00
Andy Taylor b02002fc66 ARTEMIS-3875 - adding consumer and producer metrics
https://issues.apache.org/jira/browse/ARTEMIS-3875
2023-01-13 15:49:44 -05:00