[rhmessaging-commits] rhmessaging commits: r2470 - store/trunk/cpp/lib/jrnl.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Fri Sep 12 16:18:12 EDT 2008
Author: kpvdr
Date: 2008-09-12 16:18:12 -0400 (Fri, 12 Sep 2008)
New Revision: 2470
Modified:
store/trunk/cpp/lib/jrnl/deq_rec.cpp
store/trunk/cpp/lib/jrnl/enq_rec.cpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/txn_rec.cpp
Log:
Backport of fix for BZ462121 "assert during journal recovery (intermittent)".
Modified: store/trunk/cpp/lib/jrnl/deq_rec.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/deq_rec.cpp 2008-09-12 20:17:38 UTC (rev 2469)
+++ store/trunk/cpp/lib/jrnl/deq_rec.cpp 2008-09-12 20:18:12 UTC (rev 2470)
@@ -353,6 +353,7 @@
assert(ifsp->eof());
// As we may have read past eof, turn off fail bit
ifsp->clear(ifsp->rdstate()&(~std::ifstream::failbit));
+ assert(!ifsp->fail() && !ifsp->bad());
return false;
}
}
@@ -369,12 +370,14 @@
assert(ifsp->eof());
// As we may have read past eof, turn off fail bit
ifsp->clear(ifsp->rdstate()&(~std::ifstream::failbit));
+ assert(!ifsp->fail() && !ifsp->bad());
return false;
}
}
ifsp->ignore(rec_size_dblks() * JRNL_DBLK_SIZE - rec_size());
if (_deq_hdr._xidsize)
chk_tail(); // Throws if tail invalid or record incomplete
+ assert(ifsp->good());
return true;
}
Modified: store/trunk/cpp/lib/jrnl/enq_rec.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_rec.cpp 2008-09-12 20:17:38 UTC (rev 2469)
+++ store/trunk/cpp/lib/jrnl/enq_rec.cpp 2008-09-12 20:18:12 UTC (rev 2470)
@@ -471,6 +471,7 @@
assert(ifsp->eof());
// As we may have read past eof, turn off fail bit
ifsp->clear(ifsp->rdstate()&(~std::ifstream::failbit));
+ assert(!ifsp->fail() && !ifsp->bad());
return false;
}
}
@@ -488,6 +489,7 @@
assert(ifsp->eof());
// As we may have read past eof, turn off fail bit
ifsp->clear(ifsp->rdstate()&(~std::ifstream::failbit));
+ assert(!ifsp->fail() && !ifsp->bad());
return false;
}
}
@@ -507,11 +509,13 @@
assert(ifsp->eof());
// As we may have read past eof, turn off fail bit
ifsp->clear(ifsp->rdstate()&(~std::ifstream::failbit));
+ assert(!ifsp->fail() && !ifsp->bad());
return false;
}
}
ifsp->ignore(rec_size_dblks() * JRNL_DBLK_SIZE - rec_size());
chk_tail(); // Throws if tail invalid or record incomplete
+ assert(ifsp->good());
return true;
}
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-09-12 20:17:38 UTC (rev 2469)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-09-12 20:18:12 UTC (rev 2470)
@@ -677,8 +677,13 @@
ifsp->read((char*)&h, sizeof(rec_hdr));
if (ifsp->gcount() == sizeof(rec_hdr))
hdr_ok = true;
- else if (!jfile_cycle(fid, ifsp, lowi, rd, true))
- return false;
+ else
+ {
+ ifsp->clear(ifsp->rdstate()&(~std::ifstream::failbit));
+ assert(!ifsp->fail() && !ifsp->bad());
+ if (!jfile_cycle(fid, ifsp, lowi, rd, true))
+ return false;
+ }
}
switch(h._magic)
@@ -814,6 +819,7 @@
{
u_int32_t rec_dblks = jrec::size_dblks(sizeof(rec_hdr));
ifsp->ignore(rec_dblks * JRNL_DBLK_SIZE - sizeof(rec_hdr));
+ assert(ifsp->good());
if (!jfile_cycle(fid, ifsp, lowi, rd, false))
return false;
}
@@ -892,6 +898,7 @@
// Read file header
file_hdr fhdr;
ifsp->read((char*)&fhdr, sizeof(fhdr));
+ assert(ifsp->good());
if (fhdr._magic == RHM_JDAT_FILE_MAGIC)
{
assert(fhdr._fid == fid);
Modified: store/trunk/cpp/lib/jrnl/txn_rec.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_rec.cpp 2008-09-12 20:17:38 UTC (rev 2469)
+++ store/trunk/cpp/lib/jrnl/txn_rec.cpp 2008-09-12 20:18:12 UTC (rev 2470)
@@ -341,6 +341,7 @@
assert(ifsp->eof());
// As we may have read past eof, turn off fail bit
ifsp->clear(ifsp->rdstate()&(~std::ifstream::failbit));
+ assert(!ifsp->fail() && !ifsp->bad());
return false;
}
}
@@ -356,11 +357,13 @@
assert(ifsp->eof());
// As we may have read past eof, turn off fail bit
ifsp->clear(ifsp->rdstate()&(~std::ifstream::failbit));
+ assert(!ifsp->fail() && !ifsp->bad());
return false;
}
}
ifsp->ignore(rec_size_dblks() * JRNL_DBLK_SIZE - rec_size());
chk_tail(); // Throws if tail invalid or record incomplete
+ assert(ifsp->good());
return true;
}
More information about the rhmessaging-commits
mailing list