private void doTtlUpdateTgtDupTest() throws Exception {
    // second segment only (close/crash in the middle)
    createStateWithPutTtlUpdateAndDelete();
    state.advanceTime(TimeUnit.SECONDS.toMillis(1));
    List<LogSegmentName> segmentsUnderCompaction = getLogSegments(1, 1);
    Map<LogSegmentName, Long> oldSegmentNamesAndEndOffsets = getEndOffsets(segmentsUnderCompaction);
    DiskIOScheduler diskIOScheduler;
    if (throwExceptionInsteadOfClose) {
      diskIOScheduler = new InterruptionInducingDiskIOScheduler(2, Integer.MAX_VALUE);
    } else {
      diskIOScheduler = new InterruptionInducingDiskIOScheduler(Integer.MAX_VALUE, 2 * TTL_UPDATE_RECORD_SIZE);
    }
    compactWithRecoveryAndVerify(state.log, diskIOScheduler, state.index, segmentsUnderCompaction,
        state.time.milliseconds(), false, true);
    verifyNoChangeInEndOffsets(oldSegmentNamesAndEndOffsets);
  }
Tests the case where close/crash creates a situation where duplicates will be detected during the search for copy
candidates in the tgtIndex
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java