-
Kirill Smelkov authored
Like fsdump/py does. https://github.com/zopefoundation/ZODB/commit/403f9869 started to print size of every transaction record saying that it readded it. And indeed this printing was there starting from https://github.com/zopefoundation/ZODB/commit/06e757b3 authored in 2003. Both commits use `size(txn) = trans._tend - trans._tpos` which is wrong by 8 because during file iteration tpos points to the beginning of transaction and tend points to tpos + tlen, but tlen is full transaction length - 8: https://github.com/zopefoundation/ZODB/blob/5.8.1/src/ZODB/FileStorage/FileStorage.py#L1997-L1998 https://github.com/zopefoundation/ZODB/blob/5.8.1/src/ZODB/FileStorage/format.py#L28 Mimic fsdump/py behaviour exactly for compatibility, even if it is a bit buggy, since it was there for such a long time. Without the fix TestFsDump was failing like this: --- FAIL: TestFsDump/db=1 (0.00s) dump_test.go:70: fsdump: dump different: -Trans #00000 tid=0285cbac258bf266 size=151 time=1979-01-03 21:00:08.800000 offset=52 +Trans #00000 tid=0285cbac258bf266 time=1979-01-03 21:00:08.800000 offset=52 status=' ' user='' description='initial database creation' data #00000 oid=0000000000000000 size=61 class=persistent.mapping.PersistentMapping ...
9d10dcc5