[ZODB-Dev] Data.fs without content but 1.8GB diskspace

Christian Robottom Reis kiko at async.com.br
Tue Oct 7 10:07:30 EDT 2003


On Mon, Oct 06, 2003 at 11:20:11AM -0400, Jeremy Hylton wrote:
> > Would it be approriate to have this sizing information provided by
> > fsdump.py too?
> 
> Sure, but it's easy to compute from the current output, so I'm not
> inclined to do anything about it.

I'm not sure if that was a nudge or an elbow in the gut <0.8 wink>. I've
changed fsdump slightly to output this information:

Trans #00015 tid=034e7fe55c0ae1f1 time=2003-07-24 03:17:21.572463 offset=286135
        status='p' user= description=
  data #00000 oid=00000000000038c9 class=domain.sorder.SOrder 
  data #00001 oid=00000000000038f0 class=IndexedCatalog.BTrees.OOBTree.OOSet 
  data #00002 oid=00000000000038f1 class=IndexedCatalog.BTrees.OOBTree.OOSet 
Transaction size: 1549 bytes

Trans #00016 tid=034e7fe55c0ae1f2 time=2003-07-24 03:17:21.572463 offset=287684
[...]

I've attached the patch for review; the only thing it changes in the
output (besides the "Transaction size" lines) is a blank line at the
beginning of the output.

If nobody protests loudly I can check this in by the end of the week.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
-------------- next part --------------
Index: fsdump.py
===================================================================
RCS file: /cvs-repository/ZODB3/ZODB/fsdump.py,v
retrieving revision 1.7
diff -u -r1.7 fsdump.py
--- fsdump.py	2 May 2003 14:50:39 -0000	1.7
+++ fsdump.py	7 Oct 2003 14:01:17 -0000
@@ -39,11 +39,19 @@
 def fsdump(path, file=None, with_offset=1):
     i = 0
     iter = FileIterator(path)
+    last_offset = None
     for trans in iter:
         if with_offset:
+            if last_offset is not None:
+                # As soon as we hit the second transaction, calculate size
+                print >> file, "Transaction size: %d bytes" % \
+                    (trans._pos - last_offset)
+            print >> file
             print >> file, "Trans #%05d tid=%016x time=%s offset=%d" % \
                   (i, u64(trans.tid), str(TimeStamp(trans.tid)), trans._pos)
+            last_offset = trans._pos
         else:
+            print >> file
             print >> file, "Trans #%05d tid=%016x time=%s" % \
                   (i, u64(trans.tid), str(TimeStamp(trans.tid)))
         print >> file, "\tstatus=%s user=%s description=%s" % \
@@ -73,8 +81,8 @@
             print >> file, "  data #%05d oid=%016x %sclass=%s %s" % \
                   (j, u64(rec.oid), version, fullclass, bp)
             j += 1
-        print >> file
         i += 1
+    print >> file
     iter.close()
 
 import struct
@@ -86,7 +94,7 @@
     return "%016x" % u64(p64)
 
 class Dumper:
-    """A very verbose dumper for debuggin FileStorage problems."""
+    """A very verbose dumper for debugging FileStorage problems."""
 
     def __init__(self, path, dest=None):
         self.file = open(path, "rb")


More information about the ZODB-Dev mailing list