Curious to know if bulk operations can be partial successes in the Go SDK (e.g. gocb.GetOps where all but one of the gets succeeds and the other times out)?
And if this is possible to have partial success, how does the go sdk relay this? Does Do() return error or will the item slice have some nil values (like it does with KeyNotFound errors I believe)?
Thanks in advance
Each BulkOp type (for instance:
GetOp) has an
Err property which contains individualized errors for each operation after you have executed the group of operations with the
Bucket.Do method. Note that currently, if some of your operations timeout (the issue is specific with timeouts, and does not affect other errors), the operations which were not completed in time will not correctly indicate their Err status as Timeout (an issue has been filed for that here: https://issues.couchbase.com/browse/GOCBC-145).
So until GOCBC-145 is implemented, if a single GetOp times out in a Do() call, his GetOp.Key will be whichever key it was trying to retrieve, GetOp.Err will be nil and the GetOp.Value will be the default Go value (nil if pointer) as well. Is that correct?
That is precisely the case.
P.S. I actually already fixed the issue. It should get into the next release, and will be available via GitHub as soon as I’ve managed to run some tests. You can find the fix in its changeset form here:
http://review.couchbase.org/72153 GOCBC-145: Properly record timeouts for individual bulk ops.