[Checkins] SVN: relstorage/branches/1.5/ Backported minor fixes from the trunk.
Shane Hathaway
shane at hathawaymix.org
Sat Nov 12 17:12:52 UTC 2011
Log message for revision 123329:
Backported minor fixes from the trunk.
Changed:
U relstorage/branches/1.5/CHANGES.txt
U relstorage/branches/1.5/README.txt
U relstorage/branches/1.5/relstorage/adapters/packundo.py
U relstorage/branches/1.5/relstorage/adapters/schema.py
U relstorage/branches/1.5/relstorage/storage.py
-=-
Modified: relstorage/branches/1.5/CHANGES.txt
===================================================================
--- relstorage/branches/1.5/CHANGES.txt 2011-11-12 17:00:14 UTC (rev 123328)
+++ relstorage/branches/1.5/CHANGES.txt 2011-11-12 17:12:52 UTC (rev 123329)
@@ -1,3 +1,19 @@
+1.5.1 (2011-11-12)
+------------------
+
+- Packing: Lowered garbage collection object reference finding log level to
+ debug; this stage takes mere seconds, even in large sites, but could produce
+ 10s of thousands of lines of log output.
+
+- RelStorage was opening a test database connection (and was leaving it
+ idle in a transaction with recent ZODB versions that support
+ IMVCCStorage.) RelStorage no longer opens that test connection.
+
+- zodbconvert: Avoid holding a list of all transactions in memory.
+
+- Just after installing the database schema, verify the schema was
+ created correctly. This affects MySQL in particular.
+
1.5.0 (2011-06-30)
------------------
Modified: relstorage/branches/1.5/README.txt
===================================================================
--- relstorage/branches/1.5/README.txt 2011-11-12 17:00:14 UTC (rev 123328)
+++ relstorage/branches/1.5/README.txt 2011-11-12 17:12:52 UTC (rev 123329)
@@ -44,10 +44,7 @@
The patches are also included in the source distribution of RelStorage.
You need the Python database adapter that corresponds with your database.
-Install psycopg2, MySQLdb 1.2.2+, or cx_Oracle 4.3+. Note that Debian Etch
-ships MySQLdb 1.2.1, but that version has a bug in BLOB handling that manifests
-itself only with certain character set configurations. MySQLdb 1.2.2 fixes the
-bug.
+Install psycopg2, MySQLdb 1.2.2+, or cx_Oracle 4.3+.
Configuring Your Database
-------------------------
@@ -205,8 +202,8 @@
%import relstorage
<zodb_db main>
mount-point /
- blob-dir ./blobs
<relstorage>
+ blob-dir ./blobs
<postgresql>
dsn dbname='zodb' user='username' host='localhost' password='pass'
</postgresql>
@@ -365,7 +362,7 @@
Specify these options in zope.conf, as parameters for the
``relstorage.storage.RelStorage`` constructor, or as attributes of a
-``relstorage.storage.Options`` instance. In the latter two cases, use
+``relstorage.options.Options`` instance. In the latter two cases, use
underscores instead of dashes in the option names.
``name``
Modified: relstorage/branches/1.5/relstorage/adapters/packundo.py
===================================================================
--- relstorage/branches/1.5/relstorage/adapters/packundo.py 2011-11-12 17:00:14 UTC (rev 123328)
+++ relstorage/branches/1.5/relstorage/adapters/packundo.py 2011-11-12 17:12:52 UTC (rev 123329)
@@ -111,7 +111,7 @@
children.update(to_oids)
parents = children.difference(keep_set)
keep_set.update(parents)
- log.info("pre_pack: found %d more referenced object(s) in "
+ log.debug("pre_pack: found %d more referenced object(s) in "
"pass %d", len(parents), pass_num)
# Set pack_object.keep for all OIDs in keep_set.
Modified: relstorage/branches/1.5/relstorage/adapters/schema.py
===================================================================
--- relstorage/branches/1.5/relstorage/adapters/schema.py 2011-11-12 17:00:14 UTC (rev 123328)
+++ relstorage/branches/1.5/relstorage/adapters/schema.py 2011-11-12 17:12:52 UTC (rev 123329)
@@ -841,6 +841,8 @@
self.runner.run_script(cursor, script)
script = filter_script(self.init_script, self.database_name)
self.runner.run_script(cursor, script)
+ tables = self.list_tables(cursor)
+ self.check_compatibility(cursor, tables)
def prepare(self):
"""Create the database schema if it does not already exist."""
Modified: relstorage/branches/1.5/relstorage/storage.py
===================================================================
--- relstorage/branches/1.5/relstorage/storage.py 2011-11-12 17:00:14 UTC (rev 123328)
+++ relstorage/branches/1.5/relstorage/storage.py 2011-11-12 17:12:52 UTC (rev 123329)
@@ -166,8 +166,6 @@
if create:
self._adapter.schema.prepare()
- self._open_load_connection()
-
self.__lock = threading.RLock()
self.__commit_lock = threading.Lock()
self._lock_acquire = self.__lock.acquire
@@ -444,14 +442,17 @@
logfunc('; '.join(msg))
+ def _before_load(self):
+ if not self._load_transaction_open:
+ self._restart_load_and_poll()
+
def load(self, oid, version=''):
oid_int = u64(oid)
cache = self._cache
self._lock_acquire()
try:
- if not self._load_transaction_open:
- self._restart_load_and_poll()
+ self._before_load()
cursor = self._load_cursor
state, tid_int = cache.load(cursor, oid_int)
finally:
@@ -487,8 +488,7 @@
self._lock_acquire()
try:
- if not self._load_transaction_open:
- self._restart_load_and_poll()
+ self._before_load()
state = self._adapter.mover.load_revision(
self._load_cursor, oid_int, tid_int)
if state is None and self._store_cursor is not None:
@@ -518,8 +518,7 @@
# for conflict resolution.
cursor = self._store_cursor
else:
- if not self._load_transaction_open:
- self._restart_load_and_poll()
+ self._before_load()
cursor = self._load_cursor
if not self._adapter.mover.exists(cursor, u64(oid)):
raise POSKeyError(oid)
@@ -981,6 +980,7 @@
def history(self, oid, version=None, size=1, filter=None):
self._lock_acquire()
try:
+ self._before_load()
cursor = self._load_cursor
oid_int = u64(oid)
try:
@@ -1251,6 +1251,7 @@
self._lock_acquire()
try:
+ self._before_load()
cursor = self._load_cursor
return self.blobhelper.loadBlob(cursor, oid, serial)
finally:
@@ -1269,6 +1270,7 @@
"""
self._lock_acquire()
try:
+ self._before_load()
cursor = self._load_cursor
return self.blobhelper.openCommittedBlobFile(
cursor, oid, serial, blob=blob)
@@ -1323,7 +1325,9 @@
txnum = 0
total_size = 0
log.info("Counting the transactions to copy.")
- num_txns = len(list(other.iterator()))
+ num_txns = 0
+ for _ in other.iterator():
+ num_txns += 1
log.info("Copying the transactions.")
for trans in other.iterator():
txnum += 1
More information about the checkins
mailing list