Skip to content

Commit

Permalink
Revert "Assert getRepositoryData only on master node (#67780)"
Browse files Browse the repository at this point in the history
This PR caused test failures after merge, one of which was subsequently
muted. It's quite possible that this isn't the only test that's now
broken so this commit reverts it (and the muting) pending further
investigation.

This reverts commit e8ed1b4.
This reverts commit b467595.
  • Loading branch information
DaveCTurner committed Jan 20, 2021
1 parent e8ed1b4 commit 5e3ad9f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1344,12 +1344,6 @@ RepositoryData repositoryData() {

@Override
public void getRepositoryData(ActionListener<RepositoryData> listener) {
// RepositoryData is the responsibility of the elected master: we shouldn't be loading it on other nodes as we don't have good
// consistency guarantees there, but electedness is too ephemeral to assert. We can say for sure that this node should be
// master-eligible, which is almost as strong since all other snapshot-related activity happens on data nodes whether they be
// master-eligible or not.
assert clusterService.localNode().isMasterNode() : "should only load repository data on master nodes";

if (latestKnownRepoGen.get() == RepositoryData.CORRUPTED_REPO_GEN) {
listener.onFailure(corruptedStateException(null));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ private static ClusterService mockClusterService(ClusterState initialState) {
when(clusterService.getClusterApplierService()).thenReturn(clusterApplierService);
// Setting local node as master so it may update the repository metadata in the cluster state
final DiscoveryNode localNode = new DiscoveryNode("", buildNewFakeTransportAddress(), Version.CURRENT);
when(clusterService.localNode()).thenReturn(localNode);
final AtomicReference<ClusterState> currentState = new AtomicReference<>(
ClusterState.builder(initialState).nodes(
DiscoveryNodes.builder().add(localNode).masterNodeId(localNode.getId()).localNodeId(localNode.getId()).build()).build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public void testRecoveryStateRecoveredBytesMatchPhysicalCacheState() throws Exce
assertThat("Expected to recover 100% of files", recoveryState.getIndex().recoveredBytesPercent(), equalTo(100.0f));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/67795")
public void testFilesStoredInThePersistentCacheAreMarkedAsReusedInRecoveryState() throws Exception {
final String fsRepoName = randomAlphaOfLength(10);
final String indexName = randomAlphaOfLength(10).toLowerCase(Locale.ROOT);
Expand Down

0 comments on commit 5e3ad9f

Please sign in to comment.