Added an extra isShutdown() failsafe check when detecting if the
checkpoint thread should start
(cherry picked from commit 91213010b30d426095c16d3fa8d5fa2cafaf05e5)
Properly nulling out the scheduler service in MessageDatabase after it
is shutdown on a store close so that if the store is restarted the
thread will properly restart.
(cherry picked from commit 7bdcca1bdacec4955c55e8717ac8d61cc51b0c69)
Moving beforeMarshall back to the store implementations because we don't
want all store implementations to marshall (such as memory store)
This reverts commit 32913408a68ec92e3d202f5dcc3923d5c7d7588a.
Calling beforeMarshall on messages when they async stored before the
store task is run and before consumer dispatch to prevent two threads
from trying to mutate the message state at the same time.
(cherry picked from commit b9f9f03829a65efa2956c347d2cafa41905313c6)
Adding a flag to enable or disable Ack Compaction
Currently defaults to enabled for 5.14.0 and above
(cherry picked from commit cbad8babe507f63cc80e42fe37070b898d4d8dbc)
Expose configuration on the persistence adapter level.
Double the test timeout and increase the compaction frequency to account
for very slow CI boxes.
(cherry picked from commit a9521dcebfb4e469dde7465ff95d8e8f1f050abd)
Perform writes / sync in predicatable order first to the recovery file
and then into the main index file.
(cherry picked from commit b39ab7867c208a967090eff189594c2b06dafb34)
Computing messageSize for a durable subscription in KahaDB now runs much
faster (n vs n^2) which is noticable when there are a large number of
pending messages for a durable subscription.
(cherry picked from commit 25ff5699f1fb7c73668d5da2eacb53ad2ef14289)
Ensure that when add / remove commands are colocated they don't prevent
the log from being GC'd once it is unreferenced.
(cherry picked from commit 8c4b5f485d64caec97b0abe2b721d47bc19bfba1)
Fixing the processing of KahaUpdateMessageCommand to add the message to
the store if it doesn't exist, instead of ignoring it. This will
prevent message loss in certain cases when the KahaDB index has to be
rebuilt.
(cherry picked from commit b4aa53d806570a4f054dc0af9cb095f13b914153)
Fixing JournalCorruptionEofIndexRecoveryTest class
Because of the size being stored in the message order index, the test
testRecoveryAftercorruptionCheckSumExistingIndex was no longer passing
as that test was corrupting the size value in the journal, but not the
size value in the index. The test now corrupts both values so that the
expect exception occurs again.
(cherry picked from commit 507d40a79f15449ba6d79ef85d7fdf6bf50a3a65)
Fixing KahaDB so that the correct marshaller is used for the message
keys inside of the message order index. This will ensure that message
size metrics are accurate.
(cherry picked from commit 246ccb8e04515c6e85544b32035537f60d92b5b9)
Propertly re-setting the storeOpenWireVersion from the BrokerService
on the KahaDB Metadata if a corrupted index is detected and the
Metadata has to be recreated.
(cherry picked from commit 7a7c70ad7524594339c4388b897fa1eac6988928)
The journalSize counter should be set to 0 after KahaDB is shut down.
Usually, a store is not restarted again after stopping, but if it ever
was the value would be wrong since it wasn't reset back to 0.
Adding metrics to track the pending message size for a queue and for
subscribers. This is useful so that not only the pending count is
known but also the total message size left to consume. Also improving
the message size store tests as well.
Adding support for auto detection of wire protocols over a transport.
OpenWire, AMQP, STOMP, and MQTT can all be detected and the broker
will properly handle each one over a given Transport. Currently
auto TCP, NIO, SSL, and NIO+SSL transports can handle auto-detection
of the wire format and client but support could be added in the
future for other transports like websockets.