mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
22.34.2015 0d7fc71e0fea34464e0c47e6c3b8deaed08382c7
AttrHistoricalMultiple.java:
In replayOperation(), reverted the if statement + extracted method replayPotentialConflictModification()
Used CSNisNewerThanOrEqualTo() rather than the raw CSN.compare().
1 files modified
20 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalMultiple.java 20 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalMultiple.java
@@ -228,15 +228,23 @@
  public boolean replayOperation(Iterator<Modification> modsIterator, CSN csn,
      Entry modifiedEntry, Modification m)
  {
    if (csn.isNewerThanOrEqualTo(getLastUpdateTime())
        && m.getModificationType() == ModificationType.REPLACE)
    {
      processLocalOrNonConflictModification(csn, m);
      return false;// the attribute was not modified more recently
    }
    // We are replaying an operation that was already done
    // on another master server and this operation has a potential
    // conflict with some more recent operations on this same entry
    // we need to take the more complex path to solve them
    if (CSN.compare(csn, getLastUpdateTime()) < 0 ||
        m.getModificationType() != ModificationType.REPLACE)
    return replayPotentialConflictModification(modsIterator, csn, modifiedEntry, m);
  }
  private boolean replayPotentialConflictModification(Iterator<Modification> modsIterator, CSN csn,
      Entry modifiedEntry, Modification m)
    {
      // the attribute was modified after this change -> conflict
      switch (m.getModificationType().asEnum())
      {
      case DELETE:
@@ -308,12 +316,6 @@
        return false;
      }
    }
    else
    {
      processLocalOrNonConflictModification(csn, m);
      return false;// the attribute was not modified more recently
    }
  }
  @Override
  public void processLocalOrNonConflictModification(CSN csn, Modification mod)