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
Creation of indexes fail with a 404 because a PUT happens _too soon_ #36336
Comments
There is something funny going on here, because with default settings I think what you're doing should be fine, although I think it is possible to get this to happen by reducing some timeouts to unreasonably low values. I ran hundreds of iterations of a test that does what you are doing without a failure, with default settings. It's probably best to ask this kind of question in the discussion forum rather than here. I don't think there's any action to be taken in this repository, so I'm closing this. Please link to your post here so other readers can follow along. If we manage to identify a bug in the forum then we can reopen this. |
Here is a log as requested by Christian on the discussion forum. |
Here is the output of the cluster stats command: To be clear, I mention above that I have ONE node and ONE shard. I'm still at the early stages testing, getting things together. It is harder when you can't just run scripts to test everything from scratch again and again, though. The configuration files come straight from Elassandra version 6.2.3.7. I just tried to set the path to the logs directory to get some ElectricSearch logs, but I got no other files than the default and: |
@AlexisWilke it's best to keep this discussion in one place, no need to duplicate things here like this. I'll respond on the forum. If anyone else is following along, the thread is at https://discuss.elastic.co/t/creation-of-indexes-fail-with-a-404-because-a-put-happens-too-soon-36336/160020/8 |
Elasticsearch version: 6.2.3.7
Plugins installed: none
JVM version:
OS version:
Latest of Ubuntu 16.04
Description of the problem including expected versus actual behavior:
I use express-cassandra to manage one Elassandra node. While testing, I like to reset my database over and over again. So I stop the running instance, delete the
data
folder, and restart Elassandra many times.My installation has just 3 models and yet when I run my code that creates those three models, I get a 404 about a missing index. If you look at the sequence of commands generated in the
elasticsearch/src/lib/transport.js
file, we can see that thePUT ...
used to create the index exists, only the code attempting to setup the mapping fails saying that one of those indexes is missing.To see the commands sent to the REST interface of ElasticSearch, I added the following around line 213 of
transport.js
:The output of which is shown in the Logs section below.
Just an idea, but it looks to me as if the code was running in parallel and that could be what causes the problem. Not the parallelism itself, but the fact that it slows down everything and timings are out of whack giving the system a chance to send the
PUT ...
for the mapping too soon. On the other hand, if you return a positive response before a newly created index is accessible, it's definitely asking for trouble.Steps to reproduce:
Here is my CQL schema:
And here is my script that runs cqlsh to create the schema and immediately runs the various GET, HEAD, PUT commands pretty much the same way as
express-cassandra
does.(Obviously
express-cassandra
uses theHEAD
to know what to do next, my script here just doesn't check anything. It expects the database to be brand new i.e. if not brand new, stop the database, delete thedata
folder if it exists, and restart the database, wait for it to be up and ready, then start this script.)IMPORTANT NOTE: In my
express-cassandra
code I setup all timeout values to 1h instead of the various defaults it uses (12 to 30 seconds) to at least I can avoid time outs.Logs:
note: this is the log from my actual software, opposed to the logs I would get from the script above. The order may vary and which table index generates the 404 error(s) may vary as well.
The text was updated successfully, but these errors were encountered: