New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alias [test-schema-active-logs] has more than one indices associated with it [[......]], can't execute a single index op #26976
Comments
@ankitachow, Please ask questions on https://discuss.elastic.co where we can give you a better support. We use Github for bug reports and feature requests. Thank you. |
TBH it sounds like a bug to me. But would be great if @ankitachow shares a full script to reproduce all the steps done. @ankitachow could you do that? |
@dadoonet Sure see below steps. We are ingesting data through ES-Hadoop connector continuously. Below are the steps conducted in production:
During Rollover, sometimes(80%) we are getting above error in Spark job and its stopping ingestion. New rolled over index getting created properly. Once we start ingesting again, data gets written to new index created from rollover. Below is our rollover API command. RESPONSE=$(curl -s -XPOST ''$ip':9200/'$active_writealias'/_rollover?pretty=true' -d' But if we run the script after ingestion, there's no error. |
The error you are getting seems to indicate that 2 indices are defined behind the write alias. Do you call |
The template for the test-schema is as follows: So, rollover is creating the new index and also creating the write alias point to the new index which shouldn't happen. "Alias [test-schema-active-logs] has more than one indices associated with it [[test-schema-000004, test-schema-000005]], can't execute a single index op" |
I also met this bug,especially in multi-thread writing is very easy to happen. |
I can reproduce this with the below test snippet. public void testIndexingAndRolloverConcurrently() throws Exception {
client().admin().indices().preparePutTemplate("logs")
.setPatterns(Collections.singletonList("logs-*"))
.addAlias(new Alias("logs-write"))
.get();
assertAcked(client().admin().indices().prepareCreate("logs-000001").get());
ensureYellow("logs-write");
final AtomicBoolean done = new AtomicBoolean();
final Thread rolloverThread = new Thread(() -> {
while (done.get() == false) {
client().admin().indices()
.prepareRolloverIndex("logs-write")
.addMaxIndexSizeCondition(new ByteSizeValue(1))
.get();
}
});
rolloverThread.start();
try {
int numDocs = 10_000;
for (int i = 0; i < numDocs; i++) {
logger.info("--> add doc [{}]", i);
IndexResponse resp = index("logs-write", "doc", Integer.toString(i), "{}");
assertThat(resp.status(), equalTo(RestStatus.CREATED));
}
} finally {
done.set(true);
rolloverThread.join();
}
} We create an index with alias (via template) and update index alias in two separate cluster tasks. This can be a root cause of this issue. |
If a newly created index from a rollover request matches with an index template whose aliases contains the rollover request alias, the alias will point to multiple indices. This will cause indexing requests to be rejected. To avoid such situation, we make sure that there is no duplicated alias before creating a new index; otherwise abort and report an error to the caller. Closes #26976
If a newly created index from a rollover request matches with an index template whose aliases contains the rollover request alias, the alias will point to multiple indices. This will cause indexing requests to be rejected. To avoid such situation, we make sure that there is no duplicated alias before creating a new index; otherwise abort and report an error to the caller. Closes #26976
Hi guys, I am having a similar issue with a newer version So, We were trying a rollover indice with our newly setup cluster with Elasticsearch 6.2 When we are trying to rollover the indice, It gives the following error.
Please find details below of the template that we are having and steps that I used. This can be fairly used to reproduce the issue. Template name : fusion-logs
We inserted a 1000 documents in the above active-fusion-logs index and then used the following to roll over the index
The above API gives us an error when we are trying to rollover Some other info about the cluster.
Also, I had tried the same thing with Elasticsearch 5.3.2 and it worked as expected without the error. |
You should remove alias
|
Oh. Great. That worked. I am not sure how I missed that out. Thanks! @dnhatn |
I having this problem with 6.4 PUT _template/application-logs POST /search-application-logs/_rollover?dry_run I would like to setup rollover policy on alias so it would take effect on all the indexes that follow pattern setup in template. |
My application will follow the date format similar to mentioned in this article https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html Multiple indexes logs-2018.09.09-1 and logs-2018.09.10-1 would be pointing to same alias "logs_write". how to best setup rollover in this type of situation? PUT logs-2018.09.09-1 PUT logs-2018.09.10-1 PUT logs-2018.09.10-1/_doc/1 POST logs_write/_refresh POST /logs_write/_rollover
|
I am getting the same problem as @kkr78. I just have ONE index though. This is occurring on 6.3.0. "reason": "Rollover alias [my-index] can point to multiple indices, found duplicated alias [[my-index]] in index template [mytemplate]" Index : my-index-2018.09.01-1
|
Elasticsearch 5.4.1
Rollover API problem
We are using Rollover to create new index upon a document count condition is reached.
But while ingestion is happening, if we run the rollover API, getting below error:
"Alias [test-schema-active-logs] has more than one indices associated with it [[test-schema-000004, test-schema-000005]], can't execute a single index op"
From Rollover API understanding write alias should automatically switch to new index (test-schema-000005) created and move the alias from the old index (test-schema-000004). How can this error be handled?
The text was updated successfully, but these errors were encountered: