@@ -1899,68 +1899,7 @@ public void testRomanianAnalyzerBWC() throws Exception {
18991899 assertTotalHits (3 , entityAsMap (client ().performRequest (searchRequest )));
19001900 }
19011901 }
1902-
1903- /**
1904- * This test ensures that soft deletes are enabled a when upgrading a pre-8 cluster to 8.0+
1905- */
1906- @ UpdateForV9 (owner = UpdateForV9 .Owner .DISTRIBUTED_COORDINATION ) // This test can be removed in v9
1907- public void testEnableSoftDeletesOnRestore () throws Exception {
1908- var originalClusterDidNotEnforceSoftDeletes = oldClusterHasFeature (RestTestLegacyFeatures .SOFT_DELETES_ENFORCED ) == false ;
1909-
1910- assumeTrue ("soft deletes must be enabled on 8.0+" , originalClusterDidNotEnforceSoftDeletes );
1911- final String snapshot = "snapshot-" + index ;
1912- if (isRunningAgainstOldCluster ()) {
1913- final Settings .Builder settings = indexSettings (1 , 1 );
1914- settings .put (IndexSettings .INDEX_SOFT_DELETES_SETTING .getKey (), false );
1915- createIndex (index , settings .build ());
1916- ensureGreen (index );
1917- int numDocs = randomIntBetween (0 , 100 );
1918- indexRandomDocuments (
1919- numDocs ,
1920- true ,
1921- true ,
1922- randomBoolean (),
1923- i -> jsonBuilder ().startObject ().field ("field" , "value" ).endObject ()
1924- );
1925- // create repo
1926- client ().performRequest (newXContentRequest (HttpMethod .PUT , "/_snapshot/repo" , (repoConfig , params ) -> {
1927- repoConfig .field ("type" , "fs" );
1928- repoConfig .startObject ("settings" );
1929- repoConfig .field ("compress" , randomBoolean ());
1930- repoConfig .field ("location" , repoDirectory .getRoot ().getPath ());
1931- repoConfig .endObject ();
1932- return repoConfig ;
1933- }));
1934- // create snapshot
1935- Request createSnapshot = newXContentRequest (
1936- HttpMethod .PUT ,
1937- "/_snapshot/repo/" + snapshot ,
1938- (builder , params ) -> builder .field ("indices" , index )
1939- );
1940- createSnapshot .addParameter ("wait_for_completion" , "true" );
1941- client ().performRequest (createSnapshot );
1942- } else {
1943- String restoredIndex = "restored-" + index ;
1944- // Restore
1945- Request restoreRequest = newXContentRequest (
1946- HttpMethod .POST ,
1947- "/_snapshot/repo/" + snapshot + "/_restore" ,
1948- (restoreCommand , params ) -> {
1949- restoreCommand .field ("indices" , index );
1950- restoreCommand .field ("rename_pattern" , index );
1951- restoreCommand .field ("rename_replacement" , restoredIndex );
1952- restoreCommand .startObject ("index_settings" ).field ("index.soft_deletes.enabled" , true ).endObject ();
1953- return restoreCommand ;
1954- }
1955- );
1956- restoreRequest .addParameter ("wait_for_completion" , "true" );
1957- client ().performRequest (restoreRequest );
1958- ensureGreen (restoredIndex );
1959- int numDocs = countOfIndexedRandomDocuments ();
1960- assertTotalHits (numDocs , entityAsMap (client ().performRequest (new Request ("GET" , "/" + restoredIndex + "/_search" ))));
1961- }
1962- }
1963-
1902+
19641903 public void testForbidDisableSoftDeletesOnRestore () throws Exception {
19651904 final String snapshot = "snapshot-" + index ;
19661905 if (isRunningAgainstOldCluster ()) {
0 commit comments