Skip to content

Commit

Permalink
MB-45967 : Retry on DML Failures
Browse files Browse the repository at this point in the history
It has been seen that a failure on DML N1QL query (such as TMPFAIL,
ENOMEM, NMVB, Connection error, SOCKET_SHUTDOWN etc) are encapsulated as
DML_FAILURE by lcb which is not a retriable / transient error. This can
then result in document mismatch for N1QL handlers. Hence, we need to
retry on DML_FAILUREs too.

Change-Id: I3aef901f4cf283c759394ea8b1b35fe6708f7aa2
Reviewed-on: http://review.couchbase.org/c/eventing/+/152666
Tested-by: <abhishek.jindal@couchbase.com>
Reviewed-by: <ankit.prabhu@couchbase.com>
Reviewed-by: CI Bot
  • Loading branch information
abhijpes committed May 4, 2021
1 parent 42dcdf8 commit d2f1786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion features/query/src/manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void QueryFunction(const v8::FunctionCallbackInfo<v8::Value> &args) {
}
}

auto retriable = IsRetriable(first_row.err_code);
auto retriable = (first_row.err_code == LCB_ERR_DML_FAILURE) || IsRetriable(first_row.err_code);
if (!conn_refreshed && (first_row.is_client_auth_error ||
first_row.err_code == LCB_ERR_HTTP || retriable)) {
query_mgr->RefreshTopConnection();
Expand Down

0 comments on commit d2f1786

Please sign in to comment.