|  | @@ -16,6 +16,7 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
 | 
	
		
			
				|  |  |  import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
 | 
	
		
			
				|  |  |  import org.elasticsearch.action.admin.indices.rollover.RolloverRequest;
 | 
	
		
			
				|  |  |  import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
 | 
	
		
			
				|  |  | +import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
 | 
	
		
			
				|  |  |  import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
 | 
	
		
			
				|  |  |  import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest;
 | 
	
		
			
				|  |  |  import org.elasticsearch.action.admin.indices.template.delete.TransportDeleteIndexTemplateAction;
 | 
	
	
		
			
				|  | @@ -27,6 +28,7 @@ import org.elasticsearch.cluster.block.ClusterBlockException;
 | 
	
		
			
				|  |  |  import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
 | 
	
		
			
				|  |  |  import org.elasticsearch.cluster.metadata.IndexMetadata;
 | 
	
		
			
				|  |  |  import org.elasticsearch.cluster.metadata.MappingMetadata;
 | 
	
		
			
				|  |  | +import org.elasticsearch.cluster.metadata.MetadataIndexStateService;
 | 
	
		
			
				|  |  |  import org.elasticsearch.cluster.metadata.Template;
 | 
	
		
			
				|  |  |  import org.elasticsearch.common.compress.CompressedXContent;
 | 
	
		
			
				|  |  |  import org.elasticsearch.common.settings.Settings;
 | 
	
	
		
			
				|  | @@ -50,6 +52,7 @@ import java.util.List;
 | 
	
		
			
				|  |  |  import java.util.Locale;
 | 
	
		
			
				|  |  |  import java.util.Map;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import static java.lang.Boolean.parseBoolean;
 | 
	
		
			
				|  |  |  import static org.elasticsearch.cluster.metadata.MetadataIndexTemplateService.DEFAULT_TIMESTAMP_FIELD;
 | 
	
		
			
				|  |  |  import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
 | 
	
		
			
				|  |  |  import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
 | 
	
	
		
			
				|  | @@ -147,6 +150,13 @@ public class ReindexDatastreamIndexTransportActionIT extends ESIntegTestCase {
 | 
	
		
			
				|  |  |          // call reindex
 | 
	
		
			
				|  |  |          client().execute(ReindexDataStreamIndexAction.INSTANCE, new ReindexDataStreamIndexAction.Request(sourceIndex)).actionGet();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        // Assert that source index is now read-only but not verified read-only
 | 
	
		
			
				|  |  | +        GetSettingsResponse getSettingsResponse = admin().indices().getSettings(new GetSettingsRequest().indices(sourceIndex)).actionGet();
 | 
	
		
			
				|  |  | +        assertTrue(parseBoolean(getSettingsResponse.getSetting(sourceIndex, IndexMetadata.SETTING_BLOCKS_WRITE)));
 | 
	
		
			
				|  |  | +        assertFalse(
 | 
	
		
			
				|  |  | +            parseBoolean(getSettingsResponse.getSetting(sourceIndex, MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.getKey()))
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          // assert that write to source fails
 | 
	
		
			
				|  |  |          var indexReq = new IndexRequest(sourceIndex).source(jsonBuilder().startObject().field("field", "1").endObject());
 | 
	
		
			
				|  |  |          assertThrows(ClusterBlockException.class, () -> client().index(indexReq).actionGet());
 | 
	
	
		
			
				|  | @@ -253,9 +263,9 @@ public class ReindexDatastreamIndexTransportActionIT extends ESIntegTestCase {
 | 
	
		
			
				|  |  |              .getDestIndex();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          var settingsResponse = indicesAdmin().getSettings(new GetSettingsRequest().indices(destIndex)).actionGet();
 | 
	
		
			
				|  |  | -        assertFalse(Boolean.parseBoolean(settingsResponse.getSetting(destIndex, IndexMetadata.SETTING_READ_ONLY)));
 | 
	
		
			
				|  |  | -        assertFalse(Boolean.parseBoolean(settingsResponse.getSetting(destIndex, IndexMetadata.SETTING_READ_ONLY_ALLOW_DELETE)));
 | 
	
		
			
				|  |  | -        assertFalse(Boolean.parseBoolean(settingsResponse.getSetting(destIndex, IndexMetadata.SETTING_BLOCKS_WRITE)));
 | 
	
		
			
				|  |  | +        assertFalse(parseBoolean(settingsResponse.getSetting(destIndex, IndexMetadata.SETTING_READ_ONLY)));
 | 
	
		
			
				|  |  | +        assertFalse(parseBoolean(settingsResponse.getSetting(destIndex, IndexMetadata.SETTING_READ_ONLY_ALLOW_DELETE)));
 | 
	
		
			
				|  |  | +        assertFalse(parseBoolean(settingsResponse.getSetting(destIndex, IndexMetadata.SETTING_BLOCKS_WRITE)));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          cleanupMetadataBlocks(sourceIndex);
 | 
	
		
			
				|  |  |          cleanupMetadataBlocks(destIndex);
 |