[infinispan-issues] [JBoss JIRA] (ISPN-11802) Create SPI for Cross-Site Replication conflict resolution

Pedro Ruivo (Jira) issues at jboss.org
Fri May 8 05:25:00 EDT 2020


Pedro Ruivo created ISPN-11802:
----------------------------------

             Summary: Create SPI for Cross-Site Replication conflict resolution
                 Key: ISPN-11802
                 URL: https://issues.redhat.com/browse/ISPN-11802
             Project: Infinispan
          Issue Type: Enhancement
          Components: Core, Cross-Site Replication
            Reporter: Pedro Ruivo
            Assignee: Pedro Ruivo


A conflict happens if 2 sites try to update the same key (put/remove) concurrently. 

With async Cross-Site Replication (aka IRAC) when a conflict is detected, we use the site name to pick the winning update.

h2.  Interface

{code:java}

interface ABC<V> { // or concrete class
  String site(); //the site name which wrote this value
  V value(); // the value. can be null if the key was removed
  Metadata metadata(); //can be null
}

interface Resolve<K, V> {
  ABC<V> resolve(K key, ABC<V> entry1, ABC<V> entry2);
}
{code}

h2. Configuration

Set the class name to use. Can be a {{Class}} object (as shown above) or a {{String}} with the class name.
For server mode, you need to add your jar with the classes required to {{server/lib}}.
The configuration fails to validate if the conflict resolution class is set with {{SYNC}} strategy.

{code:java}
ConfigurationBuilder.sites().addBackup()
   .site("S")
  .strategy(BackupConfiguration.BackupStrategy.ASYNC)
  .conflictResolution(MyResover.class);
{code}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the infinispan-issues mailing list