summaryrefslogtreecommitdiff
path: root/src/txn
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2016-11-01 00:32:48 -0400
committerMichael Cahill <michael.cahill@mongodb.com>2016-11-01 15:32:48 +1100
commit1772c0859b953bce0ab2a2f66d74e4ba00db105e (patch)
tree0537790c8cd8d5c75bb3d18ff4cfe0e9debf221d /src/txn
parenteaf64335f9750e68c34613e1f0a51ceb3b2bcf89 (diff)
downloadmongo-1772c0859b953bce0ab2a2f66d74e4ba00db105e.tar.gz
WT-2998 add error messages to error returns that might be confusing. (#3110)
Diffstat (limited to 'src/txn')
-rw-r--r--src/txn/txn_log.c18
-rw-r--r--src/txn/txn_recover.c19
2 files changed, 22 insertions, 15 deletions
diff --git a/src/txn/txn_log.c b/src/txn/txn_log.c
index f9dd9bee807..f1b78879d76 100644
--- a/src/txn/txn_log.c
+++ b/src/txn/txn_log.c
@@ -262,20 +262,20 @@ err: __wt_logrec_free(session, &logrec);
* Read a log record for a checkpoint operation.
*/
int
-__wt_txn_checkpoint_logread(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
- WT_LSN *ckpt_lsn)
+__wt_txn_checkpoint_logread(WT_SESSION_IMPL *session,
+ const uint8_t **pp, const uint8_t *end, WT_LSN *ckpt_lsn)
{
- WT_ITEM ckpt_snapshot;
+ WT_DECL_RET;
+ WT_ITEM ckpt_snapshot_unused;
uint32_t ckpt_file, ckpt_offset;
- u_int ckpt_nsnapshot;
+ u_int ckpt_nsnapshot_unused;
const char *fmt = WT_UNCHECKED_STRING(IIIU);
- WT_RET(__wt_struct_unpack(session, *pp, WT_PTRDIFF(end, *pp), fmt,
+ if ((ret = __wt_struct_unpack(session, *pp, WT_PTRDIFF(end, *pp), fmt,
&ckpt_file, &ckpt_offset,
- &ckpt_nsnapshot, &ckpt_snapshot));
- WT_UNUSED(ckpt_nsnapshot);
- WT_UNUSED(ckpt_snapshot);
+ &ckpt_nsnapshot_unused, &ckpt_snapshot_unused)) != 0)
+ WT_RET_MSG(session,
+ ret, "txn_checkpoint_logread: unpack failure");
WT_SET_LSN(ckpt_lsn, ckpt_file, ckpt_offset);
*pp = end;
return (0);
diff --git a/src/txn/txn_recover.c b/src/txn/txn_recover.c
index ae21e58d9b6..65811aa3bf4 100644
--- a/src/txn/txn_recover.c
+++ b/src/txn/txn_recover.c
@@ -231,9 +231,12 @@ __txn_op_apply(
/* Reset the cursor so it doesn't block eviction. */
if (cursor != NULL)
WT_ERR(cursor->reset(cursor));
+ return (0);
-err: if (ret != 0)
- __wt_err(session, ret, "Operation failed during recovery");
+err: __wt_err(session, ret,
+ "operation apply failed during recovery: operation type %d "
+ "at LSN %" PRIu32 "/%" PRIu32,
+ optype, lsnp->l.file, lsnp->l.offset);
return (ret);
}
@@ -263,12 +266,14 @@ __txn_log_recover(WT_SESSION_IMPL *session,
WT_ITEM *logrec, WT_LSN *lsnp, WT_LSN *next_lsnp,
void *cookie, int firstrecord)
{
+ WT_DECL_RET;
WT_RECOVERY *r;
- const uint8_t *end, *p;
- uint64_t txnid;
+ uint64_t txnid_unused;
uint32_t rectype;
+ const uint8_t *end, *p;
WT_UNUSED(next_lsnp);
+
r = cookie;
p = WT_LOG_SKIP_HEADER(logrec->data);
end = (const uint8_t *)logrec->data + logrec->size;
@@ -285,8 +290,10 @@ __txn_log_recover(WT_SESSION_IMPL *session,
break;
case WT_LOGREC_COMMIT:
- WT_RET(__wt_vunpack_uint(&p, WT_PTRDIFF(end, p), &txnid));
- WT_UNUSED(txnid);
+ if ((ret = __wt_vunpack_uint(
+ &p, WT_PTRDIFF(end, p), &txnid_unused)) != 0)
+ WT_RET_MSG(
+ session, ret, "txn_log_recover: unpack failure");
WT_RET(__txn_commit_apply(r, lsnp, &p, end));
break;
}