Chapter 47. Conflict Manager Usage
47.1. Find and Resolve Cache Conflicts Copy linkLink copied to clipboard!
The Conflict Manager is often used with Partition Handling. A split-brain occurs when nodes in a cluster are separated into two or more groups (partitions) that can’t communicate with each other. In some split-brain situations, nodes can have different data written to them. In this case, JBoss Data Grid’s Partition Handling, combined with its Conflict Manager, can be used to automatically resolve differences in the same CacheEntries
across nodes. The Conflict Manager can also be used to manually search for and resolve conflicts.
The code below shows how to retrieve an EmbeddedCacheManager
’s ConflictManager
, how to retrieve all versions of a given key, and how to check for conflicts across a given cache.
Although the ConflictManager::getConflicts
stream is processed per entry, the underlying spliterator is in fact lazily-loading cache entries on a per segment basis.