db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r178494 - /incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
Date Wed, 25 May 2005 17:25:08 GMT
Author: mikem
Date: Wed May 25 10:25:07 2005
New Revision: 178494

URL: http://svn.apache.org/viewcvs?rev=178494&view=rev
Log:
small fix to make sure that log buffers are switched are correctly when the are 
full, when the log checksum  feature is disabled due to a  soft upgrade.

committed on behalf of: suresh.thalamati@gmail.com


Modified:
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java?rev=178494&r1=178493&r2=178494&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
Wed May 25 10:25:07 2005
@@ -745,8 +745,6 @@
 	protected long reserveSpaceForChecksum(int length, long logFileNumber, long currentPosition
)
 		throws StandardException, IOException 
 	{
-		if(!writeChecksum)
-			return 0;
 
 		int total_log_record_length = length + LOG_RECORD_FIXED_OVERHEAD_SIZE;
 		boolean reserveChecksumSpace = false;
@@ -771,7 +769,8 @@
 		 */
 		if(currentBuffer.position == checksumLogRecordSize)
 		{
-			reserveChecksumSpace = true;
+			// reserver space if log checksum feature is enabled.
+			reserveChecksumSpace = writeChecksum;
 		}
 		else{
 			if (total_log_record_length > currentBuffer.bytes_free)
@@ -780,7 +779,8 @@
 				// going to fit in the current buffer, switch the 
 				// log buffer to create buffer space for it. 
 				switchLogBuffer();
-				reserveChecksumSpace = true;
+				// reserve space if log checksum feature is enabled. 
+				reserveChecksumSpace = writeChecksum;
 			}
 		}
 		



Mime
View raw message