db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: [PATCH] minor fix releated to the transaction log checksum feature (Derby-96)
Date Wed, 25 May 2005 17:25:35 GMT
I committed this patch:
m2_142:159>svn commit

Sending 
java\engine\org\apache\derby\impl\store\raw\log\LogAccessFile.jav
a
Transmitting file data .
Committed revision 178494.

Suresh Thalamati wrote:
> 
> Attached is 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.
> 
> Tests:  Ran derbyall ,  There were only two known 
> failires(store/backupRestore1.
>                                                                                     
 
> java, jdbcapi/parameterMapping.java)
> 
> Thanks
> -suresht
> 
> 
> ------------------------------------------------------------------------
> 
> Index: java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java	(revision 178022)
> +++ java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java	(working copy)
> @@ -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