Skip to content
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

Creating a new search index via HTTP responds before the index is available [JIRA: RIAK-1547] #402

Closed
superstructor opened this issue Jun 11, 2014 · 3 comments

Comments

@superstructor
Copy link

When scripting the creation of schemas, indexes and associated bucket types I noticed that there is a significant delay between the HTTP response for creating an index and the index actually being made available for association with a bucket / bucket-type ?

For example if I run

curl -v -XPUT http://localhost:8098/search/index/example -H'content-type:application/json' -d'{"schema":"example"}'

I get a 204 response which means "The server has fulfilled the request..."

Then if I immediately run

riak-admin bucket-type create example '{"props":{"search_index":"example","allow_mult":false}}'

The riak-admin command fails because the index is not available yet, on my MacBook Pro (latest iteration, i7 2.6Ghz w/ 16GB RAM) I need to wait between 2 and 5 seconds after the HTTP response before the index is actually available, but is generally unpredictable and obviously depends on the hardware platform / load.

You need to either

  1. Preferably block the response until the index is available.

OR

  1. Correctly signal that the request is NOT fulfilled by using a 202 Accepted status code which means "The request has been accepted for processing, but the processing has not been completed."

Great work on Yokozuna for Basho Riak 2.0, really exciting to be working with this in general!

I am using the official OS X Riak 2.0-beta1 package on OS X 10.9.3.

Thanks!

@kellymclaughlin kellymclaughlin added this to the 2.0.1 milestone Jun 13, 2014
@rzezeski
Copy link
Contributor

@superstructor Yes, the index creation is not synchronous. I also agree it should be made synchronous as time permits after the 2.0 release.

In the meantime you can use GET /search/index/Foo to determine if the index is up in Solr. You need to call it on every node as the ping is only performed locally.

@binarytemple
Copy link

Referenced in ZD issue - https://basho.zendesk.com/agent/tickets/10045

@Basho-JIRA Basho-JIRA changed the title Creating a new search index via HTTP responds before the index is available Creating a new search index via HTTP responds before the index is available [JIRA: RIAK-1547] Feb 17, 2015
@Basho-JIRA
Copy link

Relies on

riak_pb -> basho/riak_pb#111
riak-erlang-client -> basho/riak-erlang-client#207
yokozuna -> #463
riak_test -> basho/riak_test#745

_[posted via JIRA by Zeeshan Lakhani]_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants