diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2014-06-16 15:58:08 +1000 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2014-06-16 15:58:08 +1000 |
commit | a71188f489bedecdfd59962d4c70271a697cda45 (patch) | |
tree | e73e8a7a1cc7149d67a21ab043fb546a30713eb0 /api | |
parent | 3a9a3d5bc2e5a04d937f239971e62d7c21952b61 (diff) | |
download | mongo-a71188f489bedecdfd59962d4c70271a697cda45.tar.gz |
Mildly improve error handling in LevelDB snapshots.
Diffstat (limited to 'api')
-rw-r--r-- | api/leveldb/leveldb_wt.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/api/leveldb/leveldb_wt.cc b/api/leveldb/leveldb_wt.cc index 189d5e4089e..a0c762342dc 100644 --- a/api/leveldb/leveldb_wt.cc +++ b/api/leveldb/leveldb_wt.cc @@ -889,8 +889,8 @@ IteratorImpl::Prev() Status SnapshotImpl::setupTransaction() { WT_SESSION * session = db_->getSession(); - session->begin_transaction(session, NULL); - return Status::OK(); + int ret = session->begin_transaction(session, NULL); + return WiredTigerErrorToStatus(ret, NULL); } Status SnapshotImpl::releaseTransaction() @@ -898,6 +898,7 @@ Status SnapshotImpl::releaseTransaction() WT_SESSION * session = db_->getSession(); // In LevelDB Snapshots are read only objects - roll back the transaction, // it has a slightly lower cost. - session->rollback_transaction(session, NULL); - return Status::OK(); + int ret = session->rollback_transaction(session, NULL); + + return WiredTigerErrorToStatus(ret, NULL); } |