#495

BatchGet Timeout

Openazam-gsmopened 1y ago

In my go program I do BatchGet read with about 10-15 keys, assuming If there is issue with fetching I will get client error and will drop the request accordingly.

But I have recently came across articles which suggest that BatchGet will be successful even if there are issue with fetching few keys and those will be there in result set as nil.

And it seems like correct as my logic is failing, how do I avoid such situation so as to be sure that if I am getting response from batch operation if should be of success and anything returned nil is actually not present in database.

Any help/suggestion here?

Activity

2
khaf1y ago

If you set BatchPolicy.AllowPartialResults = true, then the batch will not raise an error if some of the results are not returned from a node due to some error. Otherwise, you should always get an error if the batch request if not successful for any reason.

azam-gsm1y ago

By that I understand that I am correct in assuming that if nil is returned for any key its actually not present in db and its not due to any error. However I am not using any batch policy and still stick to client v5, I also see that AllowPartialResults default is false, so its not an issue for my case.