Skip to content
Josef Cacek edited this page Dec 22, 2019 · 46 revisions

Hazelcast 4.0 changes

Changes introduced in 4.0 with links to their pull requests.

Client protocol

Client protocol version 2

Client protocol robustness

Introduce the message size limit for unauthenticated connections.

Distribution

Javadoc JAR for hazelcast-enterprise-all (EE)

A Javadoc JAR is available also for the hazelcast-enterprise-all artifact.

Merged client and core modules

Client module is removed. Classes are moved to core module. hazelcast-client.jar will not be created anymore.

Hot Restart

Hot Restart encryption at rest (EE)

Hot Restart data stored on disk may contain sensitive information. This feature introduces an option to use symmetric encryption on the Hot Restart data file level.

CP subsystem

CP Subsystem Unsafe Mode

Currently to use the CP subsystem, at least 3 nodes are required. But this requirement makes it difficult to test and develop applications. Also, some users do not need the safety guarantees of a CP system but just need the functionality of data structures exposed by CP subsystem with one or two nodes. With Hazelcast 4.0, we allow access to CP data structures even with a single node without providing strong safety guarantees. This mode is called the “unsafe” mode and it replaces concurrent data structures previously deprecated in Hazelcast 3.12 (ILock, IdGenerator, IAtomicLong, IAtomicReference, ICountDownLatch, ISemaphore).

CP Subsystem Persistence (EE)

CP Subsystem Persistence enables CP members persist their local state to stable storage. This capability significantly improves the overall reliability of CP Subsystem by recovering from member and cluster crash scenarios, without sacrificing safety guarantees. Our entire CP subsystem implementation, including the CP subsystem persistence feature, is fully covered by the Jepsen testing framework.

REST API

Added support for updating the license (EE)

Introduced a REST API endpoint that makes it possible to update the license on a running cluster.

JSON support for REST

You can now more naturally access HazelcastJsonValue instances stored in your map via the REST API. The response will be a UTF8 encoded JSON values with the Content-Type header set to application/json.

Query

Predicate API cleanup

The Predicate API has been cleaned up to eliminate exposing internal interfaces and classes.

Security

Typed security configuration

Topics:
  • replace <group> configuration by simple <cluster-name>

  • introduce the concept of security realms

  • add typed authentication and identity configuration (e.g. <ldap> authentication, <token> identity)

  • use similar identity configuration in client config

LDAP-based authentication (EE)

Two new JAAS login modules are introduced to authenticate against LDAP servers.

X.509-based authentication (EE)

Summary:
  • Make TLS peer certificate chain available for later reuse;

  • Provide JAAS Callback to retrieve the peer’s TLS certificate chain in login modules;

  • Provide out-of-the-box login module which can parse Principal names from attribute(s) in the client certificates

Clean-up JAAS authentication (EE)

Topics:
  • follow JAAS best practices;

  • avoid automatic deserialization of custom credentials in the client protocol

  • introduce a concept of security roles to distinguish between (a single) connecting side identity and its privileges;

  • use Credentials object only for authentication to prevent secrets leaks;

  • cleanup Credentials interface;

TLS hostname validation

Host identity validation can be enabled for TLS connections. New true/false property validateIdentity is supported in Hazelcast-provided TLS factories - JSSE and OpenSSL/BoringSSL. Default value is false.

Once enabled it configures newly created SSLEngine instances to do host identity validation on client-side of TLS connections. Only certificates with matching SAN (Subject Alternative Name) entries for given hostname or IP address are allowed.

The algorithm used for matching endpoint identity is the HTTP one described in RFC-2818 section 3

HTTPs for Hazelcast bash scripts

We added HTTPs support to cluster.sh, healthcheck.sh and cp-subsystem.sh management scripts.

WAN replication

Cleanup WAN publisher SPI

