Skip to content

Commit

Permalink
Optimize part 2
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Singh <ssashish@amazon.com>
  • Loading branch information
ashking94 committed Sep 14, 2023
1 parent f6b19ab commit 0a29b38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ private boolean performUpload(Long primaryTerm, Long generation) throws IOExcept
} else {
generationToUpload = generation;
}
if (generationToUpload <= maxRemoteTranslogGenerationUploaded) {
return false;
}
return upload(primaryTerm, generationToUpload);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public TranslogCheckpointTransferSnapshot build() throws IOException {
}
translogTransferSnapshot.setMinTranslogGeneration(highestGenMinTranslogGeneration);

assert this.primaryTerm == highestGenPrimaryTerm : "inconsistent primary term";
// assert this.primaryTerm == highestGenPrimaryTerm : "inconsistent primary term";
// assert this.generation == highestGeneration : " inconsistent generation "
// + " suppliedGeneration="
// + this.generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ public void testFullRangeSnapshotWithFailures() throws Exception {
public void testConcurrentWritesWithVaryingSize() throws Throwable {
final int opsPerThread = randomIntBetween(10, 200);
int threadCount = 2 + randomInt(5);
logger.info("ops={} thread={}", opsPerThread, threadCount);

logger.info("testing with [{}] threads, each doing [{}] ops", threadCount, opsPerThread);
final BlockingQueue<TestTranslog.LocationOperation> writtenOperations = new ArrayBlockingQueue<>(threadCount * opsPerThread);
Expand Down Expand Up @@ -795,7 +796,7 @@ public void testConcurrentWritesWithVaryingSize() throws Throwable {
if (threadExceptions[i] != null) {
throw threadExceptions[i];
}
threads[i].join(60 * 1000);
threads[i].join(120 * 1000);
}

List<TestTranslog.LocationOperation> collect = new ArrayList<>(writtenOperations);
Expand Down

0 comments on commit 0a29b38

Please sign in to comment.