You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Suresh Thalamati <su...@gmail.com> on 2005/05/23 23:38:05 UTC

[PATCH] minor fix releated to the transaction log checksum feature (Derby-96)

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


Re: [PATCH] minor fix releated to the transaction log checksum feature (Derby-96)

Posted by Mike Matrigali <mi...@sbcglobal.net>.
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;
>  			}
>  		}
>  		


Re: [PATCH] minor fix releated to the transaction log checksum feature (Derby-96)

Posted by Mike Matrigali <mi...@sbcglobal.net>.
I have committed this patch with svn 178486.

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;
>  			}
>  		}
>