You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ?
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
Preferably block the response until the index is available.
OR
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!
The text was updated successfully, but these errors were encountered:
@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.
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
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
OR
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!
The text was updated successfully, but these errors were encountered: