From 4c26c985409d4327a537d40e966aee3b2492b285 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Wed, 5 Feb 2014 18:49:32 +0000 Subject: QPID-5480: Recovery of store failure with "JERR_MAP_NOTFOUND: Key not found in map." error message. Fixed numerous recovery issues, particularly the handling of files at the end of the file list during recovery when the last file is not used or incompletely written. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1564877 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/linearstore/MessageStoreImpl.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'cpp/src/qpid/linearstore/MessageStoreImpl.cpp') diff --git a/cpp/src/qpid/linearstore/MessageStoreImpl.cpp b/cpp/src/qpid/linearstore/MessageStoreImpl.cpp index 483b494c2c..ff5b41b962 100644 --- a/cpp/src/qpid/linearstore/MessageStoreImpl.cpp +++ b/cpp/src/qpid/linearstore/MessageStoreImpl.cpp @@ -593,7 +593,7 @@ void MessageStoreImpl::recover(qpid::broker::RecoveryManager& registry_) std::ostringstream oss; oss << "Recovered transaction prepared list:"; for (txn_list::iterator i = prepared.begin(); i != prepared.end(); i++) { - oss << std::endl << " " << str2hexnum(i->xid); + oss << std::endl << " " << qpid::linearstore::journal::jcntl::str2hexnum(i->xid); } QLS_LOG(debug, oss.str()); @@ -1292,7 +1292,7 @@ void MessageStoreImpl::completed(TxnCtxt& txn_, mgmtObject->inc_tplTxnAborts(); } } catch (const std::exception& e) { - QLS_LOG(error, "Error completing xid " << txn_.getXid() << ": " << e.what()); + QLS_LOG(error, "Error completing xid " << qpid::linearstore::journal::jcntl::str2hexnum(txn_.getXid()) << ": " << e.what()); throw; } } @@ -1516,15 +1516,6 @@ void MessageStoreImpl::journalDeleted(JournalImpl& j_) { journalList.erase(j_.id()); } -std::string MessageStoreImpl::str2hexnum(const std::string& str) { - std::ostringstream oss; - oss << "(" << str.size() << ")0x" << std::hex; - for (unsigned i=str.size(); i>0; --i) { - oss << std::setfill('0') << std::setw(2) << (uint16_t)(uint8_t)str[i-1]; - } - return oss.str(); -} - MessageStoreImpl::StoreOptions::StoreOptions(const std::string& name_) : qpid::Options(name_), truncateFlag(defTruncateFlag), -- cgit v1.2.1