Skip to content

Commit 14ac833

Browse files
committed
Skip through to the projectMetadata directly
1 parent bb81d9b commit 14ac833

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,19 @@ protected void doExecute(
146146
ReindexDataStreamIndexAction.Request request,
147147
ActionListener<ReindexDataStreamIndexAction.Response> listener
148148
) {
149-
var project = projectResolver.getProjectState(clusterService.state());
149+
var projectMetadata = projectResolver.getProjectMetadata(clusterService.state());
150150
var sourceIndexName = request.getSourceIndex();
151151
var destIndexName = generateDestIndexName(sourceIndexName);
152152
TaskId taskId = new TaskId(clusterService.localNode().getId(), task.getId());
153-
IndexMetadata sourceIndex = project.metadata().index(sourceIndexName);
153+
IndexMetadata sourceIndex = projectMetadata.index(sourceIndexName);
154154
if (sourceIndex == null) {
155155
listener.onFailure(new ResourceNotFoundException("source index [{}] does not exist", sourceIndexName));
156156
return;
157157
}
158158

159159
Settings settingsBefore = sourceIndex.getSettings();
160160

161-
var hasOldVersion = DeprecatedIndexPredicate.getReindexRequiredPredicate(project.metadata(), false, true);
161+
var hasOldVersion = DeprecatedIndexPredicate.getReindexRequiredPredicate(projectMetadata, false, true);
162162
if (hasOldVersion.test(sourceIndex.getIndex()) == false) {
163163
logger.warn(
164164
"Migrating index [{}] with version [{}] is unnecessary as its version is not before [{}]",

0 commit comments

Comments
 (0)