FISH-105 Migrate EJB Timers from Live Instances #5096
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a new feature or improvement.
This change allows you to migrate EJB timers from live instances, rather than only down ones. This is done using the
migrate-timers
command.Important Info
Blockers
None
Testing
New tests
None
Testing Performed
Database
From a clean domain:
asadmin migrate-timers --target Insty1 Insty2
target
is where the timers are being migrated to, the primary parameter (in the above case Insty2) is where they're being migrated fromasadmin migrate-timers --target Insty2 Insty1
asadmin migrate-timers --target Insty1 Insty2
asadmin migrate-timers Insty1
Hazelcast
From a clean domain:
asadmin migrate-timers --target Insty1 Insty2
target
is where the timers are being migrated to, the primary parameter (in the above case Insty2) is where they're being migrated fromasadmin migrate-timers --target Insty2 Insty1
asadmin migrate-timers --target Insty1 Insty2
asadmin migrate-timers Insty1
Testing Environment
Windows 10, Zulu JDK 8u275
Documentation
Pending...
Notes for Reviewers
There are separate issues pertaining to EJB timers which you may encounter, which as far as I can tell are unrelated to these changes. These are:
list-timers
asadmin command is woeful, particularly when it comes to Hazelcast.Summary of changes:
Not much seemed to be necessary to get timer migration to work against the traditional database - just removing the check for if the instances were alive seemed to be enough! When the now migrated timer triggers on the original instance (where it should no longer be), it detects that it no longer owns the timer and removes it from its local cache.
Against a DataGrid proved a bit more troublesome, due to the "half-local, half distributed" nature of it. I settled on pinging an event across the Hazelcast DataGrid for the EJB Timer service to listen to, purging the local timer cache of the instance from whence they came.