On Saturday 21 February 2009 14:44:02 Daniel Cheng wrote:
> On Sat, Feb 21, 2009 at 9:51 PM,  <[email protected]> wrote:
> > Author: toad
> > Date: 2009-02-21 13:51:30 +0000 (Sat, 21 Feb 2009)
> > New Revision: 25757
> >
> > Modified:
> >   
branches/db4o/freenet/src/freenet/support/io/PersistentTempBucketFactory.java
> > Log:
> > DOH! Blob buckets must still be encrypted, if we want persistent temp file 
encryption!
> > This change will not break your existing node.db4o, however if you want 
persistent temp file encryption you must delete it!
> 
> What is the status of this blob buckets?
> Last time I checked it, it leaks and cannot grow.
> maybe we should push db4o first and have blob buckets later?

It used to leak, and it used to not be able to shrink. Both problems are 
fixed, afaik it works, although it is of course possible to get fragmentation 
(a bucket allocated at the end when it is big prevents it from being shrunk 
when the big stuff has been removed); defrag is possible at the expense of 
extra locking in read/write streams but I'm not convinced it's necessary atm. 
Without blobs, big inserts do not work on low memory, because of the sheer 
number of temporary files needed for a big insert, which causes an OOM when 
we iterate the directory on startup. But it should be configurable certainly.
> 
> > Modified: 
branches/db4o/freenet/src/freenet/support/io/PersistentTempBucketFactory.java
> > ===================================================================
> > --- 
branches/db4o/freenet/src/freenet/support/io/PersistentTempBucketFactory.java   
    
2009-02-21 11:39:21 UTC (rev 25756)
> > +++ 
branches/db4o/freenet/src/freenet/support/io/PersistentTempBucketFactory.java   
    
2009-02-21 13:51:30 UTC (rev 25757)
> > @@ -134,15 +134,19 @@
> >
> >        public Bucket makeBucket(long size) throws IOException {
> >                Bucket rawBucket = null;
> > +               boolean mustWrap = true;
> >                if(size == BLOB_SIZE) {
> >                        // No need for a DelayedFreeBucket, we handle this 
internally (and more efficiently) for blobs.
> > +                       mustWrap = false;
> >                        rawBucket = blobFactory.makeBucket();
> > -                       if(rawBucket != null) return rawBucket;
> >                }
> >                if(rawBucket == null)
> >                        rawBucket = new 
PersistentTempFileBucket(fg.makeRandomFilename(), fg);
> > -               Bucket maybeEncryptedBucket = (encrypt ? new 
PaddedEphemerallyEncryptedBucket(rawBucket, 1024, strongPRNG, weakPRNG) : 
rawBucket);
> > -               return new DelayedFreeBucket(this, maybeEncryptedBucket);
> > +               if(encrypt)
> > +                       rawBucket = new 
PaddedEphemerallyEncryptedBucket(rawBucket, 1024, strongPRNG, weakPRNG);
> > +               if(mustWrap)
> > +                       rawBucket = new DelayedFreeBucket(this, 
rawBucket);
> > +               return rawBucket;
> >        }
> >
> >        /**

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to