When a flow is finished do not delete the checkpoint from the DB.
Instead, the FlowStatus is marked as Completed in the DB.
Updated numerous tests which relied on the flow being removed
when finished.
* Update Checkpoint DB to update flow io request
* Modify flow monitor to update Checkpoint DB with waiting flows
This happens periodically.
* Refactored code to avoid looping twice and updated tests
* Fix tests after rebasing
* Fix MR comments (non-functional refactor of tests + FlowMonitor).
* Made visible for testing method private in DBCheckpointStorage
This is not needed anymore.
* Explicity check if ioRequestType has changed in update method
* Fix shadowing warning
* Import non deprecated Assert into test
* Use AssertEquals not assert in test
* Address more comments (minor refactor) of DBCheckpointStorage
* Minor fix use it instead of referencing object explicitly
* Add null check to DBCheckpointStorage
* Revert changes to Flow Monitor.
We will instead store the information in the main thread of the
state machine.
* Remove now uneeded API and make statemachine update ioRequest
* Add Integration Test to check statemachine updates DB on Recieve
* Use simpleName in checkpoint storage instead of class.
Hibernate was previously resetting the class field this is now
set to null (when getting checkpoint form DB) and a new method
for getting back the simple name as a string.
* Update StateMachineState to store simple name.
* Fix after rebase broke stuff + renamed test
* Fix Detekt issue
* Remove uneeded null assertion
Do not cascade updates to checkpoint error and result tables to hopefully
improve database performance moving forward. Because the joined tables
are no longer being updated by updating the main `DBFlowCheckpoint` entity,
they must be created/updated/deleted manually.
The checkpoint blobs still cascade as they pretty much always evolve in
tandem with the main checkpoint table.
* Replace old Checkpoint table with new one.
Adds some of the new fields into the table where needed (I have
guessed this stuff but we can update it as we go along).
* Fix database constraints + name table correctly opps.
* Fixed typos in Liquidbase script
Also corrected constraints and added missed fields in hibernate
checkpoint class and liquibase scripts.
* Update CheckpointStorage to pass in serialization context.
This is cleaner than passing both the checkpoint and the
serialized checkpoint into the methods. Also fixed
CordaPersistanceServiceTests which I accidentally broke.
* Fix detekt problem
* Revert "Update CheckpointStorage to pass in serialization context."
This reverts commit b71e78f202.
* Fix test broken by reverting commit
* CORDA-3597 Update metadata join, timestamp columns and serialization
- Change the metadata join to the checkpoints table to use
`invocation_id` instead of `flow_id`. There were issues joining
between the tables because `flow_id` was not the primary key of the
metadata table. Switching over to `invocation_id` has at least allowed
us to bypass this issue. The information about the `invocation_id` is
stored in the `Checkpoint` class which makes it simple to save at
runtime.
- Some of timestamp columns were nullable when they should always be
populated, the nullable flags have now been removed.
- Previously the whole checkpoint was being serialized and stored into
the `checkpoints_blob.checkpoint` column. This meant duplicated saving
as the `flow_state` was contained in this object. Only the
`CheckpointState` property of `Checkpoint` is now being serialized and
saved to this field. Furthermore, it now uses the default
`STORAGE_CONTEXT` serialization (AMQP) instead of Kryo (which is only
used for serializing the `flow_state` / flow stack).
- The checkpoint database performance metrics recording has been
abstracted to its own class.
* CORDA-3597 Make metadata join non optional
Remove the nullable declaration on the metadata field of
`DBFlowCheckpoint`
* CORDA-3597 Rename `node_checkpoints_blobs` to `node_checkpoint_blobs`
* CORDA-3597 Update some kdocs
Co-authored-by: Dan Newton <danknewton@hotmail.com>
* Split StateMachine State into 2 classes
The idea is this better reflects the database structure. Added a
few helper methods to copy and update state.
* Doc + Improve Checkpoint API
* Rename methods to be more clear
* TM-197 Setting bouncy castle provider in order for the test to pass
* TM-197 setting timeout for all builds at 3 hours
* TM-197 ignoring unstable tests
* Make tee not wrap PublishSubjects in SafeSubscribers, otherwise a non Rx exception from an unsafe observer shuts down all other observers under the same PublishSubject
* Throw SQLException or PersistenceException plain, that may come out of an unsafe subscriber
* Revert "Throw SQLException or PersistenceException plain, that may come out of an unsafe subscriber"
This reverts commit c7b8af3fa6.
* Update Detekt baseline
* Just passing in the exception was printing the entire stacktrace to the log, now we just pring the exception and message
* Updating exception message
* switch to new version of plugin
* change plugin version to force refresh
* try using pre-populated cache
* do not preallocate
* no daemon
* reduce cores per fork to increase parallelism
* even more aggresive cpu allocation