rhmessaging commits: r3088 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-30 13:50:40 -0500 (Fri, 30 Jan 2009)
New Revision: 3088
Modified:
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
Final fix for BZ466533 - "Journal read tests fail occasionally with error JERR_RMGR_UNKNOWNMAGIC".
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-30 17:42:21 UTC (rev 3087)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-30 18:50:40 UTC (rev 3088)
@@ -226,13 +226,8 @@
case RHM_JDAT_EMPTY_MAGIC:
consume_filler();
break;
- case 0:
- return RHM_IORES_EMPTY;
default:
- std::ostringstream oss;
- oss << std::hex << std::setfill('0');
- oss << "Magic=0x" << std::setw(8) << _hdr._magic << std::dec;
- throw jexception(jerrno::JERR_RMGR_UNKNOWNMAGIC, oss.str(), "rmgr", "read");
+ return RHM_IORES_EMPTY;
}
}
}
15 years, 11 months
rhmessaging commits: r3087 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-30 12:42:21 -0500 (Fri, 30 Jan 2009)
New Revision: 3087
Modified:
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
Fix for one of the BZ466533 (JERR_RMGR_UNKNOWNMAGIC) errors in which the Magic=0x00000000.
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-30 17:02:05 UTC (rev 3086)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-30 17:42:21 UTC (rev 3087)
@@ -226,6 +226,8 @@
case RHM_JDAT_EMPTY_MAGIC:
consume_filler();
break;
+ case 0:
+ return RHM_IORES_EMPTY;
default:
std::ostringstream oss;
oss << std::hex << std::setfill('0');
15 years, 11 months
rhmessaging commits: r3086 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-30 12:02:05 -0500 (Fri, 30 Jan 2009)
New Revision: 3086
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
Log:
Corrected two bad asserts in class MessageStoreImpl which never trigger; these could potentially cause hanging instead of halting the broker.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-01-30 16:28:22 UTC (rev 3085)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-01-30 17:02:05 UTC (rev 3086)
@@ -243,7 +243,7 @@
bool autoJrnlExpand;
u_int16_t autoJrnlExpandMaxFiles;
chkJrnlAutoExpandOptions(opts, autoJrnlExpand, autoJrnlExpandMaxFiles, "auto-expand-max-jfiles", numJrnlFiles, "num-jfiles");
-
+
// Pass option values to init(...)
return init(opts->storeDir, numJrnlFiles, jrnlFsizePgs, jrnlWrCachePageSizeKib, tplNumJrnlFiles, tplJrnlFSizePgs, tplJrnlWrCachePageSizeKib, autoJrnlExpand, autoJrnlExpandMaxFiles);
}
@@ -934,7 +934,9 @@
read = false;
break; // done with all messages. (add call in jrnl to test that _emap is empty.)
default:
- assert("Store Error: Unexpected msg state");
+ std::ostringstream oss;
+ oss << "recoverMessages(): Queue: " << queue->getName() << ": Unexpected return from journal read: " << mrg::journal::iores_str(res);
+ THROW_STORE_EXCEPTION(oss.str());
} // switch
} // while
} catch (const journal::jexception& e) {
@@ -1028,7 +1030,8 @@
while (!done) {
dtok.reset();
dtok.set_wstate(DataTokenImpl::ENQ);
- switch (tplStorePtr->read_data_record(&dbuff, dbuffSize, &xidbuff, xidbuffSize, transientFlag, externalFlag, &dtok)) {
+ mrg::journal::iores res = tplStorePtr->read_data_record(&dbuff, dbuffSize, &xidbuff, xidbuffSize, transientFlag, externalFlag, &dtok);
+ switch (res) {
case mrg::journal::RHM_IORES_SUCCESS: {
// Every TPL record contains both data and an XID
assert(dbuffSize>0);
@@ -1085,7 +1088,9 @@
done = true;
break; // done with all messages. (add call in jrnl to test that _emap is empty.)
default:
- assert("Store Error: Unexpected msg state");
+ std::ostringstream oss;
+ oss << "readTplStore(): Unexpected result from journal read: " << mrg::journal::iores_str(res);
+ THROW_STORE_EXCEPTION(oss.str());
} // switch
}
} catch (const journal::jexception& e) {
@@ -1277,7 +1282,7 @@
Dbt key (&messageId, sizeof(messageId));
char *buffer = new char[length];
Dbt value(buffer, length);
-
+
// Read the first 4 bytes (u_int32_t) which is the header size.
value.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
value.set_ulen(sizeof(u_int32_t));
@@ -1758,7 +1763,7 @@
u_int32_t MessageStoreImpl::bHash(const std::string str)
{
- // Daniel Bernstein hash fn
+ // Daniel Bernstein hash fn
u_int32_t h = 0;
for (std::string::const_iterator i = str.begin(); i < str.end(); i++)
h = 33*h + *i;
15 years, 11 months
rhmessaging commits: r3085 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-30 11:28:22 -0500 (Fri, 30 Jan 2009)
New Revision: 3085
Modified:
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
reverting checkin 3081 - this is a regression and breaks some tests.
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-30 15:11:14 UTC (rev 3084)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-30 16:28:22 UTC (rev 3085)
@@ -288,22 +288,19 @@
}
else // File header reads have no pcb
{
- if (!_rrfc.subm_cnt_dblks() >= JRNL_SBLK_SIZE)
- {
- std::memcpy(&_fhdr, _fhdr_buffer, sizeof(file_hdr));
- _rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
+ std::memcpy(&_fhdr, _fhdr_buffer, sizeof(file_hdr));
+ _rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
- u_int32_t fro_dblks = (_fhdr._fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
- _pg_cntr = fro_dblks / (JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE);
- u_int32_t tot_pg_offs_dblks = _pg_cntr * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
- _pg_index = _pg_cntr % JRNL_RMGR_PAGES;
- _pg_offset_dblks = fro_dblks - tot_pg_offs_dblks;
- _rrfc.add_subm_cnt_dblks(tot_pg_offs_dblks);
- _rrfc.add_cmpl_cnt_dblks(tot_pg_offs_dblks);
+ u_int32_t fro_dblks = (_fhdr._fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
+ _pg_cntr = fro_dblks / (JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE);
+ u_int32_t tot_pg_offs_dblks = _pg_cntr * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
+ _pg_index = _pg_cntr % JRNL_RMGR_PAGES;
+ _pg_offset_dblks = fro_dblks - tot_pg_offs_dblks;
+ _rrfc.add_subm_cnt_dblks(tot_pg_offs_dblks);
+ _rrfc.add_cmpl_cnt_dblks(tot_pg_offs_dblks);
- _fhdr_rd_outstanding = false;
- _rrfc.set_valid();
- }
+ _fhdr_rd_outstanding = false;
+ _rrfc.set_valid();
}
}
15 years, 11 months
rhmessaging commits: r3084 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-01-30 10:11:14 -0500 (Fri, 30 Jan 2009)
New Revision: 3084
Modified:
mgmt/trunk/cumin/python/cumin/pool.py
mgmt/trunk/cumin/python/cumin/pool.strings
Log:
Add title and help text to machine visualization.
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2009-01-30 12:39:00 UTC (rev 3083)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2009-01-30 15:11:14 UTC (rev 3084)
@@ -454,8 +454,11 @@
return action.get_boxes(session, pool)
def render_title(self, session):
- return ""
+ return "Machines"
+ def render_vis_help(self, session):
+ return "Click on a machine to view its slots"
+
def get_1st_machine(self, session):
pool = self.frame.get_args(session)[0]
action = self.app.model.pool.machines
Modified: mgmt/trunk/cumin/python/cumin/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.strings 2009-01-30 12:39:00 UTC (rev 3083)
+++ mgmt/trunk/cumin/python/cumin/pool.strings 2009-01-30 15:11:14 UTC (rev 3084)
@@ -142,7 +142,7 @@
[ShowAllSlots.html]
<div style="margin:1em;">
- <a href="{href}"><button class="{class}" type="button" tabindex="100" >Show All Slots</button></a>
+ <a href="{href}"><button class="{class}" type="button" tabindex="100" >Show All Machines</button></a>
</div>
[MachineVisualization.javascript]
15 years, 11 months
rhmessaging commits: r3083 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-30 07:39:00 -0500 (Fri, 30 Jan 2009)
New Revision: 3083
Modified:
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
Stricter test for condition behind BZ480964
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-30 11:58:30 UTC (rev 3082)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-30 12:39:00 UTC (rev 3083)
@@ -275,7 +275,7 @@
if (pcbp) // Page reads have pcb
{
- if (!pcbp->_rfh->rd_void()) // Detects if write reset of this fcntl obj has occurred.
+ if (pcbp->_rfh->rd_subm_cnt_dblks() >= JRNL_SBLK_SIZE) // Detects if write reset of this fcntl obj has occurred.
{
// Increment the completed read offset
// NOTE: We cannot use _rrfc here, as it may have rotated since submitting count.
@@ -288,7 +288,7 @@
}
else // File header reads have no pcb
{
- if (!_rrfc.is_void())
+ if (!_rrfc.subm_cnt_dblks() >= JRNL_SBLK_SIZE)
{
std::memcpy(&_fhdr, _fhdr_buffer, sizeof(file_hdr));
_rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
15 years, 11 months
rhmessaging commits: r3082 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-30 06:58:30 -0500 (Fri, 30 Jan 2009)
New Revision: 3082
Modified:
store/trunk/cpp/lib/jrnl/aio.cpp
store/trunk/cpp/lib/jrnl/aio.hpp
Log:
Additional comments for class aio
Modified: store/trunk/cpp/lib/jrnl/aio.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/aio.cpp 2009-01-29 21:06:00 UTC (rev 3081)
+++ store/trunk/cpp/lib/jrnl/aio.cpp 2009-01-30 11:58:30 UTC (rev 3082)
@@ -1,41 +1,39 @@
/**
-* \file aio.cpp
-*
-* Red Hat Messaging - Message Journal
-*
-* File containing code for class mrg::journal::aio (libaio interface
-* encapsulation). See comments in file aio.hpp for details.
-*
-* Copyright (C) 2007, 2008 Red Hat Inc.
-*
-* This file is part of Red Hat Messaging.
-*
-* Red Hat Messaging is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation; either
-* version 2.1 of the License, or (at your option) any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-* USA
-*
-* The GNU Lesser General Public License is available in the file COPYING.
-*/
+ * \file aio.cpp
+ *
+ * Red Hat Messaging - Message Journal
+ *
+ * File containing code for class mrg::journal::aio (libaio interface
+ * encapsulation). See comments in file aio.hpp for details.
+ *
+ * Copyright (C) 2007, 2008 Red Hat Inc.
+ *
+ * This file is part of Red Hat Messaging.
+ *
+ * Red Hat Messaging is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * The GNU Lesser General Public License is available in the file COPYING.
+ */
#include "aio.hpp"
-
namespace mrg
{
namespace journal
{
-
} // namespace journal
} // namespace mrg
Modified: store/trunk/cpp/lib/jrnl/aio.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/aio.hpp 2009-01-29 21:06:00 UTC (rev 3081)
+++ store/trunk/cpp/lib/jrnl/aio.hpp 2009-01-30 11:58:30 UTC (rev 3082)
@@ -1,32 +1,32 @@
/**
-* \file aio.hpp
-*
-* Red Hat Messaging - Message Journal
-*
-* This file contains an encapsulation of the libaio interface used
-* by the journal.
-*
-* Copyright 2007, 2008 Red Hat, Inc.
-*
-* This file is part of Red Hat Messaging.
-*
-* Red Hat Messaging is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation; either
-* version 2.1 of the License, or (at your option) any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-* USA
-*
-* The GNU Lesser General Public License is available in the file COPYING.
-*/
+ * \file aio.hpp
+ *
+ * Red Hat Messaging - Message Journal
+ *
+ * This file contains an encapsulation of the libaio interface used
+ * by the journal.
+ *
+ * Copyright 2007, 2008 Red Hat, Inc.
+ *
+ * This file is part of Red Hat Messaging.
+ *
+ * Red Hat Messaging is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * The GNU Lesser General Public License is available in the file COPYING.
+ */
#ifndef mrg_journal_aio_hpp
#define mrg_journal_aio_hpp
@@ -44,6 +44,10 @@
typedef iocb aio_cb;
typedef io_event aio_event;
+/**
+ * \brief This class is a C++ wrapper class for the libaio functions used by the journal. Note that only those
+ * functions used by the journal are included here. This is not a complete implementation of all libaio functions.
+ */
class aio
{
public:
@@ -62,24 +66,39 @@
return ::io_submit(ctx, nr, aios);
}
- static inline int getevents(io_context_t ctx, long min_nr, long nr, aio_event* events,
- timespec* timeout)
+ static inline int getevents(io_context_t ctx, long min_nr, long nr, aio_event* events, timespec* timeout)
{
return ::io_getevents(ctx, min_nr, nr, events, timeout);
}
- static inline void prep_pread(aio_cb* aiocbp, int fd, void* buf, std::size_t count,
- int64_t offset)
+ /**
+ * \brief This function allows iocbs to be initialized with a pointer that can be re-used. This prepares an
+ * aio_cb struct for read use. (This is a wrapper for libaio's ::io_prep_pread() function.)
+ *
+ * \param aiocbp Pointer to the aio_cb struct to be prepared.
+ * \param fd File descriptor to be used for read.
+ * \param buf Pointer to buffer in which read data is to be placed.
+ * \param count Number of bytes to read - buffer must be large enough.
+ * \param offset Offset within file from which data will be read.
+ */
+ static inline void prep_pread(aio_cb* aiocbp, int fd, void* buf, std::size_t count, int64_t offset)
{
::io_prep_pread(aiocbp, fd, buf, count, offset);
}
- // Special version of libaio's io_prep_pread() which preserves the value of the data
- // pointer. This allows iocbs to be initialized with a pointer that can be re-used.
- static inline void prep_pread_2(aio_cb* aiocbp, int fd, void* buf, std::size_t count,
- int64_t offset)
+ /**
+ * \brief Special version of libaio's io_prep_pread() which preserves the value of the data pointer. This allows
+ * iocbs to be initialized with a pointer that can be re-used. This prepares a aio_cb struct for read use.
+ *
+ * \param aiocbp Pointer to the aio_cb struct to be prepared.
+ * \param fd File descriptor to be used for read.
+ * \param buf Pointer to buffer in which read data is to be placed.
+ * \param count Number of bytes to read - buffer must be large enough.
+ * \param offset Offset within file from which data will be read.
+ */
+ static inline void prep_pread_2(aio_cb* aiocbp, int fd, void* buf, std::size_t count, int64_t offset)
{
- std::memset((void*)((char*)aiocbp + sizeof(void*)), 0, sizeof(aio_cb) - sizeof(void*));
+ std::memset((void*) ((char*) aiocbp + sizeof(void*)), 0, sizeof(aio_cb) - sizeof(void*));
aiocbp->aio_fildes = fd;
aiocbp->aio_lio_opcode = IO_CMD_PREAD;
aiocbp->aio_reqprio = 0;
@@ -88,18 +107,35 @@
aiocbp->u.c.offset = offset;
}
- static inline void prep_pwrite(aio_cb* aiocbp, int fd, void* buf, std::size_t count,
- int64_t offset)
+ /**
+ * \brief This function allows iocbs to be initialized with a pointer that can be re-used. This function prepares
+ * an aio_cb struct for write use. (This is a wrapper for libaio's ::io_prep_pwrite() function.)
+ *
+ * \param aiocbp Pointer to the aio_cb struct to be prepared.
+ * \param fd File descriptor to be used for write.
+ * \param buf Pointer to buffer in which data to be written is located.
+ * \param count Number of bytes to write.
+ * \param offset Offset within file to which data will be written.
+ */
+ static inline void prep_pwrite(aio_cb* aiocbp, int fd, void* buf, std::size_t count, int64_t offset)
{
::io_prep_pwrite(aiocbp, fd, buf, count, offset);
}
- // Special version of libaio's io_prep_pwrite() which preserves the value of the data
- // pointer. This allows iocbs to be initialized with a pointer that can be re-used.
- static inline void prep_pwrite_2(aio_cb* aiocbp, int fd, void* buf, std::size_t count,
- int64_t offset)
+ /**
+ * \brief Special version of libaio's io_prep_pwrite() which preserves the value of the data pointer. This allows
+ * iocbs to be initialized with a pointer that can be re-used. This function prepares an aio_cb struct for write
+ * use.
+ *
+ * \param aiocbp Pointer to the aio_cb struct to be prepared.
+ * \param fd File descriptor to be used for write.
+ * \param buf Pointer to buffer in which data to be written is located.
+ * \param count Number of bytes to write.
+ * \param offset Offset within file to which data will be written.
+ */
+ static inline void prep_pwrite_2(aio_cb* aiocbp, int fd, void* buf, std::size_t count, int64_t offset)
{
- std::memset((void*)((char*)aiocbp + sizeof(void*)), 0, sizeof(aio_cb) - sizeof(void*));
+ std::memset((void*) ((char*) aiocbp + sizeof(void*)), 0, sizeof(aio_cb) - sizeof(void*));
aiocbp->aio_fildes = fd;
aiocbp->aio_lio_opcode = IO_CMD_PWRITE;
aiocbp->aio_reqprio = 0;
15 years, 11 months
rhmessaging commits: r3081 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-29 16:06:00 -0500 (Thu, 29 Jan 2009)
New Revision: 3081
Modified:
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
Additional code path for BZ480964 found and fixed.
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-29 19:26:34 UTC (rev 3080)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-29 21:06:00 UTC (rev 3081)
@@ -288,19 +288,22 @@
}
else // File header reads have no pcb
{
- std::memcpy(&_fhdr, _fhdr_buffer, sizeof(file_hdr));
- _rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
+ if (!_rrfc.is_void())
+ {
+ std::memcpy(&_fhdr, _fhdr_buffer, sizeof(file_hdr));
+ _rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
- u_int32_t fro_dblks = (_fhdr._fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
- _pg_cntr = fro_dblks / (JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE);
- u_int32_t tot_pg_offs_dblks = _pg_cntr * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
- _pg_index = _pg_cntr % JRNL_RMGR_PAGES;
- _pg_offset_dblks = fro_dblks - tot_pg_offs_dblks;
- _rrfc.add_subm_cnt_dblks(tot_pg_offs_dblks);
- _rrfc.add_cmpl_cnt_dblks(tot_pg_offs_dblks);
+ u_int32_t fro_dblks = (_fhdr._fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
+ _pg_cntr = fro_dblks / (JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE);
+ u_int32_t tot_pg_offs_dblks = _pg_cntr * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
+ _pg_index = _pg_cntr % JRNL_RMGR_PAGES;
+ _pg_offset_dblks = fro_dblks - tot_pg_offs_dblks;
+ _rrfc.add_subm_cnt_dblks(tot_pg_offs_dblks);
+ _rrfc.add_cmpl_cnt_dblks(tot_pg_offs_dblks);
- _fhdr_rd_outstanding = false;
- _rrfc.set_valid();
+ _fhdr_rd_outstanding = false;
+ _rrfc.set_valid();
+ }
}
}
15 years, 11 months
rhmessaging commits: r3080 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-29 14:26:34 -0500 (Thu, 29 Jan 2009)
New Revision: 3080
Modified:
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
Possible fix for BZ480964 - "JERR_FCNTL_CMPLOFFSOVFL during flow-to-disk". Additional testing will be required to confirm the fix.
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-29 16:29:19 UTC (rev 3079)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-01-29 19:26:34 UTC (rev 3080)
@@ -103,7 +103,7 @@
{
aio_cycle(); // check if rd AIOs returned; initiate new reads if possible
return RHM_IORES_PAGE_AIOWAIT;
- }
+ }
const iores res = skip(dtokp);
if (res != RHM_IORES_SUCCESS)
{
@@ -275,13 +275,16 @@
if (pcbp) // Page reads have pcb
{
- // Increment the completed read offset
- // NOTE: We cannot use _rrfc here, as it may have rotated since submitting count.
- // Use stored pointer to fcntl in the pcb instead.
- pcbp->_rdblks = aiocbp->u.c.nbytes / JRNL_DBLK_SIZE;
- pcbp->_rfh->add_rd_cmpl_cnt_dblks(pcbp->_rdblks);
- pcbp->_state = state;
- pil[i] = pcbp->_index;
+ if (!pcbp->_rfh->rd_void()) // Detects if write reset of this fcntl obj has occurred.
+ {
+ // Increment the completed read offset
+ // NOTE: We cannot use _rrfc here, as it may have rotated since submitting count.
+ // Use stored pointer to fcntl in the pcb instead.
+ pcbp->_rdblks = aiocbp->u.c.nbytes / JRNL_DBLK_SIZE;
+ pcbp->_rfh->add_rd_cmpl_cnt_dblks(pcbp->_rdblks);
+ pcbp->_state = state;
+ pil[i] = pcbp->_index;
+ }
}
else // File header reads have no pcb
{
@@ -318,7 +321,7 @@
_rrfc.set_invalid();
}
-#define MAX_AIO_SLEEPS 1000 // 10 sec
+#define MAX_AIO_SLEEPS 1000 // 10 sec
#define AIO_SLEEP_TIME 10000 // 10 ms
void
rmgr::init_validation()
@@ -356,7 +359,7 @@
get_events();
if (!_rrfc.is_valid())
- return RHM_IORES_RCINVALID;
+ return RHM_IORES_RCINVALID;
// block reads until outstanding file header read completes as fro is needed to read
if (_fhdr_rd_outstanding)
@@ -583,7 +586,7 @@
}
if (_rrfc.is_void()) // Nothing to do; this file not yet written to
break;
-
+
if (_rrfc.subm_offs() == 0)
{
_rrfc.add_subm_cnt_dblks(JRNL_SBLK_SIZE);
15 years, 11 months
rhmessaging commits: r3079 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-29 11:29:19 -0500 (Thu, 29 Jan 2009)
New Revision: 3079
Modified:
store/trunk/cpp/lib/jrnl/jcntl.hpp
Log:
Fixed some selling errors and typos in comments in jcntl.hpp
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2009-01-28 17:58:51 UTC (rev 3078)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2009-01-29 16:29:19 UTC (rev 3079)
@@ -70,12 +70,12 @@
/**
* \brief Journal ID
*
- * This string uniquly identifies this journal instance. It will most likely be associated
+ * This string uniquely identifies this journal instance. It will most likely be associated
* with the identity of the message queue with which it is associated.
*/
// TODO: This is not included in any files at present, add to file_hdr?
std::string _jid;
-
+
/**
* \brief Journal directory
*
@@ -98,7 +98,7 @@
/**
* \brief Initialized flag
*
- * This flag starts out set to false, is set to true once this object has been initilaized,
+ * This flag starts out set to false, is set to true once this object has been initialized,
* either by calling initialize() or recover().
*/
bool _init_flag;
@@ -117,9 +117,9 @@
/**
* \brief Read-only state flag used during recover.
- *
+ *
* When true, this flag prevents journal write operations (enqueue and dequeue), but
- * allows read to occur. It is used durning recovery, and is reset when recovered() is
+ * allows read to occur. It is used during recovery, and is reset when recovered() is
* called.
*/
bool _readonly_flag;
@@ -160,7 +160,7 @@
* \brief Destructor.
*/
virtual ~jcntl();
-
+
inline const std::string& id() const { return _jid; }
inline const std::string& jrnl_dir() const { return _jdir.dirname(); }
@@ -187,7 +187,7 @@
* maximum total number of files allowed in the journal (original plus those added by auto-expand mode). If
* this number of files exist and the journal runs out of space, an exception will be thrown. This number
* must be greater than the num_jfiles parameter value but cannot exceed the maximum number of files for a
- * single journal; if num_jfiles is already at its maximum value, then auto-expand wil be disabled.
+ * single journal; if num_jfiles is already at its maximum value, then auto-expand will be disabled.
* \param jfsize_sblks The size of each journal file expressed in softblocks.
* \param wcache_num_pages The number of write cache pages to create.
* \param wcache_pgsize_sblks The size in sblks of each write cache page.
@@ -203,7 +203,7 @@
* /brief Initialize journal by recovering state from previously written journal.
*
* Initialize journal by recovering state from previously written journal. The journal files
- * are analyzed, and all records that have not been dequeued and that remain in the jouranl
+ * are analyzed, and all records that have not been dequeued and that remain in the journal
* will be available for reading. The journal is placed in a read-only state until
* recovered() is called; any calls to enqueue or dequeue will fail with an exception
* in this state.
@@ -222,7 +222,7 @@
* maximum total number of files allowed in the journal (original plus those added by auto-expand mode). If
* this number of files exist and the journal runs out of space, an exception will be thrown. This number
* must be greater than the num_jfiles parameter value but cannot exceed the maximum number of files for a
- * single journal; if num_jfiles is already at its maximum value, then auto-expand wil be disabled.
+ * single journal; if num_jfiles is already at its maximum value, then auto-expand will be disabled.
* \param jfsize_sblks The size of each journal file expressed in softblocks.
* \param wcache_num_pages The number of write cache pages to create.
* \param wcache_pgsize_sblks The size in sblks of each write cache page.
@@ -330,7 +330,7 @@
*
* If <i>dsize_avail</i> < <i>dsize</i>, then not all of the data is available or part of
* the data is in non-contiguous memory, and a subsequent call will update both the pointer
- * and <i>dsize_avail</i> if more pages have returned from AIO.
+ * and <i>dsize_avail</i> if more pages have returned from AIO.
*
* The <i>dsize_avail</i> parameter will return the amount of data from this record that is
* available in the page cache as contiguous memory, even if it spans page cache boundaries.
@@ -343,7 +343,7 @@
* this function. It must be consumed prior to getting the next record. This can be done by
* calling discard_data_record() or read_data_record(). However, if parameter
* <i>auto_discard</i> is set to <b><i>true</i></b>, then this record will be automatically
- * consumed when the entire record has become available whithout having to explicitly call
+ * consumed when the entire record has become available without having to explicitly call
* discard_next_data_record() or read_data_record().
*
* If the current record is an open transactional record, then it cannot be read until it is
@@ -373,7 +373,7 @@
* \param data Pointer to data pointer which will point to the first byte of the next record
* data.
* \param auto_discard If <b><i>true</i></b>, automatically discard the record being read if
- * the entire record is avialable (i.e. dsize == dsize_avail). Otherwise
+ * the entire record is available (i.e. dsize == dsize_avail). Otherwise
* discard_next_data_record() must be explicitly called.
*
* \exception TODO
@@ -395,7 +395,7 @@
/**
* \brief Reads data from the journal. It is the responsibility of the reader to free
- * the memeory that is allocated through this call - see below for detials.
+ * the memory that is allocated through this call - see below for details.
*
* Reads the next non-dequeued data record from the journal.
*
@@ -539,11 +539,11 @@
/**
* \brief Stop the journal from accepting any further requests to read or write data.
*
- * This operation is used to stop the jouranl. This is the normal mechanism for bringing the
+ * This operation is used to stop the journal. This is the normal mechanism for bringing the
* journal to an orderly stop. Any outstanding AIO operations or partially written pages in
* the write page cache will by flushed and will complete.
*
- * <b>Note:</b> The jouranl cannot be restarted without either initailizing it or restoring
+ * <b>Note:</b> The journal cannot be restarted without either initializing it or restoring
* it.
*
* \param block_till_aio_cmpl If true, will block the thread while waiting for all
@@ -588,7 +588,7 @@
inline u_int32_t get_open_txn_cnt() const { return _tmap.size(); }
// TODO Make this a const, but txn_map must support const first.
inline txn_map& get_txn_map() { return _tmap; }
-
+
/**
* \brief Check if the journal is stopped.
*
@@ -600,14 +600,14 @@
/**
* \brief Check if the journal is ready to read and write data.
*
- * Checks if the jouranl is ready to read and write data. This function will return
+ * Checks if the journal is ready to read and write data. This function will return
* <b><i>true</i></b> if the journal has been either initialized or restored, and the stop()
* function has not been called since the initialization.
*
- * Note that the jouranl may also be stopped if an internal error occurs (such as running out
- * of data jouranl file space).
+ * Note that the journal may also be stopped if an internal error occurs (such as running out
+ * of data journal file space).
*
- * \return <b><i>true</i></b> if the jouranl is ready to read and write data;
+ * \return <b><i>true</i></b> if the journal is ready to read and write data;
* <b><i>false</i></b> otherwise.
*/
inline bool is_ready() const { return _init_flag && !_stop_flag; }
@@ -637,12 +637,12 @@
inline fcntl* get_fcntlp(const u_int16_t lfid) const { return _lpmgr.get_fcntlp(lfid); }
inline u_int32_t jfsize_sblks() const { return _jfsize_sblks; }
-
+
// Logging
virtual void log(log_level level, const std::string& log_stmt) const;
virtual void log(log_level level, const char* const log_stmt) const;
- // FIXME these are _rmgr to _wmgr interactions, remove when _rmgr contains ref to _wmgr:
+ // FIXME these are _rmgr to _wmgr interactions, remove when _rmgr contains ref to _wmgr:
void chk_wr_frot();
inline u_int32_t unflushed_dblks() { return _wmgr.unflushed_dblks(); }
void fhdr_wr_sync(const u_int16_t lid);
@@ -695,10 +695,10 @@
bool jfile_cycle(u_int16_t& fid, std::ifstream* ifsp, bool& lowi, rcvdat& rd,
const bool jump_fro);
-
+
bool check_owi(const u_int16_t fid, rec_hdr& h, bool& lowi, rcvdat& rd,
std::streampos& read_pos);
-
+
void check_journal_alignment(const u_int16_t fid, std::streampos& rec_offset);
};
15 years, 11 months