NOTE: This feature is still in progress and will be fully available with the final release of Hazelcast 3.6.
NOTE: This feature is supported for Hazelcast Enterprise 3.6 or higher.
This chapter explains the Hazelcast's Hot Restart Store feature which provides fast cluster restarts by storing the states of the cluster members into the disk. This feature is currently provided for Hazelcast map data structure and Hazelcast JCache implementation.
Hot Restart Store enables you to get your cluster up and running swiftly after a cluster restart that can be caused by a planned shutdown (including rolling upgrades) or a sudden cluster-wide crash (e.g. power outage).
Hot Restart feature is supported for the following restart types:
You can configure Hot Restart programmatically or declaratively. There are two configuration elements: one of them is used to enable/disable the feature and the other one is to specify the directory where the Hot Restart data will be stored.
The following are example configurations for a Hazelcast map and JCache implementation.
Declarative Configuration:
An example configuration is shown below.
<hazelcast>
...
<hot-restart>
<home-dir>hot-restart</home-dir>
</hot-restart>
...
<map>
<hot-restart-enabled>true</hot-restart-enabled>
</map>
...
<cache>
<hot-restart-enabled>true</hot-restart-enabled>
</cache>
...
</hazelcast>
Programmatic Configuration:
The programmatic equivalent of the above declarative configuration is shown below.
???
The following are the descriptions of configuration elements:
hot-restart
: The configuration that includes the element home-dir
used to specify the directory where Hot Restart data will be stored. Its default value is hot-restart
and it is mandatory to give a value. You can use the default one or specify another directory.hot-restart-enabled
: The configuration that is used to enable or disable the Hot Restart feature. This element can be used for the supported data structures (in the above examples, you can see that it is used for map
and cache
).Hazelcast relies on the IP address-port pair as a unique identifier of a cluster member. The member must restart with these settings the same as before shutdown. Otherwise, Hot Restart fails.
Hazelcast's Hot Restart Store uses the log-structured storage approach. The following is a top-level design description:
This kind of design focuses almost all of the system's complexity into the garbage collection (GC) process, stripping down the client's operation to the bare necessity of guaranteeing persistent behavior: a simple file append operation. Consequently, the latency of operations is close to the theoretical minimum in almost all cases. Complications arise only during the prolonged periods of maximum load, and this is where the details of the GC process begin to matter.
In order to maintain the lowest possible footprint in the update operation latency, the following properties are built into the garbage collection process:
The I/O minimization scheme was taken from the seminal Sprite LFS paper, Rosenblum, Ousterhout, The Design and Implementation of a Log-Structured File System. The following is the outline:
The Cost-Benefit factor of a chunk consists of two components multiplied together:
The essence is in the second component: given equal amount of garbage in all chunks, it will make the young ones less attractive to the Collector. Assuming the generational garbage hypothesis, this will allow the young chunks to quickly accumulate more garbage.
Sorting records by age will group young records together in a single chunk and will do the same for older records. Therefore the chunks will either tend to keep their data live for a longer time, or quickly become full of garbage.