In 3.x, the WAN publisher SPI allows the user to plug into the lifecycle of a map/cache entry and replicate the updates to another system. For example, we have an integration with the Solace message broker (https://github.com/hazelcast/hazelcast-solace). A user might implement replication to Kafka or some JMS queue or even write out map and cache event changes to a log on disk. The issues with the previous SPI were:

  • multiple interfaces to implement

  • leaking internals in public SPI

  • different interfaces for WAN replication events, depending on OS or EE

  • unused methods

  • private classes exposed in public package

The goal is to clean up and simplify the SPI that needs to be implemented by the user.

WAN protocol (EE)

Currently, there is no way of evolving WAN as there is no cluster information/metadata sent between the source and target cluster. This makes it very hard to implement new features on top of WAN or optimise the format of the data sent from the source to the target cluster. Because of this, we need to introduce a protocol with which the clusters can negotiate the set of supported features and the version of the protocol supported by the target cluster. After an initial connection is established, ideally the protocol should:

  • send cluster information from the source to the target cluster

  • the target cluster should respond by sending its cluster information

  • this negotiation needs to be done periodically since both the source and target cluster version and capabilities may change over time (rolling upgrades)

  • both the source and the target cluster may contain multiple implementations of different versions of the WAN protocol, allowing us to keep indefinite backward compatibility

WAN configuration

Configuring WAN can be a bit difficult.

  • the user needs to list the fully qualified class name of the WAN implementation that should be used. In most cases, this is our internal implementation and will always be the same

  • there are various configuration options, some of which are present as java class instance fields or XML nodes and attributes with javaDoc, others are present in a properties list where the user needs to correctly copy the property name without any IDE help. If there is an error in the property name, it will not be detected

  • if the user wants to use a custom WAN publisher SPI implementation, some configuration options don’t make sense as they are tied to our implementation (e.g. WAN queue size) it is quite verbose

The goal is trying to address the issues above by providing both simple and safe ways of configuring WAN, when our built-in implementation and when using a custom implementation. This change deals solely with simplifying WAN replication configuration and making it more natural and easier to use. There is no new functionality provided to the user.

Tracking of WAN Sync Events (EE)

We have introduced better tracking of the state and the progress of WAN synchronization requests. This is most visible when using the Management Center to trigger and track the progress of the WAN synchronization. Now, you can even see the results for previous WAN synchronization requests or even for overlapping synchronization requests.

Migration from ICompletableFuture to CompletionStage

In Hazelcast 3.x series, com.hazelcast.core.ICompletableFuture was introduced to enable reactive programming style. ICompletableFuture was intended as a temporary, JDK 6 compatible replacement for java.util.concurrent.CompletableFuture that was introduced in Java 8. Since Hazelcast 4.0 requires Java 8, ICompletableFuture is now removed. Async Hazelcast API methods return java.util.concurrent.CompletionStage which allows for chaining of further computation stages. Using CompletionStage.toCompletableFuture() allows interoperability with other frameworks that use CompletableFuture.

Non-volatile Persistent Memory support (EE)

The goal is to support non-volatile persistent memory for data structures like IMap, ICache and NearCache. With minimum configuration changes and no application code changes customers would be able to use Intel Optane DC memory as off-heap HD memory. There is no need to install any third-party libraries to use Intel Optane DC, all necessary libraries are delivered with Hazelcast 4.0 distribution.

Serialization Enhancements

  • #15238 Support 4-byte UTF-8 serialization.

  • #15371 Added built-in support for various Java collection types. These types are: Added the following Java default serializers.

    1. ArrayDeque

    2. HashSet

    3. TreeSet

    4. TreeMap

    5. LinkedHashSet

    6. LinkedHashMap

    7. LinkedBlockingQueue

    8. ArrayBlockingQueue

    9. PriorityBlockingQueue

    10. DelayQueue

    11. SynchronousQueue

    12. LinkedBlockingDeque

    13. LinkedTransferQueue

    14. CopyOnWriteArrayList

    15. CopyOnWriteArraySet

    16. ConcurrentSkipListSet

    17. ConcurrentHashMap

    18. ConcurrentSkipListMap

* #15291, #15473, #3122 Added UUID support in serialization.

Removed Legacy Merge Policies

We’ve removed the merge policies specific to each data structure. Now you can use the generic merge policies introduced in 3.10. For further info please see Removal of Legacy Merge Policies section of migration guide.

Renamed group-name as cluster-name

#15540, EE#3157 The configuration element group-name is renamed into cluster-name. GroupConfig class is removed.

Renamed Quorum as SplitBrainProtection

#15444, EE#3117 The Quorum interface and the corresponding configuration are renamed into SplitBrainProtection.

MapLoader with Custom TTL

We’ve added the capability to load and store expiration times when loading and storing entries using MapLoader and MapStore. Existing MapLoader and MapStore implementations should continue to work normally but if you need to handle expiration times, you can implement the new EntryLoader and EntryStore interfaces.

Hazelcast Instances: Using Moby naming

When starting Hazelcast members, each instance would get assigned a generated instance name. Different members are similarly named and when monitoring a cluster through the Management center it can get difficult to distinguish between different members. We now provide more human-readable (and fun!) names using Moby naming - names such as hopeful_turing, jovial_chatelet or brave_driscoll. Since the instance name will be new after restart it will be easier to track member restarts in logs.

User Defined Services SPI removal

We’ve removed support for adding user-defined services. The reason was that this SPI was not clearly defined and backwards-compatiblity was broken in some occasions due to the fact that the SPI was too complex. This gives us more freedom when evolving Hazelcast and it also gives us an opportunity to provide a new SPI in the future, should there be enough interest. We will still keep the same classes (and we will use them internally) but we will not provide any compatibility guarantees.

Refactoring of Migration Listener

We’ve redesigned the MigrationListener API to be more intuitive. Previously, on each migration a pair of migration started and migration completed or failed events were fired but this level of detail is not relevant to most users. Now, we send events when the overall migration process starts, when each partition is migrated and when the overall migration process completes. On each step, you can see how many migrations are planned, how many have completed, how much time has elapsed etc.

Client backup acknowledgment improvements

We’ve improved the performance of client operations involving sync backups by decreasing the number of network hops needed to complete the operation. This feature does not change any safety guarantees involving usage of client and is turned on by default.

Removal of Deprecated Classes

There were a number of deprecated and outdated public API and SPI classes which were kept only for backward compatibility. Some of them are no longer used in Hazelcast itself, while others have a better alternative. We’ve now removed those classes.

Concurrency API Clean-up

We’ve replaced the concurrency API implementations with the “unsafe” mode of CP subsystem.

Removal of MapReduce

We’ve removed map reduce. For a more complete, versatile and powerful alternative, please take a look at Hazelcast Jet or the Aggregations that uses the Query infrastructure.

Package Cleanup

We clearly separated lots of private API classes from public packages. Private API should now be located in packages containing “internal” or “impl”.

IdentifiedDataSerializable.getId rename

We’ve renamed getId() to getClassId in IdentifiedDataSerializable. The getId() method of the IdentifiedDataSerializable interface is a method with a common name, meaning a naming conflict would happen frequently. For example, database entities also have a getId() method.

Optimize HZ for Single Threaded Situation

Hazelcast clients have been designed to be used by multiple threads; the more threads you throw at it, the better the performance (until it is saturated). This effort improves the situation for single-threaded usage.

TLS OpenSSL + increased IO threads by default

If the system detects that OpenSSL is available, then it will be enabled by default unless something has been configured otherwise. By default we increase the IO threadcount to processor_count/2 so we’ll get as many IO threads as there are processors (internally we multiply by 2 because we have input threads and output threads). SSL encryption and decryption is very CPU intensive and the default of 6/8 IO threads isn’t sufficient in case of key/value based usages. This PR changes that so we apply our recommendation as an out of the box setting. If for whatever reason this gives a performance regression, then use the following system property to revert to the defaults: -Dhazelcast.io.thread.count=3 when less than 20 processors -Dhazelcast.io.thread.count=4 when equal or more than 20 processors.

Transaction Commit Fails on WriteBehindQueue Exception

Prevents transactional maps inconsistent behavior when WBQ back pressure is enabled.

Smart client default IO threadcount increase

IO Optimization - NioThread pipeline scheduling

Member default IO threadcount increase >= 20 cores

Client Architectural Improvements

Ownerless Client

Previously, the clients had an owner member responsible for cleaning up their resources after they leave the cluster. Also, the ownership information was needed to be replicated to the whole cluster when a client joins the cluster. This mechanism have been made simpler by introducing the following system properties to control the lifecycle of the clients on the member side:

  • hazelcast.client.cleanup.period.millis

  • hazelcast.client.cleanup.timeout.millis

Dynamic metrics collection

Previously, Hazelcast metrics were reported programmatically to the Hazelcast Management Center, one by one. Introducing new metrics required changes both in IMDG and in MC, which limited the number of metrics sent to MC. In 4.0 this has been changed to collecting and reporting all available metrics dynamically just by declaring them in IMDG. Besides reporting the metrics dynamically to MC exposing them on JMX is done dynamically as well. Both reporting to MC and exposing on JMX are toggleable by using the metric configuration element introduced in 4.0.

Clone this wiki locally