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

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -