added transaction retry to mako populate mode

This commit is contained in:
QA Hoang 2021-07-26 21:18:56 -07:00
parent e0513a55f8
commit 7f76a434f7
1 changed files with 10 additions and 2 deletions

View File

@ -316,12 +316,20 @@ int populate(FDBTransaction* transaction,
stats->ops[OP_INSERT]++;
/* commit every 100 inserts (default) */
int rc;
if (i % args->txnspec.ops[OP_INSERT][OP_COUNT] == 0) {
if (stats->xacts % args->sampling == 0) {
clock_gettime(CLOCK_MONOTONIC, &timer_start_commit);
}
if (commit_transaction(transaction) != FDB_SUCCESS)
goto failExit;
retryTxn:
rc = commit_transaction(transaction);
if (rc != FDB_SUCCESS) {
if (rc == FDB_ERROR_RETRY) {
goto retryTxn;
} else {
goto failExit;
}
}
/* xact latency stats */
if (stats->xacts % args->sampling == 0) {