Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Rebalance procedure optimizations

Possible partition file sending approaches

Hot swap cache data storage 


Preload entries from loaded partition file


Proposed Changes (hot swap approach)

The Apache Ignite can support cache rebalancing as transferring partition files using zero copy algorithm [1] based on an extension of communication SPI and Java NIO API.

...

  • We must stop updating indexes on demander when the data is ready to be transferred from the supplier node. All async cache updates on demander must not cause the index update;
  • The previous partition metadata page and all stored meta information must be destroyed in memory and restored from the new partition file;

Working diagram

Rebuild indexes

The node is ready to become partition owner when partition data is rebalanced and cache indexes are ready. For the message-based cluster rebalancing approach indexes are rebuilding simultaneously with cache data loading. For the file-based rebalancing approach, the index rebuild procedure must be run before the partition state is set to the OWNING state. 

...

  • Start the checkpoint process when the temporary WAL becomes empty;
  • Wait for the first checkpoint ends and set OWNING status to partition;

Recovery from different stages:

  • Supplier crashes when sending partition
  • Demander crashes when receiving partition
  • Demander crashes when applying temp WAL

Phase-2

The SSL must be disabled to take an advantage of Java NIO zero-copy file transmission using FileChannel#transferTo method. If we need to use SSL the file must be splitted on chunks the same way to send them over the socket channel with ByteBuffer. As the SSL engine generally needs a direct ByteBuffer to do encryption we can't avoid copying buffer payload from the kernel level to the application level

...