Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-instance Support #311

Merged
merged 115 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
365c58a
Initial checkpoint
lbwexler Jan 10, 2023
ef13398
Checkpoint
lbwexler Jan 27, 2023
12215e2
Merge branch 'develop' into multiInstance
lbwexler Aug 17, 2023
e3f9c85
Update Hazelcast version
lbwexler Aug 17, 2023
debd02d
Minor cleanups from recent review
lbwexler Aug 17, 2023
bb90890
Checkpoint
lbwexler Aug 18, 2023
8c9f17f
Fix exception handling
lbwexler Aug 18, 2023
d5059dd
Checkpoint
lbwexler Aug 18, 2023
a3eba23
Checkpoint
lbwexler Aug 18, 2023
c78ad41
checkpoint
lbwexler Aug 19, 2023
c7b5e03
Remove/simplify comments
lbwexler Aug 22, 2023
c0f7bc6
Checkpoint
lbwexler Aug 23, 2023
1c33666
Checkpoint
lbwexler Aug 23, 2023
262d61b
Checkpoint
lbwexler Aug 23, 2023
7882202
Checkpoint
lbwexler Aug 23, 2023
795f7cf
Checkpoint
lbwexler Aug 23, 2023
d0e0509
Checkpoint
lbwexler Aug 23, 2023
01a8bfe
Fix to file download
lbwexler Aug 24, 2023
88b57c9
Checkpoint
lbwexler Aug 24, 2023
74a5aa3
Checkpoint -- improve stats
lbwexler Aug 31, 2023
77bce64
Merge branch 'develop' into multiInstance
lbwexler Sep 2, 2023
61846c5
Add changelog
lbwexler Sep 2, 2023
80c5b19
Support for Multi-instance monitoring
lbwexler Sep 5, 2023
8ef4d4b
Changes from ATM code review
lbwexler Sep 6, 2023
2f06819
+ Add Timer.masterOnly
lbwexler Sep 6, 2023
ecac8b8
Checkpoint
lbwexler Sep 7, 2023
bd76b86
Rename from ATM code review
lbwexler Sep 7, 2023
fb1b3fa
Enable instance shutdown
lbwexler Sep 7, 2023
232eb3b
Checkpoint
lbwexler Sep 8, 2023
5830a22
Checkpoint
lbwexler Sep 8, 2023
1882ad0
Checkpoint -- improve behavior on server instance kill
lbwexler Sep 11, 2023
780d820
Update to Hazelcast 5.3.2
amcclain Sep 15, 2023
3a04d76
Tweaks while reviewing
amcclain Sep 15, 2023
e9a7d12
Merge branch 'develop' into multiInstance
amcclain Sep 15, 2023
983da80
Minor formatting, tweaks to reported obj stats
amcclain Sep 16, 2023
abd6070
Merge branch 'develop' into multiInstance
amcclain Sep 16, 2023
a320f01
Merge branch 'develop' into multiInstance
amcclain Sep 18, 2023
bdb07f1
WIP changelog version -> 18.0-SNAPSHOT
amcclain Sep 18, 2023
d645bed
Merge branch 'develop' into multiInstance
amcclain Sep 21, 2023
cd7107a
Version to 19.0-SNAPSHOT
amcclain Sep 21, 2023
b0f3ad3
Use instance name in app log name
amcclain Sep 21, 2023
e699bdb
Print cluster and instance name in Hoist init banner
amcclain Sep 21, 2023
52e7cf2
Remove HZ config always enabling multicast
amcclain Sep 21, 2023
44c2106
Checkpoint -- java only config
lbwexler Sep 27, 2023
4799e6e
checkpoint - facilitate application level configuration
lbwexler Sep 28, 2023
8d6af60
checkpoint
lbwexler Sep 29, 2023
f83c3c3
checkpoint
lbwexler Sep 29, 2023
a09b43c
checkpoint -- support for isReady
lbwexler Sep 29, 2023
1a2849a
Enhancement to admin stats, including support for timer stats
lbwexler Oct 2, 2023
44fb81e
Tweak
lbwexler Oct 2, 2023
05f2f8b
Checkpoint
lbwexler Oct 2, 2023
6e462cb
Timer stats tweak
lbwexler Oct 2, 2023
cf28d42
Tweak to Timer stats
lbwexler Oct 2, 2023
33f2870
Twweak to changelog
lbwexler Oct 2, 2023
cabd62b
Tweak to location of cluster configuration
lbwexler Oct 2, 2023
7f931a5
Add error logging
lbwexler Oct 3, 2023
d316f3f
Make getLatestSnapshot null safe in memory and conn. pool monitoring …
PeteDarinzo Oct 3, 2023
be3f0a7
Fix Hazelcast version appropriately with spring BOM
lbwexler Oct 3, 2023
6540161
Fix Hazelcast version appropriately with spring BOM
lbwexler Oct 3, 2023
70bdd53
Fix Hazelcast version appropriately with spring BOM
lbwexler Oct 3, 2023
ce505ef
+ Fix Hazelcast.xml version.
lbwexler Oct 10, 2023
7c88970
Don't create Hazelcast info during build process only
lbwexler Oct 11, 2023
443f02e
+ Improve Hibernate caching management and fold into `DistributedObje…
lbwexler Oct 12, 2023
d2a6b0a
Major improvements to ability of apps and plugins to override all asp…
lbwexler Oct 12, 2023
092d35c
Tighten access control of new cluster config
lbwexler Oct 12, 2023
8841fd3
Support for shared object
lbwexler Oct 12, 2023
dbdf953
Fix bug with missing instanceName
lbwexler Oct 13, 2023
8e8dc74
Fix bug with missing ClusterConfig
lbwexler Oct 13, 2023
d7c7119
Fix bug with missing ClusterConfig
lbwexler Oct 13, 2023
9c69bfe
Tweak to call logLevelChanged asynchronously, as intended
lbwexler Oct 13, 2023
fa8ccfc
Query Sevice stats for service on demand
lbwexler Oct 16, 2023
e84fa70
Always mark service as initialized
lbwexler Oct 17, 2023
27c21d7
Major cleanup to cross-cluster exception handling
lbwexler Oct 18, 2023
a33b83a
Tweak type
lbwexler Oct 18, 2023
61bc889
Fixes to AllChannels endpoint
lbwexler Oct 18, 2023
f907a81
Major improvements to Exception Handling
lbwexler Oct 19, 2023
bbe690d
Major improvements to Exception Handling
lbwexler Oct 19, 2023
5fbdce0
Additional serialization fixes
lbwexler Oct 19, 2023
d224590
Update to support notion that server may "swap out" beneath a running…
lbwexler Oct 20, 2023
7df7304
Merge branch 'develop' into multiInstance
lbwexler Nov 14, 2023
6d64f80
Update HttpClient version and grails version
lbwexler Nov 17, 2023
8ff0c3c
Remove empty statistic
lbwexler Nov 17, 2023
63d9c4b
Checkpoint
lbwexler Nov 20, 2023
9125906
Checkpoint
lbwexler Nov 20, 2023
f97d353
Fix to recent regressions
lbwexler Nov 20, 2023
9632628
update API from recent code review
lbwexler Nov 21, 2023
d25bb8b
Use unique class name for hazelcast map name
lbwexler Nov 21, 2023
284bcf6
show source of timer error
lbwexler Nov 21, 2023
3b89b25
Fix to recent regressions
lbwexler Nov 21, 2023
7b96944
Improve commenting
lbwexler Nov 21, 2023
73e3a3f
Final tweak to log message for readability
lbwexler Nov 21, 2023
bd61bfd
Tweak to changelog
lbwexler Nov 21, 2023
2735ea3
Fix to recent grails 6.1.0 regression
lbwexler Nov 21, 2023
5ff7690
Restore view of Distributed Object
lbwexler Nov 21, 2023
5434af9
Tweak to changelog
lbwexler Nov 22, 2023
0767e85
syntax cleanup for admin stats
lbwexler Nov 22, 2023
2299cf3
Streamline admin reporting of timers
lbwexler Nov 22, 2023
abf6411
Merge branch 'develop' into multiInstance
lbwexler Dec 26, 2023
345c2d8
+ Improve specification of defaults for all collection types, includi…
lbwexler Dec 27, 2023
67f5473
+ Share roles across entire cluster
lbwexler Dec 27, 2023
f2fd6ed
+ Use Kyro for default Hazelcast Serialization
lbwexler Dec 29, 2023
45965fb
Kryo test serialization
lbwexler Jan 3, 2024
732cd84
Merge branch 'develop' into multiInstance
lbwexler Mar 17, 2024
2d57818
Merge branch 'develop' into multiInstance
lbwexler Mar 17, 2024
7138184
Merge branch 'develop' into multiInstance
lbwexler Mar 18, 2024
76d4d3a
Update Grails and Gorm to latest and greatest
lbwexler Mar 18, 2024
b29eea4
Make RoleService Cluster friendly
lbwexler Mar 18, 2024
60f95f3
Upgrade snapshot version for multi-instance
lbwexler Mar 18, 2024
e835469
Remove extraneous file
lbwexler Mar 18, 2024
9239673
Merge branch 'develop' into multiInstance
lbwexler Apr 2, 2024
f722c1b
Merge branch 'develop' into multiInstance
lbwexler Apr 4, 2024
878265e
Fix merge error
lbwexler Apr 5, 2024
b2bd89b
Final Serialization updates
lbwexler Apr 5, 2024
c71cde5
Tighten up logging of serialization/deserialization
lbwexler Apr 5, 2024
e1fff68
Merge branch 'develop' into multiInstance
lbwexler Apr 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,73 @@

## 20.0-SNAPSHOT - unreleased

### 🎁 New Features

* Hoist Core v20 provides support for running multi-instance clusters of Hoist application servers.
Cluster management is provided by the use of Hazelcast (www.hazelcast.com), an open-source library
providing embedded java support for inter-server communication, co-ordination, and data sharing.
See the new `ClusterService.groovy` service, which provides the clustering implementation and main
API entry point for accessing the cluster.
** Applications/client plugins upgrading to v18 will need to provide a cluster configuration class
with the name `ClusterConfig.groovy`. See toolbox for an example of this file.
** Applications should fix their Hazelcast version with the following line in their gradle.properties:
`hazelcast.version=5.3.6`
** Applications that intend to run with more than one server *must* enable sticky sessions when
routing clients to servers. This is critical for the correct operation of authentication
and web socket communications.
** Many applications will *not* need to implement additional changes beyond the above to
run with multi-instances; Hoist will setup the cluster, elect a master instance, provide
cluster-aware hibernate caching and logging, and ensure cross-server consistency for its own
APIs.
** However, complex applications -- especially applications with state, workflow, or business
logic -- should take care to ensure the app is safe to run in multi-instance mode. Distributed
data structures (e.g. Hazelcast Maps) should be used as needed, as well as limiting certain
actions to the "master" server. See toolbox, or Hoist for help.
** `hoist-react >= 64.0` is required.
* New support for reporting of service statistics for trobuleshooting/monitoring. Implement
`BaseService.getAdminStats()` to provide diagnostic metadata about the state of your service that
will then be displayed in the admin client.
* All `Throwable`s are now serialized to JSON by default using Hoist's standard customization of
Jackson.

### Breaking Changes
* The following server-side Hoist events are now implemented as cluster-wide Hazelcast messages
rather than single-server Grails events:
** 'xhFeedbackReceived', 'xhClientErrorReceived', 'xhConfigChanged', and 'xhMonitorStatusReport'
Any applications that are listening to these events with `BaseService.subscribe` should instead use
the new cluster aware method `BaseService.subscribeToTopic`.
* The `exceptionRenderer` singleton has been simplified and renamed as `xhExceptionHandler`. This
change was needed to better support cross-cluster exception handling. This object is used by
Hoist internally for catching uncaught exceptions and this change is not expected to impact
most applications.

* New support for Role Management.
* Hoist now supports an out-of-the-box, database-driven system for maintaining a hierarchical
set of roles and associating them with individual users.
* New system supports app and plug-in specific integrations to AD and other enterprise systems.
* Hoist-react `v64` is now required and will provide an administrative UI to visualize and
manage the new role system.
* See `DefaultRoleService` for more information.

### ⚙️ Technical

* Add `xh/echoHeaders` utility endpoint. Useful for verifying headers (e.g. `jespa_connection_id`)
that are installed by or must pass through multiple ingresses/load balancers.
* Remove HTML tag escaping when parsing alert banner create/update request JSON.

### 💥 Breaking Changes

* Applications will typically need to adjust their implementation of `BaseRoleService`. Most
applications are expected to adopt the new provided `DefaultRoleService`, and may be required to
migrate existing code/data to the new API. Applications that wish to continue to use a completely
custom `BaseRoleService` will need to implement one additional method: `getUsersForRole`.

### 📚 Libraries
* grails `6.1.0`
* gorm `8.0.1`
* hazelcast `5.3.6`


## 19.0.0 - 2024-04-04

### 💥 Breaking Changes (upgrade difficulty: 🟢 LOW - latest Hoist React + DB col additions)
Expand Down
13 changes: 9 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ dependencies {
//--------------------
// Hoist Additions
//--------------------

api "com.hazelcast:hazelcast"

api "org.apache.tomcat:tomcat-jdbc"
api "org.codehaus.groovy:groovy-dateutil:$groovyVersion"

// Quartz, with Grails 4/5 workaround (https://github.com/grails-plugins/grails-quartz/issues/107
api("org.quartz-scheduler:quartz:2.3.2") {exclude group: 'slf4j-api', module: 'c3p0'}
api 'org.grails.plugins:quartz:2.0.13'

api "org.hibernate:hibernate-core:5.6.11.Final"
api "org.hibernate:hibernate-ehcache:5.6.11.Final"
api "net.sf.ehcache:ehcache:2.10.9.2"
api "org.hibernate:hibernate-jcache"

api "org.apache.poi:poi:4.1.2"
api "org.apache.poi:poi-ooxml:4.1.2"
Expand All @@ -72,10 +73,14 @@ dependencies {
api "org.apache.directory.api:api-all:2.1.3"

api "org.springframework:spring-websocket"
api "org.apache.httpcomponents.client5:httpclient5:5.1.2"
api "org.apache.httpcomponents.client5:httpclient5:5.2.1"
api 'org.jasypt:jasypt:1.9.3'
api "commons-io:commons-io:2.8.0"
api "org.owasp.encoder:encoder:1.2.3"

api "com.esotericsoftware:kryo:5.5.0"
api "info.jerrinot:subzero-core:0.11"

}


Expand Down
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
xhReleaseVersion=20.0-SNAPSHOT

grailsVersion=6.0.0
grailsGradlePluginVersion=6.0.0
grailsHibernatePluginVersion=8.0.0
grailsVersion=6.1.2
grailsGradlePluginVersion=6.1.2
grailsHibernatePluginVersion=8.1.0
groovyVersion=3.0.11
gormVersion=8.0.0
gormVersion=8.1.0
logback.version=1.2.7
hazelcast.version=5.3.6

org.gradle.daemon=true
org.gradle.parallel=true
Expand Down
17 changes: 13 additions & 4 deletions grails-app/controllers/io/xh/hoist/BaseController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package io.xh.hoist
import grails.async.Promise
import grails.async.web.WebPromises
import groovy.transform.CompileStatic
import io.xh.hoist.exception.ExceptionRenderer
import io.xh.hoist.exception.ExceptionHandler
import io.xh.hoist.json.JSONParser
import io.xh.hoist.json.JSONSerializer
import io.xh.hoist.log.LogSupport
Expand All @@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory
abstract class BaseController implements LogSupport, IdentitySupport {

IdentityService identityService
ExceptionRenderer exceptionRenderer
ExceptionHandler xhExceptionHandler

/**
* Render an object to JSON.
Expand Down Expand Up @@ -82,7 +82,7 @@ abstract class BaseController implements LogSupport, IdentitySupport {
WebPromises.task {
c.call()
}.onError { Throwable t ->
exceptionRenderer.handleException(t, request, response, this)
handleUncaughtInternal(t)
}
}

Expand All @@ -95,7 +95,16 @@ abstract class BaseController implements LogSupport, IdentitySupport {
// Implementation
//-------------------
void handleException(Exception ex) {
exceptionRenderer.handleException(ex, request, response, this)
handleUncaughtInternal(ex)
}

private void handleUncaughtInternal(Throwable t) {
xhExceptionHandler.handleException(
exception: t,
logTo: this,
logMessage: [_action: actionName],
renderTo: response
)
}

// Provide cached logger to LogSupport for possible performance benefit
Expand Down

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions grails-app/controllers/io/xh/hoist/admin/EnvAdminController.groovy

This file was deleted.

Loading
Loading