Skip to content

Commit

Permalink
Removing unnecessary diffs
Browse files Browse the repository at this point in the history
Signed-off-by: Dharmesh 💤 <sdharms@amazon.com>
  • Loading branch information
psychbot authored and Sachin Kale committed Sep 1, 2023
1 parent 3262e78 commit 98322fa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public class RemoteStoreBaseIntegTestCase extends OpenSearchIntegTestCase {

protected Path segmentRepoPath;
protected Path translogRepoPath;
protected Settings nodeAttributesSettings;
private final List<String> documentKeys = List.of(
randomAlphaOfLength(5),
randomAlphaOfLength(5),
Expand Down Expand Up @@ -112,15 +111,13 @@ protected boolean addMockInternalEngine() {

@Override
protected Settings nodeSettings(int nodeOrdinal) {
Settings nodeAttributes = Settings.EMPTY;
if (segmentRepoPath == null || translogRepoPath == null) {
segmentRepoPath = randomRepoPath().toAbsolutePath();
translogRepoPath = randomRepoPath().toAbsolutePath();
}
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(remoteStoreClusterSettings(REPOSITORY_NAME, segmentRepoPath, REPOSITORY_2_NAME, translogRepoPath))
.put(nodeAttributes)
.build();
}

Expand Down Expand Up @@ -253,8 +250,7 @@ protected Settings remoteStoreIndexSettings(int numberOfReplicas, long totalFiel
}

@After
public void teardown() throws Exception {
nodeAttributesSettings = null;
public void teardown() {
assertAcked(clusterAdmin().prepareDeleteRepository(REPOSITORY_NAME));
assertAcked(clusterAdmin().prepareDeleteRepository(REPOSITORY_2_NAME));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void verifyRestoredData(Map<String, Long> indexStats, long deletedDocs)

private void testRestoreWithMergeFlow(int numberOfIterations, boolean invokeFlush, boolean flushAfterMerge, long deletedDocs)
throws IOException {
internalCluster().startNodes(3);
// internalCluster().startNodes(3);
createIndex(INDEX_NAME, remoteStoreIndexSettings(0));
ensureYellowAndNoInitializingShards(INDEX_NAME);
ensureGreen(INDEX_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ public class RemoteStoreStatsIT extends RemoteStoreBaseIntegTestCase {
private static final String INDEX_NAME = "remote-store-test-idx-1";

@Before
public void setup() throws Exception {
public void setup() {
internalCluster().startNodes(3);
ensureStableCluster(3);
}

public void testStatsResponseFromAllNodes() {
Expand Down Expand Up @@ -380,7 +379,7 @@ public void testDownloadStatsCorrectnessSinglePrimaryMultipleReplicaShards() thr
}
}

public void testStatsOnShardRelocation() throws Exception {
public void testStatsOnShardRelocation() {
// Scenario:
// - Create index with single primary and single replica shard
// - Index documents
Expand Down Expand Up @@ -461,7 +460,7 @@ public void testStatsOnShardUnassigned() throws IOException {
indexSingleDoc(INDEX_NAME);
}

public void testStatsOnRemoteStoreRestore() throws Exception {
public void testStatsOnRemoteStoreRestore() throws IOException {
// Creating an index with primary shard count == total nodes in cluster and 0 replicas
int dataNodeCount = client().admin().cluster().prepareHealth().get().getNumberOfDataNodes();
createIndex(INDEX_NAME, remoteStoreIndexSettings(0, dataNodeCount));
Expand All @@ -476,8 +475,7 @@ public void testStatsOnRemoteStoreRestore() throws Exception {
ensureRed(INDEX_NAME);

// Start another data node to fulfil the previously launched capacity
String nodeId = internalCluster().startDataOnlyNode();
ensureStableCluster(3);
internalCluster().startDataOnlyNode();

// Restore index from remote store
assertAcked(client().admin().indices().prepareClose(INDEX_NAME));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,7 @@ public ClusterTasksResult<Task> execute(ClusterState currentState, List<Task> jo
final DiscoveryNode node = joinTask.node();
if (joinTask.isBecomeClusterManagerTask() || joinTask.isFinishElectionTask()) {
// noop
} else if (currentNodes.nodeExistsWithSameRoles(node)) {
logger.debug("received a join request for an existing node [{}]", node);

} else if (currentNodes.nodeExists(node)) {
// TODO: Fix this by moving it out of this if condition, Had to add this code back here as this was
// leading to failure of JoinTaskExecutorTests::testUpdatesNodeWithNewRoles test.
if (node.isRemoteStoreNode()) {
Expand All @@ -201,6 +199,8 @@ public ClusterTasksResult<Task> execute(ClusterState currentState, List<Task> jo
remoteStoreService.updateClusterStateRepositoriesMetadata(new RemoteStoreNode(node), currentState)
);
}
} else if (currentNodes.nodeExistsWithSameRoles(node)) {
logger.debug("received a join request for an existing node [{}]", node);
} else {
try {
if (enforceMajorVersion) {
Expand Down

0 comments on commit 98322fa

Please sign in to comment.