Fixing potential NPE when calling updateMessage on a Queue store in
KahaDB if subscription statistics are enabled. Also reduced the
visibily from public to protected to subscription statistic related
methods that shouldn't be public and added null pointer checks there as
well.
https://issues.apache.org/jira/browse/AMQ-6642
(cherry picked from commit 2731f04f1ca81312d08ffc21c0ceb09513165b7c)
Switching MessageDatabase to store JournalSyncStrategy as its enum value
instead of String to avoid the performance penalty of comparing Strings
everytime isEnableJournalDiskSyncs() is called which currently happens
on every write.
(cherry picked from commit 0d824a8e6832419cb952ef503504c5296b069ad9)
Fix KahaDB index free page recovery on unclean shutdown so that existing
free pages will be tracked and not lost.
(cherry picked from commit 38d85be476a06fe9a1f60b4f38232d64a6d0398a)
On journal start use lastFileLength instead of maxFileLength when
checking for unused space in the last journal file as it is possible the
length of the last journal file is not the same length as maxFileLength
(cherry picked from commit 0ad62f722fef6c2123ef7acb116a80574a43c250)
Fixing the order of locks acquired in the KahaDB journal to prevent a
deadlock during file rotation
(cherry picked from commit 5fd63a0e4ee71bb93843ab6bfbba6f93b023a3c3)
Fixing a thread safety issue with memoryUsage when using concurrentStoreAndDispatch
that was causing memory usage to get out of sync.
The InnerFutureTask class inside KahaDB was not thread safe which was
the root cause of the problem.
(cherry picked from commit 0f0bdb21ef97c39ec7d54d164e07921611c1de08)
Round the start time value not truncate to ensure delay falls on the
correct side of the scheduling block.
(cherry picked from commit 980162233fd3693d1f83d3f95985ac33affa7a8f)
The temporary store will now delete the old temp directory on start up
if lazyInit is true instead of waiting for the store to initialize to
clear up space. This prevents space on the disk from being wasted with
old data if the temp store isn't initialized
(cherry picked from commit a82c95cd29a6b06d2083b1869129b9e2addac7da)
Modifying patch so that only stores that persist the noLocal flag will
check if this flag has changed to prevent a subscription from being
deleted by mistake
(cherry picked from commit 18571ce09b6385d8560200928a353e9da1a1ffe4)
Fixing test so that test DataFile is written to a temporary directory
instead of the main activemq-kahadb-store directory. This prevents git
from picking up the test file
Reworking patch so that a periodic disk sync uses a journal trace
command to trigger the sync so that everything is done in the same
thread for the writes
Adding non-blocking metrics to KahaDB to track message counts and sizes
for subscriptions. Turned off by default but can be enabled on the
KahaDBPersistenceAdapter
Fixing store size calculation on KahaUpdateMessageCommand processing so
that the size won't increase inadvertently if the existing location of
the command in the journal is the same as the new location
Fixing PList size tracking by moving the null assignment on removal to
after the onRemoval method is called to make sure that the decrement is
done properly.