Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-11802

Create SPI for Cross-Site Replication conflict resolution

    XMLWordPrintable

Details

    Description

      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.

      Interface

      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);
      }
      

      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.

      ConfigurationBuilder.sites().addBackup()
         .site("S")
        .strategy(BackupConfiguration.BackupStrategy.ASYNC)
        .conflictResolution(MyResover.class);
      

      Attachments

        Activity

          People

            pruivo@redhat.com Pedro Ruivo
            pruivo@redhat.com Pedro Ruivo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: