Skip to content

Commit

Permalink
block-writes cannot be added after read-only (elastic#119007)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
parkertimmins authored Dec 18, 2024
1 parent 6f26106 commit 8c5f0d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docs/changelog/119007.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 119007
summary: Block-writes cannot be added after read-only
area: Data streams
type: bug
issues:
- 119002
2 changes: 0 additions & 2 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,6 @@ tests:
issue: https://github.com/elastic/elasticsearch/issues/118955
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.SecureHdfsRepositoryAnalysisRestIT
issue: https://github.com/elastic/elasticsearch/issues/118970
- class: org.elasticsearch.xpack.migrate.action.ReindexDatastreamIndexTransportActionIT
issue: https://github.com/elastic/elasticsearch/issues/119002

# Examples:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ protected void doExecute(
.<AcknowledgedResponse>andThen(l -> deleteDestIfExists(destIndexName, l))
.<AcknowledgedResponse>andThen(l -> createIndex(sourceIndex, destIndexName, l))
.<BulkByScrollResponse>andThen(l -> reindex(sourceIndexName, destIndexName, l))
.<AddIndexBlockResponse>andThen(l -> addBlockIfFromSource(READ_ONLY, settingsBefore, destIndexName, l))
.<AddIndexBlockResponse>andThen(l -> addBlockIfFromSource(WRITE, settingsBefore, destIndexName, l))
.<AddIndexBlockResponse>andThen(l -> addBlockIfFromSource(READ_ONLY, settingsBefore, destIndexName, l))
.andThenApply(ignored -> new ReindexDataStreamIndexAction.Response(destIndexName))
.addListener(listener);
}
Expand Down

0 comments on commit 8c5f0d6

Please sign in to comment.