Skip to content

Commit 8c5f0d6

Browse files
block-writes cannot be added after read-only (#119007)
Fix bug in ReindexDataStreamIndexAction. If the source index has both a block-writes and is read-only, these must be updated on the destination index. If read-only is set first, the block-writes cannot be added because settings cannot be modified.
1 parent 6f26106 commit 8c5f0d6

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

docs/changelog/119007.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 119007
2+
summary: Block-writes cannot be added after read-only
3+
area: Data streams
4+
type: bug
5+
issues:
6+
- 119002

muted-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ tests:
293293
issue: https://github.com/elastic/elasticsearch/issues/118955
294294
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.SecureHdfsRepositoryAnalysisRestIT
295295
issue: https://github.com/elastic/elasticsearch/issues/118970
296-
- class: org.elasticsearch.xpack.migrate.action.ReindexDatastreamIndexTransportActionIT
297-
issue: https://github.com/elastic/elasticsearch/issues/119002
298296

299297
# Examples:
300298
#

x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/ReindexDataStreamIndexTransportAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ protected void doExecute(
9292
.<AcknowledgedResponse>andThen(l -> deleteDestIfExists(destIndexName, l))
9393
.<AcknowledgedResponse>andThen(l -> createIndex(sourceIndex, destIndexName, l))
9494
.<BulkByScrollResponse>andThen(l -> reindex(sourceIndexName, destIndexName, l))
95-
.<AddIndexBlockResponse>andThen(l -> addBlockIfFromSource(READ_ONLY, settingsBefore, destIndexName, l))
9695
.<AddIndexBlockResponse>andThen(l -> addBlockIfFromSource(WRITE, settingsBefore, destIndexName, l))
96+
.<AddIndexBlockResponse>andThen(l -> addBlockIfFromSource(READ_ONLY, settingsBefore, destIndexName, l))
9797
.andThenApply(ignored -> new ReindexDataStreamIndexAction.Response(destIndexName))
9898
.addListener(listener);
9999
}

0 commit comments

Comments
 (0)