Commit 1d229939 authored by marko's avatar marko

branches/zip: recv_scan_log_recs(): Remove a compile-time constant parameter.

parent 1370fe0a
......@@ -2,7 +2,7 @@
* buf/buf0buf.c, include/log0recv.h, log/log0recv.c:
Remove the compile-time constant parameters of
recv_recover_page() and recv_sys_init().
recv_recover_page(), recv_scan_log_recs(), and recv_sys_init().
2009-03-20 The InnoDB Team
......
......@@ -135,8 +135,10 @@ void
recv_recovery_from_checkpoint_finish(void);
/*======================================*/
/***********************************************************
Scans log from a buffer and stores new log data to the parsing buffer. Parses
and hashes the log records if new data found. */
Scans log from a buffer and stores new log data to the parsing buffer.
Parses and hashes the log records if new data found. Unless
UNIV_HOTBACKUP is defined, this function will apply log records
automatically when the hash table becomes full. */
UNIV_INTERN
ibool
recv_scan_log_recs(
......@@ -144,20 +146,14 @@ recv_scan_log_recs(
/* out: TRUE if limit_lsn has been
reached, or not able to scan any more
in this log group */
ibool apply_automatically,/* in: TRUE if we want this
function to apply log records
automatically when the hash table
becomes full; in the hot backup tool
the tool does the applying, not this
function */
ulint available_memory,/* in: we let the hash table of recs
to grow to this size, at the maximum */
ibool store_to_hash, /* in: TRUE if the records should be
stored to the hash table; this is set
to FALSE if just debug checking is
needed */
byte* buf, /* in: buffer containing a log segment
or garbage */
const byte* buf, /* in: buffer containing a log
segment or garbage */
ulint len, /* in: buffer length */
ib_uint64_t start_lsn, /* in: buffer start lsn */
ib_uint64_t* contiguous_lsn, /* in/out: it is known that all log
......
......@@ -3220,8 +3220,7 @@ log_check_log_recs(
ut_memcpy(scan_buf, start, end - start);
recv_scan_log_recs(TRUE,
(buf_pool->curr_size
recv_scan_log_recs((buf_pool->curr_size
- recv_n_pool_free_frames) * UNIV_PAGE_SIZE,
FALSE, scan_buf, end - start,
ut_uint64_align_down(buf_start_lsn,
......
......@@ -2237,8 +2237,10 @@ recv_sys_justify_left_parsing_buf(void)
}
/***********************************************************
Scans log from a buffer and stores new log data to the parsing buffer. Parses
and hashes the log records if new data found. */
Scans log from a buffer and stores new log data to the parsing buffer.
Parses and hashes the log records if new data found. Unless
UNIV_HOTBACKUP is defined, this function will apply log records
automatically when the hash table becomes full. */
UNIV_INTERN
ibool
recv_scan_log_recs(
......@@ -2246,20 +2248,14 @@ recv_scan_log_recs(
/* out: TRUE if limit_lsn has been
reached, or not able to scan any more
in this log group */
ibool apply_automatically,/* in: TRUE if we want this
function to apply log records
automatically when the hash table
becomes full; in the hot backup tool
the tool does the applying, not this
function */
ulint available_memory,/* in: we let the hash table of recs
to grow to this size, at the maximum */
ibool store_to_hash, /* in: TRUE if the records should be
stored to the hash table; this is set
to FALSE if just debug checking is
needed */
byte* buf, /* in: buffer containing a log segment
or garbage */
const byte* buf, /* in: buffer containing a log
segment or garbage */
ulint len, /* in: buffer length */
ib_uint64_t start_lsn, /* in: buffer start lsn */
ib_uint64_t* contiguous_lsn, /* in/out: it is known that all log
......@@ -2268,7 +2264,7 @@ recv_scan_log_recs(
ib_uint64_t* group_scanned_lsn)/* out: scanning succeeded up to
this lsn */
{
byte* log_block;
const byte* log_block;
ulint no;
ib_uint64_t scanned_lsn;
ibool finished;
......@@ -2278,7 +2274,6 @@ recv_scan_log_recs(
ut_ad(start_lsn % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(len % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(len > 0);
ut_a(apply_automatically <= TRUE);
ut_a(store_to_hash <= TRUE);
finished = FALSE;
......@@ -2441,9 +2436,9 @@ recv_scan_log_recs(
recv_parse_log_recs(store_to_hash);
#ifndef UNIV_HOTBACKUP
if (store_to_hash && mem_heap_get_size(recv_sys->heap)
> available_memory
&& apply_automatically) {
> available_memory) {
/* Hash table of log records has grown too big:
empty it; FALSE means no ibuf operations
......@@ -2453,6 +2448,7 @@ recv_scan_log_recs(
recv_apply_hashed_log_recs(FALSE);
}
#endif /* !UNIV_HOTBACKUP */
if (recv_sys->recovered_offset > RECV_PARSING_BUF_SIZE / 4) {
/* Move parsing buffer data to the buffer start */
......@@ -2493,7 +2489,7 @@ recv_group_scan_log_recs(
group, start_lsn, end_lsn);
finished = recv_scan_log_recs(
TRUE, (buf_pool->curr_size - recv_n_pool_free_frames)
(buf_pool->curr_size - recv_n_pool_free_frames)
* UNIV_PAGE_SIZE, TRUE, log_sys->buf, RECV_SCAN_SIZE,
start_lsn, contiguous_lsn, group_scanned_lsn);
start_lsn = end_lsn;
......@@ -3316,7 +3312,7 @@ ask_again:
read_offset % UNIV_PAGE_SIZE, len, buf, NULL);
ret = recv_scan_log_recs(
TRUE, (buf_pool->n_frames - recv_n_pool_free_frames)
(buf_pool->n_frames - recv_n_pool_free_frames)
* UNIV_PAGE_SIZE, TRUE, buf, len, start_lsn,
&dummy_lsn, &scanned_lsn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment