node.js - Checking to see if a RethinkDB shard is in use? -


i wondering if there way check see if rethinkdb shard in use before performing reql query on it.

i calling 2 functions back, first creating rethinkdb table , inserting data, second read data newly created table. works okay if data being inserted minimal, once size of data set being inserted increases, start getting:

unhandled rejection rqlruntimeerror: cannot perform write: primary replica shard ["", +inf) not available 

this because primary shard still doing write previous function. guess wondering if there rethinkdb specific way of avoiding or if need emit/listen events or something?

you can use wait command this. docs:

wait table or tables in database ready. table may temporarily unavailable after creation, rebalancing or reconfiguring. wait command blocks until given table (or database) date.

http://rethinkdb.com/api/javascript/wait/


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -