struct cnid_dbd_rqst rqst;
struct cnid_dbd_rply rply;
- dbd->db_param.txn_frequency = 0;
-
/* jump over rootinfo key */
if ( dbif_idwalk(dbd, &dbd_cnid, 0) != 1)
return;
db_param.cachesize = 64 * 1024; /* 64 MB */
db_param.maxlocks = DEFAULT_MAXLOCKS;
db_param.maxlockobjs = DEFAULT_MAXLOCKOBJS;
- db_param.txn_frequency = 0; /* close txn every 1000 objects */
db_param.logfile_autoremove = 1;
/* Make it accessible for all funcs */
}
/*
- ret = 2 -> commit txn regardless of db_param.txn_frequency
ret = 1 -> commit txn if db_param.txn_frequency
ret = 0 -> abort txn db_param.txn_frequency -> exit!
anything else -> exit!
- db_param of the db environment might specify txn_frequency > 1 in which case
- we only close a txn every txn_frequency time. the `dbd` command uses this for the
- temp rebuild db, cnid_dbd keeps it at 0. For increasing cnid_dbd throughput this
- should be tuned and testes as well.
-
@returns 0 on success (abort or commit), -1 on error
*/
int dbif_txn_close(DBD *dbd, int ret)
LOG( log_error, logtype_cnid, "Fatal error aborting transaction. Exiting!");
return -1;
}
- } else if (ret == 1 || ret == 2) {
- static uint count;
- if (ret != 2 && dbd->db_param.txn_frequency > 1) {
- count++;
- if ((count % dbd->db_param.txn_frequency) != 0)
- return 0;
- }
+ } else if (ret == 1) {
ret = dbif_txn_commit(dbd);
if ( ret < 0) {
LOG( log_error, logtype_cnid, "Fatal error committing transaction. Exiting!");