-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] IndexShardTests.testConcurrentTermIncreaseOnReplicaShard failed on 6.4 #34862
Comments
Pinging @elastic/es-distributed |
I looked into this some more. I'm not sure the
The failing assertion is here: elasticsearch/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java Line 1000 in 5d0699b
This might mean that the race fixed in #32442 is still present, or may be something else? @ywelsch do you have any thoughts? Also I think we should release that |
I added some more logging and left this test (in
Extra logging: diff --git a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
index 487ac7e..3ad2471 100644
--- a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
+++ b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
@@ -125,6 +125,7 @@ import org.elasticsearch.test.FieldMaskingReader;
import org.elasticsearch.test.VersionUtils;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.ElasticsearchException;
+import org.elasticsearch.test.junit.annotations.TestLogging;
import java.io.IOException;
import java.nio.charset.Charset;
@@ -1025,6 +1026,7 @@ public class IndexShardTests extends IndexShardTestCase {
closeShard(indexShard, false);
}
+ @TestLogging("org.elasticsearch.index.shard:TRACE,org.elasticsearch.index.seqno:TRACE")
public void testConcurrentTermIncreaseOnReplicaShard() throws BrokenBarrierException, InterruptedException, IOException {
final IndexShard indexShard = newStartedShard(false);
@@ -1049,10 +1051,18 @@ public class IndexShardTests extends IndexShardTestCase {
new ActionListener<Releasable>() {
@Override
public void onResponse(Releasable releasable) {
- counter.incrementAndGet();
- assertThat(indexShard.getPendingPrimaryTerm(), equalTo(primaryTerm + increment));
- latch.countDown();
- releasable.close();
+ logger.info("obtained replica operation permit for increment={}", increment);
+ try {
+ counter.incrementAndGet();
+ assertThat(indexShard.getPendingPrimaryTerm(), equalTo(primaryTerm + increment));
+ logger.info("passed term check for increment={}", increment);
+ } finally {
+ logger.info("counting down for increment={}", increment);
+ latch.countDown();
+ logger.info("releasing replica operation permit for increment={}", increment);
+ releasable.close();
+ logger.info("released replica operation permit for increment={}", increment);
+ }
}
@Override
@@ -1062,6 +1072,7 @@ public class IndexShardTests extends IndexShardTestCase {
}
},
ThreadPool.Names.WRITE, "");
+ logger.info("launched wait for increment={}", increment);
};
final long firstIncrement = 1 + (randomBoolean() ? 0 : 1);
@@ -1069,6 +1080,8 @@ public class IndexShardTests extends IndexShardTestCase {
final Thread first = new Thread(function.apply(firstIncrement));
final Thread second = new Thread(function.apply(secondIncrement));
+ logger.info("firstIncrement={}, secondIncrement={}, primaryTerm={}", firstIncrement, secondIncrement, primaryTerm);
+
first.start();
second.start(); The log from this run is:
NB the first check is the one that fails (lack of |
The test
IndexShardTests.testConcurrentTermIncreaseOnReplicaShard
failed today on the 6.4 branch:https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+6.4+release-tests/25
with the error:
The test execution log is:
consoleText.txt
I can/can't reproduce the error using:
The text was updated successfully, but these errors were encountered: