opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironment.java
@@ -531,7 +531,7 @@ { // Only the last sent offline CSN is kept writer.write(offlineCSN.toString()); StaticUtils.close(writer); writer.close(); changelogState.addOfflineReplica(domainDN, offlineCSN); commitFile(offlineFile); } @@ -669,11 +669,18 @@ { state.addServerIdToDomain(toServerId(serverIdPath.getName()), domainDN); final File offlineFile = new File(serverIdPath, REPLICA_OFFLINE_STATE_FILENAME); if (offlineFile.exists()) try { final CSN offlineCSN = readOfflineStateFile(offlineFile, domainDN); state.addOfflineReplica(domainDN, offlineCSN); final File offlineFile = new File(serverIdPath, REPLICA_OFFLINE_STATE_FILENAME); if (offlineFile.exists()) { final CSN offlineCSN = readOfflineStateFile(offlineFile, domainDN); state.addOfflineReplica(domainDN, offlineCSN); } } catch(ChangelogException ce) { logger.warn(getExceptionMessage(ce)); } } opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironmentTest.java
@@ -172,7 +172,7 @@ } } @Test(expectedExceptions=ChangelogException.class) @Test public void testReadChangelogStateWithReplicaOfflineStateFileCorrupted() throws Exception { Log<Long,ChangeNumberIndexRecord> cnDB = null; @@ -188,7 +188,10 @@ File offlineStateFile = new File(environment.getServerIdPath("1", 1), REPLICA_OFFLINE_STATE_FILENAME); offlineStateFile.createNewFile(); environment.readOnDiskChangelogState(); // If the offline state file is not readable, the best we can do is continue as if the file wasn't there at all final ChangelogState state = environment.readOnDiskChangelogState(); assertThat(state.getOfflineReplicas()).isEmpty(); assertThat(state.isEqualTo(environment.getChangelogState())).isTrue(); } finally {