Alexander R Pruss wrote:
So, question: How do we find out how much space there _really_ is in the
storage heap: i.e., amount of space in the hidden flash drive minus the
write pending data in the dbcache? Does anybody know?
I have a solution. A messy one, but should work if the problem is what
I think. Roughly:
Boolean CheckForFreeSpace()
{
if ( NVFS ) {
if ( MIN_KEEP_FREE + GetUsedSpace( dbcache ) <=
GetFreeSpace( storage heap ) )
return true;
DmSync();
}
return MIN_KEEP_FREE <= GetFreeSpace( storage heap );
}
I.e., first we do a conservative estimate that assumes that everything
dbcache is write pending. If we still have space based on the
conservative estimate, we're OK. If not, we commit dbcache to flash,
and then we have exact data.
This will slow things down when storage heap free space is around or
less than the amount of data in dbcache. But stability is more
important than speed.
Alex
p.s. I committed the recyclable uncompress and cache code. There should
be no need to clear out the memodb32 code, but I did commit a sanity
check for zero-length records.
_______________________________________________
plucker-dev mailing list
[email protected]
http://lists.rubberchicken.org/mailman/listinfo/plucker-dev