[Transform] add alias for backwards compatibility with 7.4 (#48049)

add alias for backwards compatibility with 7.4

relates #47943
This commit is contained in:
Hendrik Muhs 2019-10-15 15:04:09 +02:00 committed by GitHub
parent 620bd9d224
commit 4aa7c7bad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,7 @@ package org.elasticsearch.xpack.transform.persistence;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.alias.Alias;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.Client;
@ -343,6 +344,8 @@ public final class TransformInternalIndex {
.patterns(indexTemplateMetaData.patterns())
.version(indexTemplateMetaData.version())
.settings(indexTemplateMetaData.settings())
// BWC: for mixed clusters with nodes < 7.5, we need the alias to make new docs visible for them
.alias(new Alias(".data-frame-internal-3"))
.mapping(SINGLE_MAPPING_NAME, XContentHelper.convertToMap(jsonMappings, true, XContentType.JSON).v2());
ActionListener<AcknowledgedResponse> innerListener = ActionListener.wrap(r -> listener.onResponse(null), listener::onFailure);
executeAsyncWithOrigin(client.threadPool().getThreadContext(), TRANSFORM_ORIGIN, request,