Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 45526 invoked from network); 11 Jan 2011 15:46:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jan 2011 15:46:08 -0000 Received: (qmail 34878 invoked by uid 500); 11 Jan 2011 15:46:08 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 34796 invoked by uid 500); 11 Jan 2011 15:46:06 -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 34789 invoked by uid 99); 11 Jan 2011 15:46:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jan 2011 15:46:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jan 2011 15:46:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 421C623888FE; Tue, 11 Jan 2011 15:45:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1057702 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/io/ engine/org/apache/derby/impl/io/vfmem/ engine/org/apache/derby/impl/services/jce/ engine/org/apache/derby/impl/store/raw/data/ engine/org/apache/derby/impl/store/raw/... Date: Tue, 11 Jan 2011 15:45:35 -0000 To: derby-commits@db.apache.org From: dag@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110111154536.421C623888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dag Date: Tue Jan 11 15:45:35 2011 New Revision: 1057702 URL: http://svn.apache.org/viewvc?rev=1057702&view=rev Log: DERBY-4963 Revert to FileDescriptor#sync from FileChannel#force to improve interrupt resilience Patch derby-4963-2 removes DirRandomAccessFile4 and with it the use of FileChannel#force. It also removes the metadata boolean argument (no longer used) from the StorageRandomAccessFile#sync. Removed: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile4.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java Tue Jan 11 15:45:35 2011 @@ -272,6 +272,6 @@ class DirFile4 extends DirFile // Assume that modes "rws" and "rwd" are not supported. if(!rwsOK && ("rws".equals( mode) || "rwd".equals( mode))) mode = "rw"; - return new DirRandomAccessFile4( (File) this, mode); + return new DirRandomAccessFile( (File) this, mode); } // end of getRandomAccessFile } Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java Tue Jan 11 15:45:35 2011 @@ -60,13 +60,9 @@ class DirRandomAccessFile extends Random /** * Force any changes out to the persistent store. * - * @param metaData If true then this method is required to force changes to both the file's - * content and metadata to be written to storage; otherwise, it need only force content changes - * to be written. - * * @exception IOException If an IO error occurs. */ - public void sync( boolean metaData) throws IOException + public void sync( ) throws IOException { getFD().sync(); } Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/build.xml Tue Jan 11 15:45:35 2011 @@ -53,7 +53,6 @@ - @@ -75,7 +74,6 @@ - Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java Tue Jan 11 15:45:35 2011 @@ -125,7 +125,7 @@ public class VirtualRandomAccessFile } } - public void sync(boolean metaData) { + public void sync() { // Do nothing, everything is already synced. } Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java Tue Jan 11 15:45:35 2011 @@ -899,7 +899,7 @@ public final class JCECipherFactory impl verifyKeyFile.writeInt(checksum.length); verifyKeyFile.write(checksum); verifyKeyFile.write(data); - verifyKeyFile.sync(true); + verifyKeyFile.sync(); } else { Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java Tue Jan 11 15:45:35 2011 @@ -1899,7 +1899,7 @@ public class BaseDataFileFactory // write it out for future reference fileLockOnDB.writeUTF(myUUID.toString()); - fileLockOnDB.sync( false); + fileLockOnDB.sync(); fileLockOnDB.seek(0); // check the UUID UUID checkUUID = uuidFactory.recreateUUID(fileLockOnDB.readUTF()); @@ -1988,7 +1988,7 @@ public class BaseDataFileFactory // write it out for future reference fileLockOnDB.writeUTF(myUUID.toString()); - fileLockOnDB.sync( false); + fileLockOnDB.sync(); fileLockOnDB.close(); } catch (IOException ioe) Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java Tue Jan 11 15:45:35 2011 @@ -364,7 +364,7 @@ class RAFContainer extends FileContainer try { if (!dataFactory.dataNotSyncedAtAllocation) - fileData.sync( false); + fileData.sync(); } finally { @@ -640,7 +640,7 @@ class RAFContainer extends FileContainer inwrite = true; if (!dataFactory.dataNotSyncedAtAllocation) - fileData.sync(false); + fileData.sync(); } catch (IOException ioe) { @@ -758,7 +758,7 @@ class RAFContainer extends FileContainer try { if (!dataFactory.dataNotSyncedAtCheckpoint) - file.sync(false); + file.sync(); } finally @@ -1320,7 +1320,7 @@ class RAFContainer extends FileContainer } // sync the new version of the container. - newRaf.sync(true); + newRaf.sync(); newRaf.close(); newRaf = null; Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java Tue Jan 11 15:45:35 2011 @@ -660,7 +660,7 @@ public class LogAccessFile { synchronized( this) { - log.sync( false); + log.sync(); } // the sync succeed, so return Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java Tue Jan 11 15:45:35 2011 @@ -4194,7 +4194,7 @@ public final class LogToFile implements // mounted disk. We re-try to do this 20 times. try { - raf.sync( false); + raf.sync(); // the sync succeed, so return break; Modified: db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/io/StorageRandomAccessFile.java Tue Jan 11 15:45:35 2011 @@ -98,15 +98,11 @@ public interface StorageRandomAccessFile * Force any changes out to the persistent store. If the database is to be transient, that is, if the database * does not survive a restart, then the sync method implementation need not do anything. * - * @param metaData If true then this method must force both changes to the file's - * contents and metadata to be written to storage; if false, it need only force file content changes - * to be written. The implementation is allowed to ignore this parameter and always force out - * metadata changes. * * @exception SyncFailedException if a possibly recoverable error occurs. * @exception IOException If an IO error occurs. */ - public void sync( boolean metaData) throws IOException; + public void sync() throws IOException; /** * Reads up to len bytes of data from this file into an Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptRandomAccessFile.java Tue Jan 11 15:45:35 2011 @@ -101,9 +101,9 @@ public class CorruptRandomAccessFile imp /** * Force any changes out to the persistent store. */ - public void sync( boolean metaData) throws IOException + public void sync() throws IOException { - realRaf.sync(metaData); + realRaf.sync(); } Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java?rev=1057702&r1=1057701&r2=1057702&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java Tue Jan 11 15:45:35 2011 @@ -1818,7 +1818,7 @@ public class T_RecoverBadLog extends T_G filepos +=512; } - log.sync(false); + log.sync(); log.close(); }catch(IOException ie) {