db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suresh Thalamati <suresh.thalam...@gmail.com>
Subject [PATCH] increasinng the possible log file id's from 2^22 -1 to 2^33 -1 (derby-101)
Date Tue, 17 May 2005 02:27:49 GMT
Attached is the patch to increase the max possible log files number from 
2^22 -1 to
2^33 -1. Derby creates log file names in sequential order by 
incrementing log file number
by one each time(like log1.dat ....logN.dat).  id's are not reused, so 
the last possible log file that
can be created currently is  limited to 2^22 - 1 (4194303). Problem with 
this limit is ,
it can be possible hit on systems that creates lot of log records very 
fast with the default
log file size (1MB) ,  for example if  1MB of log is created every 
second this limit can be hit
 in (4194303 / (60 * 60 * 24))  48 days.

Attached fix bumps the max possible log file number to 2^33 -1 by 
borrowing some unused bits in the
log file number and log file size fields in the log instant.  With the 
same assumption  as above if a
a 1MB of log file is created for every  second; it will take 
((8589934591 / (60 * 60 * 24))/365)
approximately 272 years; Which I  think  is a reasonable limit. :-)

I believe the new limit is a reasonable one , and not necessary to solve 
this problem  by
 implementing a complicated solution that reuse the  ids, at this moment.

Testing : ran derbyall ; all tests passed.
New tests : Added couple of tests to  test the max log file ids using 
debug flags.

svn status
M      java\engine\org\apache\derby\impl\store\raw\log\LogCounter.java
M      java\engine\org\apache\derby\impl\store\raw\log\LogToFile.java
M      
java\testing\org\apache\derbyTesting\functionTests\tests\store\copyfiles.ant
A      
java\testing\org\apache\derbyTesting\functionTests\tests\store\MaxLogNumberRecovery_derby.properties
A      
java\testing\org\apache\derbyTesting\functionTests\tests\store\MaxLogNumber_app.properties
A      
java\testing\org\apache\derbyTesting\functionTests\tests\store\MaxLogNumberRecovery_app.properties
A      
java\testing\org\apache\derbyTesting\functionTests\tests\store\MaxLogNumber_derby.properties
A      
java\testing\org\apache\derbyTesting\functionTests\tests\store\MaxLogNumber.java
A      
java\testing\org\apache\derbyTesting\functionTests\tests\store\MaxLogNumberRecovery.java
A      
java\testing\org\apache\derbyTesting\functionTests\master\MaxLogNumber.out
A      
java\testing\org\apache\derbyTesting\functionTests\master\MaxLogNumberRecovery.out
M      
java\testing\org\apache\derbyTesting\functionTests\suites\storerecovery.runall
$
Thanks
-suresht


Mime
View raw message