mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Applying InnoDB Plugin 1.0.5 snapshot, part 6
From revision r5748 to r5783 Detailed revision comments: r5748 | marko | 2009-09-03 06:05:44 -0500 (Thu, 03 Sep 2009) | 1 line branches/zip: MLOG_MULTI_REC_END: Correct the comment. r5751 | marko | 2009-09-03 09:36:15 -0500 (Thu, 03 Sep 2009) | 7 lines branches/zip: row_merge(): Remove a bogus debug assertion that was triggered when creating an index on an empty table. row_merge_sort(): Add debug assertions and comments that justify the loop termination condition. The bogus assertion ut_ad(ihalf > 0) was reported by Michael. r5752 | marko | 2009-09-03 09:55:51 -0500 (Thu, 03 Sep 2009) | 10 lines branches/zip: recv_recover_page_func(): Write the log sequence number to the compressed page, if there is one. Previously, the function only wrote the LSN to the uncompressed page. It is not clear why recv_recover_page_func() is updating FIL_PAGE_LSN in the buffer pool. The log sequence number will be stamped on the page when it is flushed to disk, in buf_flush_init_for_writing(). I noticed this inconsistency when analyzing Issue #313, but this patch does not fix it. That is no surprise, since FIL_PAGE_LSN should only matter on disk files, not in the buffer pool. r5775 | calvin | 2009-09-07 16:15:05 -0500 (Mon, 07 Sep 2009) | 13 lines branches/zip: Build InnoDB on Windows with UNIV_HOTBACKUP The changes are non-functional changes for normal InnoDB, but needed for building the Hot Backup on Windows (with UNIV_HOTBACKUP defined). - Define os_aio_use_native_aio for HB. - Do not acquire seek mutexes for backup since HB is single threaded. - Do not use srv_flush_log_at_trx_commit for HB build rb://155 Approved by: Marko r5777 | marko | 2009-09-08 10:50:25 -0500 (Tue, 08 Sep 2009) | 2 lines branches/zip: Remove BUF_LRU_INITIAL_RATIO, which should have been removed together with buf_LRU_get_recent_limit(). r5779 | marko | 2009-09-09 01:17:19 -0500 (Wed, 09 Sep 2009) | 2 lines branches/zip: buf_page_peek_if_too_old(): Make the bitmasking work when buf_pool->freed_page_clock is wider than 32 bits. r5780 | marko | 2009-09-09 01:50:50 -0500 (Wed, 09 Sep 2009) | 1 line branches/zip: ut_time_ms(): Return ulint, not uint. r5782 | marko | 2009-09-09 02:00:59 -0500 (Wed, 09 Sep 2009) | 2 lines branches/zip: buf_page_peek_if_too_old(): Silence a compiler warning that was introduced in r5779 on 32-bit systems. r5783 | marko | 2009-09-09 02:25:00 -0500 (Wed, 09 Sep 2009) | 1 line branches/zip: buf_page_is_accessed(): Correct the function comment.
This commit is contained in:
@@ -88,7 +88,9 @@ UNIV_INTERN ibool os_do_not_call_flush_at_each_write = FALSE;
|
||||
/* We do not call os_file_flush in every os_file_write. */
|
||||
#endif /* UNIV_DO_FLUSH */
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
#ifdef UNIV_HOTBACKUP
|
||||
# define os_aio_use_native_aio FALSE
|
||||
#else /* UNIV_HOTBACKUP */
|
||||
/* We use these mutexes to protect lseek + file i/o operation, if the
|
||||
OS does not provide an atomic pread or pwrite, or similar */
|
||||
#define OS_FILE_N_SEEK_MUTEXES 16
|
||||
@@ -198,7 +200,7 @@ static ulint os_aio_n_segments = ULINT_UNDEFINED;
|
||||
/** If the following is TRUE, read i/o handler threads try to
|
||||
wait until a batch of new read requests have been posted */
|
||||
static ibool os_aio_recommend_sleep_for_read_threads = FALSE;
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
#endif /* UNIV_HOTBACKUP */
|
||||
|
||||
UNIV_INTERN ulint os_n_file_reads = 0;
|
||||
UNIV_INTERN ulint os_bytes_read_since_printout = 0;
|
||||
@@ -1245,6 +1247,7 @@ try_again:
|
||||
}
|
||||
#endif
|
||||
#ifdef UNIV_NON_BUFFERED_IO
|
||||
# ifndef UNIV_HOTBACKUP
|
||||
if (type == OS_LOG_FILE && srv_flush_log_at_trx_commit == 2) {
|
||||
/* Do not use unbuffered i/o to log files because
|
||||
value 2 denotes that we do not flush the log at every
|
||||
@@ -1253,10 +1256,14 @@ try_again:
|
||||
== SRV_WIN_IO_UNBUFFERED) {
|
||||
attributes = attributes | FILE_FLAG_NO_BUFFERING;
|
||||
}
|
||||
#endif
|
||||
# else /* !UNIV_HOTBACKUP */
|
||||
attributes = attributes | FILE_FLAG_NO_BUFFERING;
|
||||
# endif /* !UNIV_HOTBACKUP */
|
||||
#endif /* UNIV_NON_BUFFERED_IO */
|
||||
} else if (purpose == OS_FILE_NORMAL) {
|
||||
attributes = 0;
|
||||
#ifdef UNIV_NON_BUFFERED_IO
|
||||
# ifndef UNIV_HOTBACKUP
|
||||
if (type == OS_LOG_FILE && srv_flush_log_at_trx_commit == 2) {
|
||||
/* Do not use unbuffered i/o to log files because
|
||||
value 2 denotes that we do not flush the log at every
|
||||
@@ -1265,7 +1272,10 @@ try_again:
|
||||
== SRV_WIN_IO_UNBUFFERED) {
|
||||
attributes = attributes | FILE_FLAG_NO_BUFFERING;
|
||||
}
|
||||
#endif
|
||||
# else /* !UNIV_HOTBACKUP */
|
||||
attributes = attributes | FILE_FLAG_NO_BUFFERING;
|
||||
# endif /* !UNIV_HOTBACKUP */
|
||||
#endif /* UNIV_NON_BUFFERED_IO */
|
||||
} else {
|
||||
attributes = 0;
|
||||
ut_error;
|
||||
@@ -2227,7 +2237,9 @@ os_file_read(
|
||||
DWORD low;
|
||||
DWORD high;
|
||||
ibool retry;
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
ulint i;
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
ut_a((offset & 0xFFFFFFFFUL) == offset);
|
||||
|
||||
@@ -2246,16 +2258,20 @@ try_again:
|
||||
os_n_pending_reads++;
|
||||
os_mutex_exit(os_file_count_mutex);
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
/* Protect the seek / read operation with a mutex */
|
||||
i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
|
||||
|
||||
os_mutex_enter(os_file_seek_mutexes[i]);
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
ret2 = SetFilePointer(file, low, &high, FILE_BEGIN);
|
||||
|
||||
if (ret2 == 0xFFFFFFFF && GetLastError() != NO_ERROR) {
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
os_mutex_exit(os_file_seek_mutexes[i]);
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
os_mutex_enter(os_file_count_mutex);
|
||||
os_n_pending_reads--;
|
||||
@@ -2266,7 +2282,9 @@ try_again:
|
||||
|
||||
ret = ReadFile(file, buf, (DWORD) n, &len, NULL);
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
os_mutex_exit(os_file_seek_mutexes[i]);
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
os_mutex_enter(os_file_count_mutex);
|
||||
os_n_pending_reads--;
|
||||
@@ -2275,7 +2293,7 @@ try_again:
|
||||
if (ret && len == n) {
|
||||
return(TRUE);
|
||||
}
|
||||
#else
|
||||
#else /* __WIN__ */
|
||||
ibool retry;
|
||||
ssize_t ret;
|
||||
|
||||
@@ -2294,7 +2312,7 @@ try_again:
|
||||
"InnoDB: Was only able to read %ld.\n",
|
||||
(ulong)n, (ulong)offset_high,
|
||||
(ulong)offset, (long)ret);
|
||||
#endif
|
||||
#endif /* __WIN__ */
|
||||
#ifdef __WIN__
|
||||
error_handling:
|
||||
#endif
|
||||
@@ -2343,7 +2361,9 @@ os_file_read_no_error_handling(
|
||||
DWORD low;
|
||||
DWORD high;
|
||||
ibool retry;
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
ulint i;
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
ut_a((offset & 0xFFFFFFFFUL) == offset);
|
||||
|
||||
@@ -2362,16 +2382,20 @@ try_again:
|
||||
os_n_pending_reads++;
|
||||
os_mutex_exit(os_file_count_mutex);
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
/* Protect the seek / read operation with a mutex */
|
||||
i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
|
||||
|
||||
os_mutex_enter(os_file_seek_mutexes[i]);
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
ret2 = SetFilePointer(file, low, &high, FILE_BEGIN);
|
||||
|
||||
if (ret2 == 0xFFFFFFFF && GetLastError() != NO_ERROR) {
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
os_mutex_exit(os_file_seek_mutexes[i]);
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
os_mutex_enter(os_file_count_mutex);
|
||||
os_n_pending_reads--;
|
||||
@@ -2382,7 +2406,9 @@ try_again:
|
||||
|
||||
ret = ReadFile(file, buf, (DWORD) n, &len, NULL);
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
os_mutex_exit(os_file_seek_mutexes[i]);
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
os_mutex_enter(os_file_count_mutex);
|
||||
os_n_pending_reads--;
|
||||
@@ -2391,7 +2417,7 @@ try_again:
|
||||
if (ret && len == n) {
|
||||
return(TRUE);
|
||||
}
|
||||
#else
|
||||
#else /* __WIN__ */
|
||||
ibool retry;
|
||||
ssize_t ret;
|
||||
|
||||
@@ -2404,7 +2430,7 @@ try_again:
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
#endif
|
||||
#endif /* __WIN__ */
|
||||
#ifdef __WIN__
|
||||
error_handling:
|
||||
#endif
|
||||
@@ -2463,9 +2489,11 @@ os_file_write(
|
||||
DWORD ret2;
|
||||
DWORD low;
|
||||
DWORD high;
|
||||
ulint i;
|
||||
ulint n_retries = 0;
|
||||
ulint err;
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
ulint i;
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
ut_a((offset & 0xFFFFFFFF) == offset);
|
||||
|
||||
@@ -2482,16 +2510,20 @@ retry:
|
||||
os_n_pending_writes++;
|
||||
os_mutex_exit(os_file_count_mutex);
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
/* Protect the seek / write operation with a mutex */
|
||||
i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
|
||||
|
||||
os_mutex_enter(os_file_seek_mutexes[i]);
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
ret2 = SetFilePointer(file, low, &high, FILE_BEGIN);
|
||||
|
||||
if (ret2 == 0xFFFFFFFF && GetLastError() != NO_ERROR) {
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
os_mutex_exit(os_file_seek_mutexes[i]);
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
os_mutex_enter(os_file_count_mutex);
|
||||
os_n_pending_writes--;
|
||||
@@ -2525,7 +2557,9 @@ retry:
|
||||
}
|
||||
# endif /* UNIV_DO_FLUSH */
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
os_mutex_exit(os_file_seek_mutexes[i]);
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
os_mutex_enter(os_file_count_mutex);
|
||||
os_n_pending_writes--;
|
||||
|
Reference in New Issue
Block a user