diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2014-07-25 14:37:10 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@skysql.com> | 2014-07-25 14:37:10 +0300 |
commit | 56c4b016ad5ee7ec994cde8a27934a89259fe670 (patch) | |
tree | ed665eff756282baddb00d09d3a0b26aadbfba14 /storage/innobase/include/os0file.h | |
parent | 911c4811ded0826386c53a2d6fbbe26a7a304089 (diff) | |
download | mariadb-git-56c4b016ad5ee7ec994cde8a27934a89259fe670.tar.gz |
Fiix random test failures on fil_decompress_page_2 function.
Analysis: InnoDB writes also files that do not contain FIL-header.
This could lead incorrect analysis on os_fil_read_func function
when it tries to see is page page compressed based on FIL_PAGE_TYPE
field on FIL-header. With bad luck uncompressed page that does
not contain FIL-headed, the byte on FIL_PAGE_TYPE position could
indicate that page is page comrpessed.
Fix: Upper layer must indicate is file space page compressed
or not. If this is not yet known, we need to read the FIL-header
and find it out. Files that we know that are not page compressed
we can always just provide FALSE.
Diffstat (limited to 'storage/innobase/include/os0file.h')
-rw-r--r-- | storage/innobase/include/os0file.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index b6c6f50865c..8f19d396c92 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -317,12 +317,12 @@ The wrapper functions have the prefix of "innodb_". */ n, message1, message2, write_size, \ page_compression, page_compression_level, __FILE__, __LINE__) -# define os_file_read(file, buf, offset, n) \ - pfs_os_file_read_func(file, buf, offset, n, __FILE__, __LINE__) +# define os_file_read(file, buf, offset, n, compressed) \ + pfs_os_file_read_func(file, buf, offset, n, compressed, __FILE__, __LINE__) -# define os_file_read_no_error_handling(file, buf, offset, n) \ +# define os_file_read_no_error_handling(file, buf, offset, n, compressed) \ pfs_os_file_read_no_error_handling_func(file, buf, offset, n, \ - __FILE__, __LINE__) + compressed, __FILE__, __LINE__) # define os_file_write(name, file, buf, offset, n) \ pfs_os_file_write_func(name, file, buf, offset, \ @@ -360,11 +360,11 @@ to original un-instrumented file I/O APIs */ os_aio_func(type, mode, name, file, buf, offset, n, \ message1, message2, write_size, page_compression, page_compression_level) -# define os_file_read(file, buf, offset, n) \ - os_file_read_func(file, buf, offset, n) +# define os_file_read(file, buf, offset, n, compressed) \ + os_file_read_func(file, buf, offset, n, compressed) -# define os_file_read_no_error_handling(file, buf, offset, n) \ - os_file_read_no_error_handling_func(file, buf, offset, n) +# define os_file_read_no_error_handling(file, buf, offset, n, compressed) \ + os_file_read_no_error_handling_func(file, buf, offset, n, compressed) # define os_file_write(name, file, buf, offset, n) \ os_file_write_func(name, file, buf, offset, n) @@ -715,6 +715,8 @@ pfs_os_file_read_func( void* buf, /*!< in: buffer where to read */ os_offset_t offset, /*!< in: file offset where to read */ ulint n, /*!< in: number of bytes to read */ + ibool compressed, /*!< in: is this file space + compressed ? */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line);/*!< in: line where the func invoked */ @@ -733,6 +735,8 @@ pfs_os_file_read_no_error_handling_func( void* buf, /*!< in: buffer where to read */ os_offset_t offset, /*!< in: file offset where to read */ ulint n, /*!< in: number of bytes to read */ + ibool compressed, /*!< in: is this file space + compressed ? */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line);/*!< in: line where the func invoked */ @@ -928,7 +932,9 @@ os_file_read_func( os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read */ os_offset_t offset, /*!< in: file offset where to read */ - ulint n); /*!< in: number of bytes to read */ + ulint n, /*!< in: number of bytes to read */ + ibool compressed); /*!< in: is this file space + compressed ? */ /*******************************************************************//** Rewind file to its start, read at most size - 1 bytes from it to str, and NUL-terminate str. All errors are silently ignored. This function is @@ -953,7 +959,9 @@ os_file_read_no_error_handling_func( os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read */ os_offset_t offset, /*!< in: file offset where to read */ - ulint n); /*!< in: number of bytes to read */ + ulint n, /*!< in: number of bytes to read */ + ibool compressed); /*!< in: is this file space + compressed ? */ /*******************************************************************//** NOTE! Use the corresponding macro os_file_write(), not directly this @@ -970,6 +978,7 @@ os_file_write_func( const void* buf, /*!< in: buffer from which to write */ os_offset_t offset, /*!< in: file offset where to write */ ulint n); /*!< in: number of bytes to write */ + /*******************************************************************//** Check the existence and type of the given file. @return TRUE if call succeeded */ |