rhmessaging commits: r1998 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-06 13:44:31 -0400 (Tue, 06 May 2008)
New Revision: 1998
Modified:
mgmt/mint/python/mint/__init__.py
Log:
Handle case where mint_info table is missing
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-05-05 20:39:52 UTC (rev 1997)
+++ mgmt/mint/python/mint/__init__.py 2008-05-06 17:44:31 UTC (rev 1998)
@@ -493,13 +493,17 @@
try:
cursor = conn.cursor()
- cursor.execute("select version from mint_info");
+ try:
+ cursor.execute("select version from mint_info");
+ except Exception, e:
+ print "No schema present"
+ return
+
for rec in cursor:
print "OK (version %s)" % rec[0]
return;
print "No schema present"
-
finally:
conn.close()
16 years, 10 months
rhmessaging commits: r1997 - in mgmt: mint/python/mint and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-05 16:39:52 -0400 (Mon, 05 May 2008)
New Revision: 1997
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/mint/python/mint/__init__.py
mgmt/mint/sql/schema.sql
Log:
This revision requires you to reload your database schema.
Changes the registration-broker association to be 1:1.
Also contains an initial and still non-functional implementation of
mgmt session protection.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-05-05 20:26:34 UTC (rev 1996)
+++ mgmt/cumin/python/cumin/model.py 2008-05-05 20:39:52 UTC (rev 1997)
@@ -13,7 +13,7 @@
class CuminModel(object):
def __init__(self, app, data_uri, spec_path):
self.app = app
- self.data = MintModel(data_uri, spec_path)
+ self.data = MintModel(data_uri, spec_path, debug=True)
self.classes = list()
self.invocations = set()
@@ -524,7 +524,7 @@
return "resource?name=broker-36.png"
def show_object(self, session, broker):
- reg = broker.registrations[0]
+ reg = broker.registration
return self.cumin_model.show_main(session).show_broker(session, reg)
def get_object_name(self, broker):
@@ -703,7 +703,7 @@
def show_object(self, session, queue):
frame = self.cumin_model.show_main(session)
- frame = frame.show_broker(session, queue.vhost.broker.registrations[0])
+ frame = frame.show_broker(session, queue.vhost.broker.registration)
return frame.show_queue(session, queue)
class Purge(CuminAction):
@@ -771,7 +771,7 @@
def show_object(self, session, exchange):
frame = self.cumin_model.show_main(session)
- frame = frame.show_broker(exchange.vhost.broker.registrations[0])
+ frame = frame.show_broker(exchange.vhost.broker.registration)
return frame.show_queue(session, exchange)
def get_title(self, session):
@@ -842,8 +842,7 @@
def show_object(self, session, client):
frame = self.cumin_model.show_main(session)
- frame = frame.show_broker(session,
- client.vhost.broker.registrations[0])
+ frame = frame.show_broker(session, client.vhost.broker.registration)
return frame.show_client(session, client)
def get_title(self, session):
@@ -864,6 +863,15 @@
return "Close"
def do_invoke(self, client, args, completion):
+ conn = self.cumin_model.data.getConnectionByObject(client)
+
+ # Does it contain a mgmt session?
+
+ for session in client.sessions:
+ if session.name == conn.getSessionId():
+ raise Exception \
+ ("Cannot close management client %s", client.address)
+
client.close(self.cumin_model.data, completion)
class CuminSession(RemoteClass):
@@ -906,6 +914,12 @@
return "Close"
def do_invoke(self, object, args, completion):
+ conn = self.cumin_model.data.getConnectionByObject(object)
+
+ if object.name == conn.getSessionId():
+ raise Exception \
+ ("Cannot close management session %s" % object.name)
+
object.close(self.cumin_model.data, completion)
class Detach(CuminAction):
@@ -913,6 +927,12 @@
return "Detach"
def do_invoke(self, object, args, completion):
+ conn = self.cumin_model.data.getConnectionByObject(object)
+
+ if object.name == conn.getSessionId():
+ raise Exception \
+ ("Cannot detach management session %s" % object.name)
+
object.detach(self.cumin_model.data, completion)
class ResetLifespan(CuminAction):
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-05-05 20:26:34 UTC (rev 1996)
+++ mgmt/mint/python/mint/__init__.py 2008-05-05 20:39:52 UTC (rev 1997)
@@ -23,8 +23,9 @@
except TypeError:
pass
-Broker.sqlmeta.addJoin(SQLMultipleJoin("BrokerRegistration",
- joinMethodName="registrations"))
+Broker.sqlmeta.addColumn(ForeignKey("BrokerRegistration",
+ cascade="null", default=None,
+ name="registration"))
class MintInfo(SQLObject):
class sqlmeta:
@@ -149,14 +150,17 @@
if isinstance(obj, Broker) and obj.managedBroker:
host, port = obj.managedBroker.split(":")
port = int(port)
- existing = list(obj.registrations)
- regs = BrokerRegistration.selectBy(host=host, port=port)
- for reg in regs:
- if reg not in existing:
- log.info("Attaching broker to reg %s" % reg)
+ if not obj.registration:
+ try:
+ reg = BrokerRegistration.selectBy(host=host, port=port)[0]
+ except IndexError:
+ reg = None
+ if reg:
reg.broker = obj
+ obj.registration = reg
+
reg.syncUpdate()
obj.syncUpdate()
@@ -208,7 +212,7 @@
self.model.lock.release()
def getSessionId(self):
- if isOpen(self):
+ if self.isOpen():
return self.mchan.sessionId
else:
return None
@@ -397,6 +401,9 @@
self.outstandingMethodCalls[methodId] = callback
return methodId
+ def getConnectionByRegistration(self, reg):
+ return self.connections.get("%s:%i" % (reg.host, reg.port))
+
class MintDatabase(object):
def __init__(self, uri):
self.uri = uri
Modified: mgmt/mint/sql/schema.sql
===================================================================
--- mgmt/mint/sql/schema.sql 2008-05-05 20:26:34 UTC (rev 1996)
+++ mgmt/mint/sql/schema.sql 2008-05-05 20:39:52 UTC (rev 1997)
@@ -136,7 +136,8 @@
cluster_name VARCHAR(1000),
version VARCHAR(1000),
data_dir_enabled BOOL,
- data_dir VARCHAR(1000)
+ data_dir VARCHAR(1000),
+ registration_id INT
);
CREATE TABLE broker_stats (
@@ -480,6 +481,8 @@
ALTER TABLE broker ADD CONSTRAINT system_id_exists FOREIGN KEY (system_id) REFERENCES system (id) ON DELETE SET NULL;
+ALTER TABLE broker ADD CONSTRAINT registration_id_exists FOREIGN KEY (registration_id) REFERENCES broker_registration (id) ON DELETE SET NULL;
+
ALTER TABLE broker_stats ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE SET NULL;
ALTER TABLE client ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES client_stats (id) ON DELETE SET NULL;
16 years, 10 months
rhmessaging commits: r1996 - mgmt/mint/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-05 16:26:34 -0400 (Mon, 05 May 2008)
New Revision: 1996
Modified:
mgmt/mint/bin/mint-test
Log:
Use the non preview spec
Modified: mgmt/mint/bin/mint-test
===================================================================
--- mgmt/mint/bin/mint-test 2008-05-05 20:16:53 UTC (rev 1995)
+++ mgmt/mint/bin/mint-test 2008-05-05 20:26:34 UTC (rev 1996)
@@ -39,7 +39,7 @@
addr = "localhost:5672"
spec = os.environ.get("AMQP_SPEC",
- os.path.normpath("/usr/share/amqp/amqp.0-10-preview.xml"))
+ os.path.normpath("/usr/share/amqp/amqp.0-10.xml"))
host, port = addr.split(":")
try:
16 years, 10 months
rhmessaging commits: r1995 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-05 16:16:53 -0400 (Mon, 05 May 2008)
New Revision: 1995
Modified:
mgmt/cumin/python/cumin/client.py
Log:
Fix client cancel form navigation
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-05-05 14:58:54 UTC (rev 1994)
+++ mgmt/cumin/python/cumin/client.py 2008-05-05 20:16:53 UTC (rev 1995)
@@ -157,6 +157,8 @@
action = self.app.model.client.close
action.invoke(client)
+ self.process_cancel(session, client)
+
def render_title(self, session, client):
return "Close Client '%s'" % client.address
16 years, 10 months
rhmessaging commits: r1994 - in store/trunk/cpp: lib and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-05-05 10:58:54 -0400 (Mon, 05 May 2008)
New Revision: 1994
Modified:
store/trunk/cpp/configure.ac
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/jrnl/arr_cnt.hpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/nlfh.cpp
store/trunk/cpp/lib/jrnl/nlfh.hpp
store/trunk/cpp/lib/jrnl/rcvdat.hpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/rmgr.hpp
store/trunk/cpp/lib/jrnl/rrfc.cpp
store/trunk/cpp/lib/jrnl/rrfc.hpp
store/trunk/cpp/lib/jrnl/wrfc.cpp
store/trunk/cpp/tests/jrnl/_ut_jinf.cpp
Log:
Bugfix for 444592: "Store fails to recover large dequeued journals owing to RHM_IORES_PAGE_AIOWAIT". Some tidy-up too.
Modified: store/trunk/cpp/configure.ac
===================================================================
--- store/trunk/cpp/configure.ac 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/configure.ac 2008-05-05 14:58:54 UTC (rev 1994)
@@ -127,7 +127,7 @@
AC_SEARCH_LIBS([__db_open], [db_cxx-4.6 db_cxx-4.5 db_cxx-4.4 db_cxx-4.3],
[test "$ac_cv_search___db_open" = "none required" ||
LIB_BERKELEY_DB=$ac_cv_search___db_open],
- AC_MSG_ERROR([couldn't find required library: db_cxx-4.3]))
+ AC_MSG_ERROR([Couldn't find required library in range db_cxx-4.3 through db_cxx-4.6]))
AC_SUBST([LIB_BERKELEY_DB])
LIBS=$gl_saved_libs
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -561,6 +561,11 @@
DataTokenImpl dtokp;
size_t readSize = 0;
unsigned msg_count=0;
+
+ // TODO: This optimization to skip reading if there are no enqueued messages to read
+ // breaks the python system test in phase 6 with "Exception: Cannot write lock file"
+ // Figure out what is breaking.
+ //bool read = jc->get_enq_cnt() > 0;
bool read = true;
void* dbuff = NULL; size_t dbuffSize = 0;
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -183,6 +183,7 @@
std::ostringstream oss2;
oss2 << "Recover phase I complete; highest rid found = 0x" << std::hex << highest_rid;
oss2 << std::dec << "; emap.size=" << _emap.size() << "; tmap.size=" << _tmap.size();
+ oss2 << "; journal now read-only.";
log(LOG_DEBUG, oss2.str());
if (_mgmtObject.get() != 0)
@@ -194,6 +195,13 @@
}
}
+void
+JournalImpl::recover_complete()
+{
+ jcntl::recover_complete();
+ log(LOG_DEBUG, "Recover phase II complete; journal now writable.");
+}
+
#define MAX_AIO_SLEEPS 500
#define AIO_SLEEP_TIME 1000000
bool
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/JournalImpl.h 2008-05-05 14:58:54 UTC (rev 1994)
@@ -113,6 +113,8 @@
recover(num_jfiles, jfsize_sblks, 0, &aio_wr_callback, prep_tx_list, highest_rid,
queue_id);
}
+
+ void recover_complete();
// Temporary fn to read and save last msg read from journal so it can be assigned
// in chunks. To be replaced when coding to do this direct from the journal is ready.
Modified: store/trunk/cpp/lib/jrnl/arr_cnt.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/arr_cnt.hpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/arr_cnt.hpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -43,7 +43,7 @@
/**
* \class arr_cnt
* \brief Class which implements a dynamically allocated array of u_int32_t counters.
- * This is ideal where it is necessary to increment and decrement counts for an entuty
+ * This is ideal where it is necessary to increment and decrement counts for an entity
* for which the number of elements is unknown, but for which the efficiency of a static
* array is required. None of the counts may go below zero.
*/
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -139,7 +139,7 @@
// constrains read activity (i.e. one can't read what has not yet been written).
_wrfc.initialize(_num_jfiles, _jfsize_sblks, (nlfh**)_datafh);
_rrfc.initialize(_num_jfiles, (nlfh**)_datafh);
- _rmgr.initialize(rd_cb, 0);
+ _rmgr.initialize(rd_cb);
_wmgr.initialize(wr_cb, JRNL_WMGR_MAXDTOKPP, JRNL_WMGR_MAXWAITUS);
// Write info file (<basename>.jinf) to disk
@@ -187,7 +187,7 @@
if (_rcvdat._full)
throw jexception(jerrno::JERR_JCNTL_RECOVERJFULL, "jcntl", "recover");
- this->log(LOG_DEBUG, _rcvdat.to_string(_jid));
+ this->log(LOG_DEBUG, _rcvdat.to_log(_jid));
_datafh = new lfh*[_num_jfiles];
// 0 the pointer array first because new() can throw exceptions
@@ -205,7 +205,7 @@
// constrains read activity (i.e. one can't read what has not yet been written).
_wrfc.initialize(_num_jfiles, _jfsize_sblks, (nlfh**)_datafh, &_rcvdat);
_rrfc.initialize(_num_jfiles, (nlfh**)_datafh, _rcvdat._ffid);
- _rmgr.initialize(rd_cb, _rcvdat._fro);
+ _rmgr.initialize(rd_cb);
_wmgr.initialize(wr_cb, JRNL_WMGR_MAXDTOKPP, JRNL_WMGR_MAXWAITUS, _rcvdat._eo);
_readonly_flag = true;
@@ -221,9 +221,8 @@
_datafh[i]->reset(&_rcvdat);
_wrfc.initialize(_num_jfiles, _jfsize_sblks, (nlfh**)_datafh, &_rcvdat);
_rrfc.initialize(_num_jfiles, (nlfh**)_datafh, _rcvdat._ffid);
- _rmgr.recover_complete(_rcvdat._fro);
+ _rmgr.recover_complete();
_readonly_flag = false;
- this->log(LOG_DEBUG, "Recover phase II complete; journal now writable.");
}
void
@@ -413,6 +412,21 @@
flush(block_till_aio_cmpl);
}
+u_int16_t
+jcntl::get_earliest_fid()
+{
+ u_int16_t ffid = _wrfc.earliest_index();
+ u_int16_t fid = _wrfc.index();
+ while ( _emap.get_enq_cnt(ffid) == 0 && _tmap.get_txn_fid_cnt(ffid) == 0 && ffid != fid)
+ {
+ if (++ffid >= _num_jfiles)
+ ffid = 0;
+ }
+ if (ffid != _rrfc.fid())
+ _rrfc.reset(ffid);
+ return ffid;
+}
+
iores
jcntl::flush(const bool block_till_aio_cmpl)
{
@@ -602,7 +616,7 @@
u_int16_t next_wr_fid = (rd._lfid + 1) % _num_jfiles;
if (rd._ffid == next_wr_fid && rd._enq_cnt_list[next_wr_fid])
rd._full = true;
-
+
// Remove all transactions not in prep_txn_list
std::vector<std::string> xid_list;
_tmap.xid_list(xid_list);
@@ -760,7 +774,7 @@
}
break;
case 0:
- rd._eo = ifsp->tellg();
+ rd._eo = file_pos;
return false;
default:
// Stop as this is the overwrite boundary.
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -534,7 +534,7 @@
inline u_int16_t get_rd_fid() const { return _rrfc.index(); }
inline u_int16_t get_wr_fid() const { return _wrfc.index(); }
- inline u_int16_t get_earliest_fid() const { return _wrfc.earliest_index(); }
+ u_int16_t get_earliest_fid();
/**
* \brief Check if a particular rid is enqueued. Note that this function will return
Modified: store/trunk/cpp/lib/jrnl/nlfh.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/nlfh.cpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/nlfh.cpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -113,13 +113,6 @@
{
if (!ro->_empty)
{
- // For first file only, set read counters to ahead of file header
- if (ro->_ffid == _fid)
- {
- _rd_subm_cnt_dblks = JRNL_SBLK_SIZE;
- _rd_cmpl_cnt_dblks = JRNL_SBLK_SIZE;
- }
-
// For last file only, set write counters to end of last record (the
// continuation point); for all others, set to eof.
if (ro->_lfid == _fid)
@@ -199,15 +192,24 @@
bool
nlfh::reset(const rcvdat* const ro)
{
+ rd_reset();
+ return wr_reset(ro);
+}
+
+void
+nlfh::rd_reset()
+{
+ _rd_subm_cnt_dblks = 0;
+ _rd_cmpl_cnt_dblks = 0;
+}
+
+bool
+nlfh::wr_reset(const rcvdat* const ro)
+{
if (ro)
{
if (!ro->_empty)
{
- if (ro->_ffid == _fid)
- {
- _rd_subm_cnt_dblks = JRNL_SBLK_SIZE;
- _rd_cmpl_cnt_dblks = JRNL_SBLK_SIZE;
- }
if (ro->_lfid == _fid)
{
_wr_subm_cnt_dblks = ro->_eo/JRNL_DBLK_SIZE;
@@ -232,8 +234,6 @@
_wr_subm_cnt_dblks = 0;
_wr_cmpl_cnt_dblks = 0;
#endif
- _rd_subm_cnt_dblks = 0;
- _rd_cmpl_cnt_dblks = 0;
return true;
}
Modified: store/trunk/cpp/lib/jrnl/nlfh.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/nlfh.hpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/nlfh.hpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -79,6 +79,8 @@
virtual void initialize(const std::string& fbasename, const u_int16_t fid,
const u_int32_t jfsize_sblks, const rcvdat* const ro);
virtual bool reset(const rcvdat* const ro = 0);
+ virtual void rd_reset();
+ virtual bool wr_reset(const rcvdat* const ro = 0);
inline const std::string& fname() const { return _fname; }
inline u_int16_t fid() const { return _fid; }
Modified: store/trunk/cpp/lib/jrnl/rcvdat.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rcvdat.hpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/rcvdat.hpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -107,6 +107,31 @@
std::endl;
return oss.str();
}
+
+ std::string to_log(std::string& jid)
+ {
+ std::ostringstream oss;
+ oss << "Recover file analysis (jid=\"" << jid << "\"):";
+ oss << " owi=" << (_owi ? "TRUE" : "FALSE");
+ oss << " frot=" << (_frot ? "TRUE" : "FALSE");
+ oss << " empty=" << (_empty ? "TRUE" : "FALSE");
+ oss << " ffid=" << _ffid;
+ oss << " fro=0x" << std::hex << _fro << std::dec << " (" <<
+ (_fro/JRNL_DBLK_SIZE) << " dblks)";
+ oss << " lfid=" << _lfid;
+ oss << " eo=0x" << std::hex << _eo << std::dec << " (" <<
+ (_eo/JRNL_DBLK_SIZE) << " dblks)";
+ oss << " h_rid=0x" << std::hex << _h_rid << std::dec;
+ oss << " full=" << (_full ? "TRUE" : "FALSE");
+ oss << " Enqueued records (txn & non-txn): [ ";
+ for (unsigned i=0; i<_enq_cnt_list.size(); i++)
+ {
+ if (i) oss << " ";
+ oss << "fid_" << std::setw(2) << std::setfill('0') << i << "=" << _enq_cnt_list[i];
+ }
+ oss << " ]";
+ return oss.str();
+ }
};
}
}
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -58,21 +58,10 @@
}
void
-rmgr::initialize(const rd_aio_cb rd_cb, const std::size_t fro)
+rmgr::initialize(const rd_aio_cb rd_cb)
{
_cb = rd_cb;
initialize();
- if (fro)
- {
- u_int32_t fro_dblks = (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);
- }
-
clean();
// Allocate memory for reading file header
if (::posix_memalign(&_fhdr_buffer, _sblksize, _sblksize))
@@ -313,8 +302,17 @@
{
std::memcpy(&_fhdr, _fhdr_buffer, sizeof(file_hdr));
_rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
- std::size_t fro_dblks = _fhdr._fro / JRNL_DBLK_SIZE;
- _pg_offset_dblks += fro_dblks - JRNL_SBLK_SIZE;
+
+// std::size_t fro_dblks = _fhdr._fro / JRNL_DBLK_SIZE;
+// _pg_offset_dblks += fro_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);
+
_fhdr_rd_outstanding = false;
_valid = true;
}
@@ -327,19 +325,8 @@
}
void
-rmgr::recover_complete(std::size_t fro)
-{
- if (fro)
- {
- u_int32_t fro_dblks = (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);
- }
-}
+rmgr::recover_complete()
+{}
void
rmgr::invalidate()
@@ -571,26 +558,25 @@
void
rmgr::init_aio_reads(const int16_t first_uninit, const u_int16_t num_uninit)
{
+ if (_fhdr_rd_outstanding)
+ return;
for (int16_t i=0; i<num_uninit; i++)
{
if (_rrfc.is_void()) // Nothing to do; this file not yet written to
break;
-
+
+ if (!_valid)
+ {
+ u_int16_t fid = _jc->get_earliest_fid();
+ init_file_header_read(fid);
+ break;
+ }
+
if (_rrfc.subm_offs() == 0)
{
- if (_valid)
- {
- _rrfc.add_subm_cnt_dblks(JRNL_SBLK_SIZE);
- _rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
- }
- else
- {
- u_int16_t fid = _jc->get_earliest_fid();
- init_file_header_read(fid);
- }
+ _rrfc.add_subm_cnt_dblks(JRNL_SBLK_SIZE);
+ _rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
}
- else
- _valid = true;
// TODO: Future perf improvement: Do a single AIO read for all available file
// space into all contiguous empty pages in one AIO operation.
Modified: store/trunk/cpp/lib/jrnl/rmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.hpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/rmgr.hpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -75,11 +75,11 @@
rmgr(jcntl* jc, enq_map& emap, txn_map& tmap, rrfc& rrfc);
virtual ~rmgr();
- void initialize(const rd_aio_cb rd_cb, const std::size_t fro);
- iores read(void** const datapp, std::size_t& dsize, void** const xidpp, std::size_t& xidsize,
- bool& transient, bool& external, data_tok* dtokp);
+ void initialize(const rd_aio_cb rd_cb);
+ iores read(void** const datapp, std::size_t& dsize, void** const xidpp,
+ std::size_t& xidsize, bool& transient, bool& external, data_tok* dtokp);
u_int32_t get_events(page_state state = AIO_COMPLETE);
- void recover_complete(std::size_t fro);
+ void recover_complete();
inline bool is_valid() const {return _valid; }
inline void synchronize() { if (!_valid) aio_cycle(); }
void invalidate();
Modified: store/trunk/cpp/lib/jrnl/rrfc.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rrfc.cpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/rrfc.cpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -62,6 +62,7 @@
{
_fh_index = fh_index;
_curr_fh = _fh_arr[_fh_index];
+ _curr_fh->rd_reset();
}
bool
Modified: store/trunk/cpp/lib/jrnl/rrfc.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rrfc.hpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/rrfc.hpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -72,7 +72,7 @@
* each of which correspond to one of the physical files.
* \param fh_index Initial index of journal file. Default = 0.
*/
- void initialize(const u_int16_t nfiles, nlfh** fh_arr, u_int32_t fh_index = 0);
+ virtual void initialize(const u_int16_t nfiles, nlfh** fh_arr, u_int32_t fh_index = 0);
void reset(u_int32_t fh_index = 0);
Modified: store/trunk/cpp/lib/jrnl/wrfc.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wrfc.cpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/lib/jrnl/wrfc.cpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -62,7 +62,11 @@
{
if (rdp)
{
- rrfc::initialize(nfiles, fh_arr, rdp->_lfid);
+ _nfiles = nfiles;
+ _fh_arr = fh_arr;
+ _fh_index = rdp->_lfid;
+ _curr_fh = _fh_arr[rdp->_lfid];
+ _curr_fh->wr_reset(rdp);
_rid = rdp->_h_rid + 1;
_reset_ok = true;
_owi = rdp->_owi;
Modified: store/trunk/cpp/tests/jrnl/_ut_jinf.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_jinf.cpp 2008-05-01 18:01:33 UTC (rev 1993)
+++ store/trunk/cpp/tests/jrnl/_ut_jinf.cpp 2008-05-05 14:58:54 UTC (rev 1994)
@@ -38,6 +38,7 @@
#include "jrnl/jerrno.hpp"
#include "jrnl/jexception.hpp"
#include "jrnl/jinf.hpp"
+#include <vector>
#define NUM_JFILES 4
#define JFSIZE_SBLKS 128
16 years, 10 months
rhmessaging commits: r1993 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-05-01 14:01:33 -0400 (Thu, 01 May 2008)
New Revision: 1993
Modified:
mgmt/cumin/python/cumin/__init__.py
Log:
change default CUMIN_HOME path to match the cumin specfile
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2008-05-01 17:48:47 UTC (rev 1992)
+++ mgmt/cumin/python/cumin/__init__.py 2008-05-01 18:01:33 UTC (rev 1993)
@@ -133,7 +133,7 @@
def __init__(self):
super(CuminConfig, self).__init__()
- hdef = os.path.normpath("/var/lib/cumin")
+ hdef = os.path.normpath("/usr/share/cumin")
self.home = os.environ.get("CUMIN_HOME", hdef)
if not os.path.isdir(self.home):
16 years, 10 months
rhmessaging commits: r1992 - mgmt.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-05-01 13:48:47 -0400 (Thu, 01 May 2008)
New Revision: 1992
Modified:
mgmt/cumin.spec
Log:
handle unpackaged file /etc/sysvinit-cumin
Modified: mgmt/cumin.spec
===================================================================
--- mgmt/cumin.spec 2008-05-01 16:03:25 UTC (rev 1991)
+++ mgmt/cumin.spec 2008-05-01 17:48:47 UTC (rev 1992)
@@ -81,12 +81,13 @@
%defattr(-,cumin,cumin,-)
%doc doc/*
%{_bindir}/cumin*
-%{_sysconfdir}/cumin.*
+%{_sysconfdir}/*cumin*
%{_datadir}/cumin
%{python_sitelib}/cumin
%{python_sitelib}/mint
%{python_sitelib}/wooly
+
%changelog
* Mon Mar 31 2008 Nuno Santos <nsantos(a)redhat.com> - 0.1-6
- Create cumin user/group
16 years, 10 months
rhmessaging commits: r1991 - in mgmt: mint/python/mint and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-05-01 12:03:25 -0400 (Thu, 01 May 2008)
New Revision: 1991
Modified:
mgmt/basil/python/basil/__init__.py
mgmt/mint/python/mint/__init__.py
Log:
use alternative UUID factory if uuid module not present
Modified: mgmt/basil/python/basil/__init__.py
===================================================================
--- mgmt/basil/python/basil/__init__.py 2008-05-01 15:20:16 UTC (rev 1990)
+++ mgmt/basil/python/basil/__init__.py 2008-05-01 16:03:25 UTC (rev 1991)
@@ -1,4 +1,5 @@
-import mllib, qpid, new, uuid
+import mllib, qpid, new
+from qpid.datatypes import uuid4
from string import Template
from qpid.management import managementChannel, managementClient
from qpid.util import connect
@@ -216,7 +217,7 @@
def open(self):
self.conn.start()
self.chan = self.mclient.addChannel \
- (self.conn.session(str(uuid.uuid4())), self.context_id)
+ (self.conn.session(str(uuid4())), self.context_id)
def close(self):
self.mclient.removeChannel(self.chan)
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-05-01 15:20:16 UTC (rev 1990)
+++ mgmt/mint/python/mint/__init__.py 2008-05-01 16:03:25 UTC (rev 1991)
@@ -1,4 +1,5 @@
-import os, socket, qpid, logging, uuid
+import os, socket, qpid, logging
+from qpid.datatypes import uuid4
from qpid.connection import Connection
from qpid.util import connect
from qpid.management import managementChannel, managementClient
@@ -197,7 +198,7 @@
self.model.connections[self.key] = self
self.conn.start()
- self.mchan = self.mclient.addChannel (self.conn.session(str(uuid.uuid4())), self.key)
+ self.mchan = self.mclient.addChannel (self.conn.session(str(uuid4())), self.key)
self.state = "opened"
except Exception, e:
16 years, 10 months
rhmessaging commits: r1990 - store/trunk/cpp.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-05-01 11:20:16 -0400 (Thu, 01 May 2008)
New Revision: 1990
Modified:
store/trunk/cpp/rhm.spec.in
Log:
make qpidd user the owner of /var/lib/rhm
Modified: store/trunk/cpp/rhm.spec.in
===================================================================
--- store/trunk/cpp/rhm.spec.in 2008-05-01 14:55:03 UTC (rev 1989)
+++ store/trunk/cpp/rhm.spec.in 2008-05-01 15:20:16 UTC (rev 1990)
@@ -63,7 +63,7 @@
%_libdir/libbdbstore.so.0.1.0
%_initrddir/rhmd
%_sbindir/rhmd
-%attr(0775,root,root) %dir %_localstatedir/rhm
+%attr(0775,qpidd,qpidd) %dir %_localstatedir/rhm
%config(noreplace) %_sysconfdir/rhmd.conf
%post
16 years, 10 months
rhmessaging commits: r1989 - store/trunk/cpp/etc.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-05-01 10:55:03 -0400 (Thu, 01 May 2008)
New Revision: 1989
Modified:
store/trunk/cpp/etc/rhmd
Log:
full path for qpidd binary in init script
Modified: store/trunk/cpp/etc/rhmd
===================================================================
--- store/trunk/cpp/etc/rhmd 2008-04-28 22:21:11 UTC (rev 1988)
+++ store/trunk/cpp/etc/rhmd 2008-05-01 14:55:03 UTC (rev 1989)
@@ -32,7 +32,7 @@
start() {
echo -n $"Starting RHM daemon: "
- daemon --pidfile $pidfile --check $prog --user qpidd $prog --daemon --config=/etc/rhmd.conf
+ daemon --pidfile $pidfile --check $prog --user qpidd /usr/sbin/$prog --daemon --config=/etc/rhmd.conf
RETVAL=$?
if [ $RETVAL = 0 ] ; then success ; else failure ; fi
echo
16 years, 10 months