Skip to content

Commit

Permalink
Fix testResyncAfterPrimaryPromotion (#52615)
Browse files Browse the repository at this point in the history
Adjusts the assertion as we might eagerly clean up translog during resync since #52556

Relates #52556
Closes #52598
  • Loading branch information
dnhatn authored Feb 21, 2020
1 parent 54fe26e commit 9890589
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import java.util.stream.Collectors;

import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.either;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.everyItem;
Expand Down Expand Up @@ -309,9 +310,7 @@ public void testReplicaRollbackStaleDocumentsInPeerRecovery() throws Exception {
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/52598")
public void testResyncAfterPrimaryPromotion() throws Exception {
// TODO: check translog trimming functionality once rollback is implemented in Lucene (ES trimming is done)
String mappings = "{ \"_doc\": { \"properties\": { \"f\": { \"type\": \"keyword\"} }}}";
try (ReplicationGroup shards = new ReplicationGroup(buildIndexMetaData(2, mappings))) {
shards.startAll();
Expand Down Expand Up @@ -378,7 +377,7 @@ public void testResyncAfterPrimaryPromotion() throws Exception {
assertThat(source.source.utf8ToString(), is("{ \"f\": \"normal\"}"));
}
}
assertThat(translogOperations, is(initialDocs + extraDocs));
assertThat(translogOperations, either(equalTo(initialDocs + extraDocs)).or(equalTo(task.getResyncedOperations())));
}
}

Expand Down

0 comments on commit 9890589

Please sign in to comment.