Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/object/srv_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -3031,6 +3031,7 @@ ds_obj_rw_handler(crt_rpc_t *rpc)
uint32_t max_ver = 0;
struct dtx_epoch epoch = {0};
int rc;
int retry = 0;
bool need_abort = false;

D_ASSERT(orw != NULL);
Expand Down Expand Up @@ -3248,6 +3249,17 @@ ds_obj_rw_handler(crt_rpc_t *rpc)
break;
}

/* If we have already retried once, but still failed for -DER_TX_RESTART, then
* it is quite possible that the -DER_TX_RESTART failure is related with server
* overload or some congestion caused RPC delay. Let's ask client to retry with
* some backoff delay. That will avoid increasing server workload/congestion and
* avoid client RPC timeout during server retry repeatedly.
*/
if (++retry > 1) {
rc = -DER_INPROGRESS;
break;
}

/* Only standalone updates use this RPC. Retry with newer epoch. */
orw->orw_epoch = d_hlc_get();
exec_arg.flags |= ORF_RESEND;
Expand Down Expand Up @@ -4019,6 +4031,7 @@ ds_obj_punch_handler(crt_rpc_t *rpc)
uint32_t max_ver = 0;
struct dtx_epoch epoch;
int rc;
int retry = 0;
bool need_abort = false;

opi = crt_req_get(rpc);
Expand Down Expand Up @@ -4159,6 +4172,17 @@ ds_obj_punch_handler(crt_rpc_t *rpc)
break;
}

/* If we have already retried once, but still failed for -DER_TX_RESTART, then
* it is quite possible that the -DER_TX_RESTART failure is related with server
* overload or some congestion caused RPC delay. Let's ask client to retry with
* some backoff delay. That will avoid increasing server workload/congestion and
* avoid client RPC timeout during server retry repeatedly.
*/
if (++retry > 1) {
rc = -DER_INPROGRESS;
break;
}

/* Only standalone punches use this RPC. Retry with newer epoch. */
opi->opi_epoch = d_hlc_get();
exec_arg.flags |= ORF_RESEND;
Expand Down
Loading