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

pgamba
17.47.2009 9b581fcaa5c5cab99677a3fd043c62260f4dfa7c

The changes contained in the RS have been sent by the DS that connected to it when this DS compared its own state with the state of the RS, and decided to update it with its
missing changes contained in the ds-sync-hist attribute of the changed entries.

As described at
https://www.opends.org/wiki/page/EffectsOfReplicationServerCrashes
the case where a DS updates an empty RS is not a realistic case because it is valid only in a corner case .. and could lead to an update of a massive unexpected number of
changes sent to the RS in all other cases.

So the fix here consists in testing in the DS that the RS is not empty before deciding to send the missing changes.

1 files modified
12 ■■■■ changed files
opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java 12 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -4192,10 +4192,15 @@
      ChangeNumber replServerMaxChangeNumber =
        replicationServerState.getMaxChangeNumber(serverId);
      if (replServerMaxChangeNumber == null)
      // we don't want to update from here (a DS) an empty RS because
      // normally the RS should have been updated by other RSes except for
      // very last changes lost if the local connection was broken
      // ... hence the RS we are connected to should not be empty
      // ... or if it is empty, it is due to a volontary reset
      // and we don't want to update it with our changes that could be huge.
      if ((replServerMaxChangeNumber != null) &&
          (replServerMaxChangeNumber.getSeqnum()!=0))
      {
        replServerMaxChangeNumber = new ChangeNumber(0, 0, serverId);
      }
      ChangeNumber ourMaxChangeNumber =
        state.getMaxChangeNumber(serverId);
@@ -4271,6 +4276,7 @@
        }
        replayOperations.clear();
      }
      }
    } catch (Exception e)
    {
      Message message = ERR_PUBLISHING_FAKE_OPS.get(