Skip to content

Commit

Permalink
Log more data for PrevalidateShardPathIT#testCheckShards (elastic#109887
Browse files Browse the repository at this point in the history
)

`PrevalidateShardPathIT#testCheckShards` still keeps failing on CI, so we need more logging.

* Add debug logging for `MasterService` events to verify that a cluster service update is triggered.
* Log explanation for stuck shards regardless whether they are located on node_2 in the cluster state.

See elastic#104807
  • Loading branch information
arteam authored Jun 19, 2024
1 parent b65e02c commit 0145a41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ tests:
- class: "org.elasticsearch.xpack.shutdown.NodeShutdownReadinessIT"
issue: "https://github.com/elastic/elasticsearch/issues/109838"
method: "testShutdownReadinessService"
- class: "org.elasticsearch.cluster.PrevalidateShardPathIT"
issue: "https://github.com/elastic/elasticsearch/issues/104807"
method: "testCheckShards"
- class: "org.elasticsearch.packaging.test.RpmPreservationTests"
issue: "https://github.com/elastic/elasticsearch/issues/109898"
method: "test30PreserveConfig"
Expand All @@ -82,6 +79,7 @@ tests:
issue: "https://github.com/elastic/elasticsearch/issues/109915"
method: "testRandomMultiValuesTopN"


# Examples:
#
# Mute a single test case in a YAML test suite:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.elasticsearch.common.xcontent.ChunkedToXContent;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.junit.annotations.TestLogging;

import java.util.HashSet;
import java.util.List;
Expand All @@ -39,6 +40,10 @@
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0)
public class PrevalidateShardPathIT extends ESIntegTestCase {

@TestLogging(
value = "org.elasticsearch.cluster.service.MasterService:DEBUG",
reason = "https://github.com/elastic/elasticsearch/issues/104807"
)
public void testCheckShards() throws Exception {
internalCluster().startMasterOnlyNode();
String node1 = internalCluster().startDataOnlyNode();
Expand Down Expand Up @@ -95,7 +100,6 @@ public void testCheckShards() throws Exception {
.allShards()
.filter(s -> s.getIndexName().equals(indexName))
.filter(s -> node2ShardIds.contains(s.shardId()))
.filter(s -> s.currentNodeId().equals(node2Id))
.toList();
logger.info("Found {} shards on the relocation source node {} in the cluster state", node2Shards, node2Id);
for (var node2Shard : node2Shards) {
Expand Down

0 comments on commit 0145a41

Please sign in to comment.