Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 48346 invoked from network); 25 May 2005 16:51:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 May 2005 16:51:48 -0000 Received: (qmail 67634 invoked by uid 500); 25 May 2005 16:51:48 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 67608 invoked by uid 500); 25 May 2005 16:51:48 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 67595 invoked by uid 500); 25 May 2005 16:51:47 -0000 Delivered-To: apmail-incubator-derby-cvs@incubator.apache.org Received: (qmail 67590 invoked by uid 99); 25 May 2005 16:51:47 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 25 May 2005 09:51:47 -0700 Received: (qmail 48319 invoked by uid 65534); 25 May 2005 16:51:45 -0000 Message-ID: <20050525165145.48318.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r178486 - /incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogCounter.java /incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java Date: Wed, 25 May 2005 16:51:45 -0000 To: derby-cvs@incubator.apache.org From: mikem@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mikem Date: Wed May 25 09:51:44 2005 New Revision: 178486 URL: http://svn.apache.org/viewcvs?rev=3D178486&view=3Drev Log: Attached patch increases the maximum possible log file number to 231 -1 = and keeps the old limit of 222-1 on soft upgrade. Earlier patch for this problem increased it to 233 -1 , but that fix create= d upgrade problems because of the additional bits that are used from the file position field, so the limit is being reduced= to 231-1.=20 committed on behalf of: suresh.thalamati@gmail.com Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/= log/LogCounter.java incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/= log/LogToFile.java Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/stor= e/raw/log/LogCounter.java URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/o= rg/apache/derby/impl/store/raw/log/LogCounter.java?rev=3D178486&r1=3D178485= &r2=3D178486&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/= log/LogCounter.java (original) +++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/= log/LogCounter.java Wed May 25 09:51:44 2005 @@ -60,18 +60,18 @@ =09 /** A well defined value of an invalid log instant. */ public static final long INVALID_LOG_INSTANT =3D 0; +=09 + // max possible log file number in versions before 10.1 is 2^22 -1 + public static final long DERBY_10_0_MAX_LOGFILE_NUMBER =3D (long)0x003FFF= FFL; // 4194303 + // max possible log file number is 2^31 -1 + public static final long MAX_LOGFILE_NUMBER =3D (long)0x7FFFFFFFL; // 214= 7483647=20 + // lower end of 32 bits in long type are used to store the log file posit= ion + private static final long FILE_NUMBER_SHIFT =3D 32; =20 - - // max possible log file number is 2^33 -1 (8589934591) - public static final long MAX_LOGFILE_NUMBER =3D (long)0x1FFFFFFFFL;=20 - - // lower end of 30 bits in long type are used to store the log file posit= ion - private static final long FILE_NUMBER_SHIFT =3D 30; - - // reserve top 2 bits in log file size for future use + // reserve top 4 bits in log file size for future use public static final long MAX_LOGFILE_SIZE =3D (long)0x0FFFFFFFL; // 2= 68435455 - // 30 bits are used to store the log file postion - private static final long FILE_POSITION_MASK =3D (long)0x3FFFFFFFL; + // 32 bits are used to store the log file postion + private static final long FILE_POSITION_MASK =3D (long)0x7FFFFFFFL; =20 private long fileNumber; private long filePosition; Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/stor= e/raw/log/LogToFile.java URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/o= rg/apache/derby/impl/store/raw/log/LogToFile.java?rev=3D178486&r1=3D178485&= r2=3D178486&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/= log/LogToFile.java (original) +++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/= log/LogToFile.java Wed May 25 09:51:44 2005 @@ -333,7 +333,7 @@ // must be synchronized with this to access // or change. =09 - + private long maxLogFileNumber =3D LogCounter.MAX_LOGFILE_NUM= BER; private CheckpointOperation currentCheckpoint; // last checkpoint successfully taken //=20 @@ -1831,11 +1831,11 @@ // used. StorageFile newLogFile =3D getLogFileName(logFileNumber+1); =20 - if (logFileNumber+1 >=3D LogCounter.MAX_LOGFILE_NUMBER) + if (logFileNumber+1 >=3D maxLogFileNumber) { throw StandardException.newException( SQLState.LOG_EXCEED_MAX_LOG_FILE_NUMBER,=20 - new Long(LogCounter.MAX_LOGFILE_NUMBER));=20 + new Long(maxLogFileNumber));=20 } =20 StorageRandomAccessFile newLog =3D null; // the new log file @@ -3059,6 +3059,21 @@ { throw Monitor.exceptionStartingModule(ioe); } + =09 + // Number of the log file that can be created in Derby is increased from=20 + // 2^22 -1 to 2^31 -1 in version 10.1. But if the database is running on + // engines 10.1 or above on a softupgrade from versions 10.0 or + // before, the max log file number that can be created is =20 + // still limited to 2^22 -1, because users can revert back to older ver= sions=20 + // which does not have logic to handle a log file number greater than + // 2^22-1.=20 + + // set max possible log file number to derby 10.0 limit, if the database= is not=20 + // fully upgraded to or created in version 10.1 or above.=20 + if (!checkVersion(RawStoreFactory.DERBY_STORE_MAJOR_VERSION_10,=20 + RawStoreFactory.DERBY_STORE_MINOR_VERSION_1)) + maxLogFileNumber =3D LogCounter.DERBY_10_0_MAX_LOGFILE_NUMBER; + } // end of boot =20 private void getLogStorageFactory() throws StandardException