debugprint the values of blocks and hashes thereof; make the test data and the seg...
authorZooko O'Whielacronx <zooko@zooko.com>
Fri, 30 Sep 2011 05:46:28 +0000 (05:46 +0000)
committerZooko O'Whielacronx <zooko@zooko.com>
Fri, 30 Sep 2011 05:46:28 +0000 (05:46 +0000)
src/allmydata/mutable/publish.py
src/allmydata/mutable/retrieve.py
src/allmydata/test/test_mutable.py

index 87854cbaa8597186421331a4cfa264bb3d9859c0..5eb4206dc8b94ff8aed756301f0b49ac40495232 100644 (file)
@@ -25,7 +25,7 @@ from allmydata.mutable.layout import get_version_from_checkstring,\
                                      SDMFSlotWriteProxy
 
 KiB = 1024
-DEFAULT_MAX_SEGMENT_SIZE = 128 * KiB
+DEFAULT_MAX_SEGMENT_SIZE = 64
 PUSHING_BLOCKS_STATE = 0
 PUSHING_EVERYTHING_ELSE_STATE = 1
 DONE_STATE = 2
@@ -763,6 +763,7 @@ class Publish:
                 hashed = sharedata
             block_hash = hashutil.block_hash(hashed)
             self.blockhashes[shareid][segnum] = block_hash
+            log.msg("yyy 0 shareid: %s, segnum: %s, blockhash: %s, sharedata: %s, salt: %s" % (shareid, segnum, base32.b2a(block_hash), base32.b2a(sharedata), base32.b2a(salt),))
             # find the writer for this share
             writer = self.writers[shareid]
             writer.put_block(sharedata, segnum, salt)
index 0e507704669a3367c9e259754b6249b3e5fedd39..9419ede6ff940659646401b4a68458e596d8140e 100644 (file)
@@ -772,6 +772,9 @@ class Retrieve:
                  sharehashes[1].keys())
         bht = self._block_hash_trees[reader.shnum]
 
+        for bhk, bhv in blockhashes.iteritems():
+            log.msg("xxx 0 blockhash: %s %s" % (bhk, base32.b2a(bhv),))
+
         if bht.needed_hashes(segnum, include_leaf=True):
             try:
                 bht.set_hashes(blockhashes)
index 980e84511920a50e5d3a3847bb742f8aced40e81..0facb7d857b2b4b498cfd77a419dad0139a9fc44 100644 (file)
@@ -2872,7 +2872,7 @@ class Version(GridTestMixin, unittest.TestCase, testutil.ShouldFailMixin, \
         self.set_up_grid()
         self.c = self.g.clients[0]
         self.nm = self.c.nodemaker
-        self.data = "test data" * 100000 # about 900 KiB; MDMF
+        self.data = "test data" * 32 # about 900 KiB; MDMF
         self.small_data = "test data" * 10 # about 90 B; SDMF
 
 
@@ -3245,7 +3245,7 @@ class Update(GridTestMixin, unittest.TestCase, testutil.ShouldFailMixin):
         self.set_up_grid()
         self.c = self.g.clients[0]
         self.nm = self.c.nodemaker
-        self.data = "testdata " * 100000 # about 900 KiB; MDMF
+        self.data = "testdata " * 30 # about 900 KiB; MDMF
         self.small_data = "test data" * 10 # about 90 B; SDMF