Persistent store enables users to store data of their caches in a durable fashion on disk still benefiting from in-memory nature of Apache Ignite. Data of caches is stored in files created for every primary or backup partition assigned to that node and in an additional file for all user indexes.
Files in filesystem are allocated lazily (only if some data is actually stored to particular partition) and grow automatically when more data is added to the cache. But the problem is that files cannot shrink even if all data is removed.
This umbrella ticket covers all other tasks needed to implement simple yet effective approach to defragmentation. Detailed discussion could be found in IEP-47 and in corresponding dev-list discussion but core ideas are as follows:
- Defragmentation is performed in a special maintenance mode when node starts, provides access to some APIs like metrics or JMX management but doesn't join the cluster.
- It is performed by copying all data from all partitions on node to new files with automatic compaction. After successful copy old partition files are deleted.
- Metrics on progress of the operation are provided to the user.
- Operation is fault-tolerant and in case of node failure proceeds after node restart.