소스 검색

Revert "Assert getRepositoryData only on master node (#67780)"

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 e8ed1b441b36df6dab056e5bc6460635aacde259.
This reverts commit b467595564c49afa386539670657e41d7fe2961d.
David Turner 4 년 전
부모
커밋
5e3ad9f20a

+ 0 - 6
server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java

@@ -1344,12 +1344,6 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp
 
     @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;

+ 0 - 1
test/framework/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreTestUtil.java

@@ -305,7 +305,6 @@ public final class BlobStoreTestUtil {
         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());

+ 0 - 1
x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotRecoveryStateIntegrationTests.java

@@ -118,7 +118,6 @@ public class SearchableSnapshotRecoveryStateIntegrationTests extends BaseSearcha
         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);