50
50
public class RemoteStatePublicationIT extends RemoteStoreBaseIntegTestCase {
51
51
52
52
private static String INDEX_NAME = "test-index" ;
53
+ private boolean isRemoteStateEnabled = true ;
54
+ private String isRemotePublicationEnabled = "true" ;
53
55
54
56
@ Before
55
57
public void setup () {
56
58
asyncUploadMockFsRepo = false ;
59
+ isRemoteStateEnabled = true ;
60
+ isRemotePublicationEnabled = "true" ;
57
61
}
58
62
59
63
@ Override
60
64
protected Settings featureFlagSettings () {
61
- return Settings .builder ().put (super .featureFlagSettings ()).put (FeatureFlags .REMOTE_PUBLICATION_EXPERIMENTAL , "true" ).build ();
65
+ return Settings .builder ()
66
+ .put (super .featureFlagSettings ())
67
+ .put (FeatureFlags .REMOTE_PUBLICATION_EXPERIMENTAL , isRemotePublicationEnabled )
68
+ .build ();
62
69
}
63
70
64
71
@ Override
@@ -76,7 +83,7 @@ protected Settings nodeSettings(int nodeOrdinal) {
76
83
);
77
84
return Settings .builder ()
78
85
.put (super .nodeSettings (nodeOrdinal ))
79
- .put (REMOTE_CLUSTER_STATE_ENABLED_SETTING .getKey (), true )
86
+ .put (REMOTE_CLUSTER_STATE_ENABLED_SETTING .getKey (), isRemoteStateEnabled )
80
87
.put ("node.attr." + REMOTE_STORE_ROUTING_TABLE_REPOSITORY_NAME_ATTRIBUTE_KEY , routingTableRepoName )
81
88
.put (routingTableRepoTypeAttributeKey , ReloadableFsRepository .TYPE )
82
89
.put (routingTableRepoSettingsAttributeKeyPrefix + "location" , segmentRepoPath )
@@ -136,6 +143,18 @@ public void testPublication() throws Exception {
136
143
}
137
144
}
138
145
146
+ public void testRemotePublicationDisableIfRemoteStateDisabled () {
147
+ // only disable remote state
148
+ isRemoteStateEnabled = false ;
149
+ // create cluster with multi node with in-consistent settings
150
+ prepareCluster (3 , 2 , INDEX_NAME , 1 , 2 );
151
+ // assert cluster is stable, ensuring publication falls back to legacy transport with inconsistent settings
152
+ ensureStableCluster (5 );
153
+ ensureGreen (INDEX_NAME );
154
+
155
+ assertNull (internalCluster ().getCurrentClusterManagerNodeInstance (RemoteClusterStateService .class ));
156
+ }
157
+
139
158
private Map <String , Integer > getMetadataFiles (BlobStoreRepository repository , String subDirectory ) throws IOException {
140
159
BlobPath metadataPath = repository .basePath ()
141
160
.add (
@@ -151,5 +170,4 @@ private Map<String, Integer> getMetadataFiles(BlobStoreRepository repository, St
151
170
return fileName .split (DELIMITER )[0 ];
152
171
}).collect (Collectors .toMap (Function .identity (), key -> 1 , Integer ::sum ));
153
172
}
154
-
155
173
}
0 commit comments