Author: kpvdr
Date: 2010-07-22 13:08:58 -0400 (Thu, 22 Jul 2010)
New Revision: 4144
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jrec.hpp
store/trunk/cpp/lib/jrnl/txn_rec.hpp
Log:
Fix for BZ617209 "Store: Recovery failure (JERR_MAP_NOTFOUND:)". Corrected
incorrect logic; all tests (including the long tests) now pass.
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2010-07-22 15:03:47 UTC (rev 4143)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2010-07-22 17:08:58 UTC (rev 4144)
@@ -747,16 +747,7 @@
else
{
int16_t enq_fid = _emap.get_remove_pfid(dr.deq_rid(), true);
- if (enq_fid < enq_map::EMAP_OK) // fail
- {
- if (enq_fid == enq_map::EMAP_RID_NOT_FOUND)
- {
- std::ostringstream oss;
- oss << std::hex << "_emap.get_remove_pfid():
drid=0x" << dr.deq_rid();
- throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(),
"jcntl", "rcvr_get_next_record");
- }
- }
- else
+ if (enq_fid >= enq_map::EMAP_OK) // ignore not found error
rd._enq_cnt_list[enq_fid]--;
}
}
@@ -805,18 +796,9 @@
}
else // txn dequeue
{
- int16_t fid = _emap.get_remove_pfid(itr->_drid, true);
- if (fid < 0)
- {
- if (fid == enq_map::EMAP_RID_NOT_FOUND)
- {
- std::ostringstream oss;
- oss << std::hex <<
"_emap.get_remove_pfid(): drid=0x" << itr->_drid;
- throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(),
"jcntl", "rcvr_get_next_record");
- }
- }
- else
- rd._enq_cnt_list[fid]--;
+ int16_t enq_fid = _emap.get_remove_pfid(itr->_drid, true);
+ if (enq_fid >= enq_map::EMAP_OK)
+ rd._enq_cnt_list[enq_fid]--;
}
}
std::free(xidp);
Modified: store/trunk/cpp/lib/jrnl/jrec.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jrec.hpp 2010-07-22 15:03:47 UTC (rev 4143)
+++ store/trunk/cpp/lib/jrnl/jrec.hpp 2010-07-22 17:08:58 UTC (rev 4144)
@@ -165,6 +165,7 @@
{ return size_blks(size, JRNL_DBLK_SIZE * JRNL_SBLK_SIZE); }
static inline u_int32_t size_blks(const std::size_t size, const std::size_t
blksize)
{ return (size + blksize - 1)/blksize; }
+ virtual u_int64_t rid() const = 0;
protected:
virtual void chk_hdr() const = 0;
Modified: store/trunk/cpp/lib/jrnl/txn_rec.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_rec.hpp 2010-07-22 15:03:47 UTC (rev 4143)
+++ store/trunk/cpp/lib/jrnl/txn_rec.hpp 2010-07-22 17:08:58 UTC (rev 4144)
@@ -86,6 +86,7 @@
inline std::size_t data_size() const { return 0; } // This record never carries
data
std::size_t xid_size() const;
std::size_t rec_size() const;
+ inline u_int64_t rid() const { return _txn_hdr._rid; }
private:
void chk_hdr() const;
Show replies by date