Commit 6a756b3a authored by Jan Lindström's avatar Jan Lindström

Code cleanup: Removed some unnecessary outputs from standard builds (available on

special builds UNIV_PAGECOMPRESS_DEBUG and UNIV_MTFLUSH_DEBUG).

Added a new status variable compress_pages_page_compression_error to count possible
compression errors.
parent 3ea72a2b
...@@ -2461,7 +2461,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( ...@@ -2461,7 +2461,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
/* Flush pages from end of LRU if required */ /* Flush pages from end of LRU if required */
n_lru = n_flushed = buf_flush_LRU_tail(); n_lru = n_flushed = buf_flush_LRU_tail();
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
if (n_lru) { if (n_lru) {
fprintf(stderr,"n_lru:%lu ",n_lru); fprintf(stderr,"n_lru:%lu ",n_lru);
} }
......
...@@ -195,7 +195,7 @@ buf_mtflu_flush_pool_instance( ...@@ -195,7 +195,7 @@ buf_mtflu_flush_pool_instance(
pools based on the assumption that it will pools based on the assumption that it will
help in the retry which will follow the help in the retry which will follow the
failure. */ failure. */
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
fprintf(stderr, "InnoDB: Note: buf flush start failed there is already active flush for this buffer pool.\n"); fprintf(stderr, "InnoDB: Note: buf flush start failed there is already active flush for this buffer pool.\n");
#endif #endif
return 0; return 0;
...@@ -330,12 +330,12 @@ DECLARE_THREAD(mtflush_io_thread)( ...@@ -330,12 +330,12 @@ DECLARE_THREAD(mtflush_io_thread)(
while (TRUE) { while (TRUE) {
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
fprintf(stderr, "InnoDB: Note. Thread %lu work queue len %lu return queue len %lu\n", fprintf(stderr, "InnoDB: Note. Thread %lu work queue len %lu return queue len %lu\n",
os_thread_get_curr_id(), os_thread_get_curr_id(),
ib_wqueue_len(mtflush_io->wq), ib_wqueue_len(mtflush_io->wq),
ib_wqueue_len(mtflush_io->wr_cq)); ib_wqueue_len(mtflush_io->wr_cq));
#endif /* UNIV_DEBUG */ #endif /* UNIV_MTFLUSH_DEBUG */
mtflush_service_io(mtflush_io, this_thread_data); mtflush_service_io(mtflush_io, this_thread_data);
...@@ -374,7 +374,7 @@ buf_mtflu_io_thread_exit(void) ...@@ -374,7 +374,7 @@ buf_mtflu_io_thread_exit(void)
mtflush_io->gwt_status = WTHR_KILL_IT; mtflush_io->gwt_status = WTHR_KILL_IT;
fprintf(stderr, "signal mtflush_io_threads to exit [%lu]\n", fprintf(stderr, "InnoDB: [Note]: Signal mtflush_io_threads to exit [%lu]\n",
srv_mtflush_threads); srv_mtflush_threads);
/* Send one exit work item/thread */ /* Send one exit work item/thread */
...@@ -544,6 +544,7 @@ buf_mtflu_flush_work_items( ...@@ -544,6 +544,7 @@ buf_mtflu_flush_work_items(
if (done_wi != NULL) { if (done_wi != NULL) {
per_pool_pages_flushed[i] = done_wi->n_flushed; per_pool_pages_flushed[i] = done_wi->n_flushed;
#if UNIV_DEBUG
if((int)done_wi->id_usr == 0 && if((int)done_wi->id_usr == 0 &&
(done_wi->wi_status == WRK_ITEM_SET || (done_wi->wi_status == WRK_ITEM_SET ||
done_wi->wi_status == WRK_ITEM_UNSET)) { done_wi->wi_status == WRK_ITEM_UNSET)) {
...@@ -553,6 +554,7 @@ buf_mtflu_flush_work_items( ...@@ -553,6 +554,7 @@ buf_mtflu_flush_work_items(
done_wi->wr.flush_type); done_wi->wr.flush_type);
ut_a(0); ut_a(0);
} }
#endif
n_flushed+= done_wi->n_flushed; n_flushed+= done_wi->n_flushed;
i++; i++;
...@@ -621,7 +623,7 @@ buf_mtflu_flush_list( ...@@ -621,7 +623,7 @@ buf_mtflu_flush_list(
cnt_flush[i]); cnt_flush[i]);
} }
} }
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
fprintf(stderr, "%s: [1] [*n_processed: (min:%lu)%lu ]\n", fprintf(stderr, "%s: [1] [*n_processed: (min:%lu)%lu ]\n",
__FUNCTION__, (min_n * srv_buf_pool_instances), *n_processed); __FUNCTION__, (min_n * srv_buf_pool_instances), *n_processed);
#endif #endif
...@@ -663,7 +665,7 @@ buf_mtflu_flush_LRU_tail(void) ...@@ -663,7 +665,7 @@ buf_mtflu_flush_LRU_tail(void)
} }
} }
#if UNIV_DEBUG #if UNIV_MTFLUSH_DEBUG
fprintf(stderr, "[1] [*n_processed: (min:%lu)%lu ]\n", ( fprintf(stderr, "[1] [*n_processed: (min:%lu)%lu ]\n", (
srv_LRU_scan_depth * srv_buf_pool_instances), total_flushed); srv_LRU_scan_depth * srv_buf_pool_instances), total_flushed);
#endif #endif
......
...@@ -106,11 +106,11 @@ fil_compress_page( ...@@ -106,11 +106,11 @@ fil_compress_page(
level = page_zip_level; level = page_zip_level;
} }
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: Note: Preparing for compress for space %lu name %s len %lu\n", "InnoDB: Note: Preparing for compress for space %lu name %s len %lu\n",
space_id, fil_space_name(space), len); space_id, fil_space_name(space), len);
#endif /* UNIV_DEBUG */ #endif /* UNIV_PAGECOMPRESS_DEBUG */
write_size = UNIV_PAGE_SIZE - header_len; write_size = UNIV_PAGE_SIZE - header_len;
...@@ -126,6 +126,7 @@ fil_compress_page( ...@@ -126,6 +126,7 @@ fil_compress_page(
"InnoDB: Warning: Compression failed for space %lu name %s len %lu rt %d write %lu\n", "InnoDB: Warning: Compression failed for space %lu name %s len %lu rt %d write %lu\n",
space_id, fil_space_name(space), len, err, write_size); space_id, fil_space_name(space), len, err, write_size);
srv_stats.pages_page_compression_error.inc();
*out_len = len; *out_len = len;
return (buf); return (buf);
} }
...@@ -140,6 +141,7 @@ fil_compress_page( ...@@ -140,6 +141,7 @@ fil_compress_page(
"InnoDB: Warning: Compression failed for space %lu name %s len %lu rt %d write %lu\n", "InnoDB: Warning: Compression failed for space %lu name %s len %lu rt %d write %lu\n",
space_id, fil_space_name(space), len, err, write_size); space_id, fil_space_name(space), len, err, write_size);
srv_stats.pages_page_compression_error.inc();
*out_len = len; *out_len = len;
return (buf); return (buf);
} }
...@@ -197,11 +199,11 @@ fil_compress_page( ...@@ -197,11 +199,11 @@ fil_compress_page(
ut_a((write_size % SECT_SIZE) == 0); ut_a((write_size % SECT_SIZE) == 0);
} }
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: Note: Compression succeeded for space %lu name %s len %lu out_len %lu\n", "InnoDB: Note: Compression succeeded for space %lu name %s len %lu out_len %lu\n",
space_id, fil_space_name(space), len, write_size); space_id, fil_space_name(space), len, write_size);
#endif #endif /* UNIV_PAGECOMPRESS_DEBUG */
srv_stats.page_compression_saved.add((len - write_size)); srv_stats.page_compression_saved.add((len - write_size));
...@@ -209,7 +211,7 @@ fil_compress_page( ...@@ -209,7 +211,7 @@ fil_compress_page(
srv_stats.page_compression_trim_sect512.add(((len - write_size) / SECT_SIZE)); srv_stats.page_compression_trim_sect512.add(((len - write_size) / SECT_SIZE));
srv_stats.page_compression_trim_sect4096.add(((len - write_size) / (SECT_SIZE*8))); srv_stats.page_compression_trim_sect4096.add(((len - write_size) / (SECT_SIZE*8)));
} }
//srv_stats.page_compressed_trim_op.inc();
srv_stats.pages_page_compressed.inc(); srv_stats.pages_page_compressed.inc();
*out_len = write_size; *out_len = write_size;
...@@ -258,10 +260,10 @@ fil_decompress_page( ...@@ -258,10 +260,10 @@ fil_decompress_page(
// If no buffer was given, we need to allocate temporal buffer // If no buffer was given, we need to allocate temporal buffer
if (page_buf == NULL) { if (page_buf == NULL) {
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: Note: FIL: Compression buffer not given, allocating...\n"); "InnoDB: Note: FIL: Compression buffer not given, allocating...\n");
#endif /* UNIV_DEBUG */ #endif /* UNIV_PAGECOMPRESS_DEBUG */
in_buf = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE)); in_buf = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE));
} else { } else {
in_buf = page_buf; in_buf = page_buf;
...@@ -287,11 +289,11 @@ fil_decompress_page( ...@@ -287,11 +289,11 @@ fil_decompress_page(
if (compression_alg == FIL_PAGE_COMPRESSION_ZLIB) { if (compression_alg == FIL_PAGE_COMPRESSION_ZLIB) {
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: Note: Preparing for decompress for len %lu\n", "InnoDB: Note: Preparing for decompress for len %lu\n",
actual_size); actual_size);
#endif /* UNIV_DEBUG */ #endif /* UNIV_PAGECOMPRESS_DEBUG */
err= uncompress(in_buf, &len, buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (unsigned long)actual_size); err= uncompress(in_buf, &len, buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (unsigned long)actual_size);
...@@ -310,11 +312,11 @@ fil_decompress_page( ...@@ -310,11 +312,11 @@ fil_decompress_page(
ut_error; ut_error;
} }
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: Note: Decompression succeeded for len %lu \n", "InnoDB: Note: Decompression succeeded for len %lu \n",
len); len);
#endif /* UNIV_DEBUG */ #endif /* UNIV_PAGECOMPRESS_DEBUG */
#ifdef HAVE_LZ4 #ifdef HAVE_LZ4
} else if (compression_alg == FIL_PAGE_COMPRESSION_LZ4) { } else if (compression_alg == FIL_PAGE_COMPRESSION_LZ4) {
err = LZ4_decompress_fast((const char *)buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (char *)in_buf, UNIV_PAGE_SIZE); err = LZ4_decompress_fast((const char *)buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (char *)in_buf, UNIV_PAGE_SIZE);
......
...@@ -315,6 +315,7 @@ enum monitor_id_t { ...@@ -315,6 +315,7 @@ enum monitor_id_t {
MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP,
MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED,
MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED, MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED,
MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERROR,
/* Index related counters */ /* Index related counters */
MONITOR_MODULE_INDEX, MONITOR_MODULE_INDEX,
......
...@@ -121,6 +121,8 @@ struct srv_stats_t { ...@@ -121,6 +121,8 @@ struct srv_stats_t {
ulint_ctr_64_t page_compressed_trim_op_saved; ulint_ctr_64_t page_compressed_trim_op_saved;
/* Number of pages decompressed with page compression */ /* Number of pages decompressed with page compression */
ulint_ctr_64_t pages_page_decompressed; ulint_ctr_64_t pages_page_decompressed;
/* Number of page compression errors */
ulint_ctr_64_t pages_page_compression_error;
/** Number of data read in total (in bytes) */ /** Number of data read in total (in bytes) */
ulint_ctr_1_t data_read; ulint_ctr_1_t data_read;
...@@ -908,6 +910,8 @@ struct export_var_t{ ...@@ -908,6 +910,8 @@ struct export_var_t{
ib_int64_t innodb_pages_page_decompressed;/*!< Number of pages ib_int64_t innodb_pages_page_decompressed;/*!< Number of pages
decompressed by page decompressed by page
compression */ compression */
ib_int64_t innodb_pages_page_compression_error;/*!< Number of page
compression errors */
}; };
/** Thread slot in the thread table. */ /** Thread slot in the thread table. */
......
...@@ -6166,7 +6166,7 @@ os_file_trim( ...@@ -6166,7 +6166,7 @@ os_file_trim(
*slot->write_size > 0 && *slot->write_size > 0 &&
len >= *slot->write_size)) { len >= *slot->write_size)) {
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu\n", fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu\n",
*slot->write_size, trim_len, len); *slot->write_size, trim_len, len);
#endif #endif
......
...@@ -926,6 +926,11 @@ static monitor_info_t innodb_counter_info[] = ...@@ -926,6 +926,11 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_NONE, MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED}, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED},
{"compress_pages_page_compression_error", "compression",
"Number of page compression errors",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERROR},
/* ========== Counters for Index ========== */ /* ========== Counters for Index ========== */
{"module_index", "index", "Index Manager", {"module_index", "index", "Index Manager",
MONITOR_MODULE, MONITOR_MODULE,
...@@ -1871,6 +1876,9 @@ srv_mon_process_existing_counter( ...@@ -1871,6 +1876,9 @@ srv_mon_process_existing_counter(
case MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED: case MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED:
value = srv_stats.pages_page_decompressed; value = srv_stats.pages_page_decompressed;
break; break;
case MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERROR:
value = srv_stats.pages_page_compression_error;
break;
default: default:
ut_error; ut_error;
......
...@@ -721,7 +721,7 @@ buf_flush_write_complete( ...@@ -721,7 +721,7 @@ buf_flush_write_complete(
buf_pool->n_flush[flush_type]--; buf_pool->n_flush[flush_type]--;
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
fprintf(stderr, "n pending flush %lu\n", fprintf(stderr, "n pending flush %lu\n",
buf_pool->n_flush[flush_type]); buf_pool->n_flush[flush_type]);
#endif #endif
...@@ -1863,7 +1863,7 @@ buf_flush_start( ...@@ -1863,7 +1863,7 @@ buf_flush_start(
/* There is already a flush batch of the same type running */ /* There is already a flush batch of the same type running */
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, "Error: flush_type %d n_flush %lu init_flush %lu\n", fprintf(stderr, "Error: flush_type %d n_flush %lu init_flush %lu\n",
flush_type, buf_pool->n_flush[flush_type], buf_pool->init_flush[flush_type]); flush_type, buf_pool->n_flush[flush_type], buf_pool->init_flush[flush_type]);
#endif #endif
...@@ -2732,7 +2732,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( ...@@ -2732,7 +2732,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
/* Flush pages from end of LRU if required */ /* Flush pages from end of LRU if required */
n_lru = n_flushed = buf_flush_LRU_tail(); n_lru = n_flushed = buf_flush_LRU_tail();
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
if (n_lru) { if (n_lru) {
fprintf(stderr,"n_lru:%lu ",n_lru); fprintf(stderr,"n_lru:%lu ",n_lru);
} }
...@@ -2743,7 +2743,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( ...@@ -2743,7 +2743,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
/* Flush pages from flush_list if required */ /* Flush pages from flush_list if required */
n_flushed += n_pgc_flush = page_cleaner_flush_pages_if_needed(); n_flushed += n_pgc_flush = page_cleaner_flush_pages_if_needed();
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
if (n_pgc_flush) { if (n_pgc_flush) {
fprintf(stderr,"n_pgc_flush:%lu ",n_pgc_flush); fprintf(stderr,"n_pgc_flush:%lu ",n_pgc_flush);
} }
...@@ -2760,16 +2760,16 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( ...@@ -2760,16 +2760,16 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
MONITOR_FLUSH_BACKGROUND_PAGES, MONITOR_FLUSH_BACKGROUND_PAGES,
n_flushed); n_flushed);
} }
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
if (n_pgc_batch) { if (n_pgc_batch) {
fprintf(stderr,"n_pgc_batch:%lu ",n_pgc_batch); fprintf(stderr,"n_pgc_batch:%lu ",n_pgc_batch);
} }
#endif #endif
} }
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
if (n_lru || n_pgc_flush || n_pgc_batch) { if (n_lru || n_pgc_flush || n_pgc_batch) {
fprintf(stderr,"\n"); fprintf1(stderr,"\n");
n_lru = n_pgc_flush = n_pgc_batch = 0; n_lru = n_pgc_flush = n_pgc_batch = 0;
} }
#endif #endif
......
...@@ -199,7 +199,7 @@ buf_mtflu_flush_pool_instance( ...@@ -199,7 +199,7 @@ buf_mtflu_flush_pool_instance(
pools based on the assumption that it will pools based on the assumption that it will
help in the retry which will follow the help in the retry which will follow the
failure. */ failure. */
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
fprintf(stderr, "InnoDB: Note: buf flush start failed there is already active flush for this buffer pool.\n"); fprintf(stderr, "InnoDB: Note: buf flush start failed there is already active flush for this buffer pool.\n");
#endif #endif
return 0; return 0;
...@@ -337,12 +337,12 @@ DECLARE_THREAD(mtflush_io_thread)( ...@@ -337,12 +337,12 @@ DECLARE_THREAD(mtflush_io_thread)(
while (TRUE) { while (TRUE) {
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
fprintf(stderr, "InnoDB: Note. Thread %lu work queue len %lu return queue len %lu\n", fprintf(stderr, "InnoDB: Note. Thread %lu work queue len %lu return queue len %lu\n",
os_thread_get_curr_id(), os_thread_get_curr_id(),
ib_wqueue_len(mtflush_io->wq), ib_wqueue_len(mtflush_io->wq),
ib_wqueue_len(mtflush_io->wr_cq)); ib_wqueue_len(mtflush_io->wr_cq));
#endif /* UNIV_DEBUG */ #endif /* UNIV_MTFLUSH_DEBUG */
mtflush_service_io(mtflush_io, this_thread_data); mtflush_service_io(mtflush_io, this_thread_data);
...@@ -381,7 +381,7 @@ buf_mtflu_io_thread_exit(void) ...@@ -381,7 +381,7 @@ buf_mtflu_io_thread_exit(void)
mtflush_io->gwt_status = WTHR_KILL_IT; mtflush_io->gwt_status = WTHR_KILL_IT;
fprintf(stderr, "signal mtflush_io_threads to exit [%lu]\n", fprintf(stderr, "InnoDB: [Note]: Signal mtflush_io_threads to exit [%lu]\n",
srv_mtflush_threads); srv_mtflush_threads);
/* Send one exit work item/thread */ /* Send one exit work item/thread */
...@@ -551,6 +551,7 @@ buf_mtflu_flush_work_items( ...@@ -551,6 +551,7 @@ buf_mtflu_flush_work_items(
if (done_wi != NULL) { if (done_wi != NULL) {
per_pool_pages_flushed[i] = done_wi->n_flushed; per_pool_pages_flushed[i] = done_wi->n_flushed;
#if UNIV_DEBUG
if((int)done_wi->id_usr == 0 && if((int)done_wi->id_usr == 0 &&
(done_wi->wi_status == WRK_ITEM_SET || (done_wi->wi_status == WRK_ITEM_SET ||
done_wi->wi_status == WRK_ITEM_UNSET)) { done_wi->wi_status == WRK_ITEM_UNSET)) {
...@@ -560,6 +561,7 @@ buf_mtflu_flush_work_items( ...@@ -560,6 +561,7 @@ buf_mtflu_flush_work_items(
done_wi->wr.flush_type); done_wi->wr.flush_type);
ut_a(0); ut_a(0);
} }
#endif
n_flushed+= done_wi->n_flushed; n_flushed+= done_wi->n_flushed;
i++; i++;
...@@ -631,7 +633,7 @@ buf_mtflu_flush_list( ...@@ -631,7 +633,7 @@ buf_mtflu_flush_list(
cnt_flush[i]); cnt_flush[i]);
} }
} }
#ifdef UNIV_DEBUG #ifdef UNIV_MTFLUSH_DEBUG
fprintf(stderr, "%s: [1] [*n_processed: (min:%lu)%lu ]\n", fprintf(stderr, "%s: [1] [*n_processed: (min:%lu)%lu ]\n",
__FUNCTION__, (min_n * srv_buf_pool_instances), *n_processed); __FUNCTION__, (min_n * srv_buf_pool_instances), *n_processed);
#endif #endif
...@@ -673,7 +675,7 @@ buf_mtflu_flush_LRU_tail(void) ...@@ -673,7 +675,7 @@ buf_mtflu_flush_LRU_tail(void)
} }
} }
#if UNIV_DEBUG #if UNIV_MTFLUSH_DEBUG
fprintf(stderr, "[1] [*n_processed: (min:%lu)%lu ]\n", ( fprintf(stderr, "[1] [*n_processed: (min:%lu)%lu ]\n", (
srv_LRU_scan_depth * srv_buf_pool_instances), total_flushed); srv_LRU_scan_depth * srv_buf_pool_instances), total_flushed);
#endif #endif
......
...@@ -106,11 +106,11 @@ fil_compress_page( ...@@ -106,11 +106,11 @@ fil_compress_page(
level = page_zip_level; level = page_zip_level;
} }
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: Note: Preparing for compress for space %lu name %s len %lu\n", "InnoDB: Note: Preparing for compress for space %lu name %s len %lu\n",
space_id, fil_space_name(space), len); space_id, fil_space_name(space), len);
#endif /* UNIV_DEBUG */ #endif /* UNIV_PAGECOMPRESS_DEBUG */
write_size = UNIV_PAGE_SIZE - header_len; write_size = UNIV_PAGE_SIZE - header_len;
...@@ -126,6 +126,7 @@ fil_compress_page( ...@@ -126,6 +126,7 @@ fil_compress_page(
"InnoDB: Warning: Compression failed for space %lu name %s len %lu rt %d write %lu\n", "InnoDB: Warning: Compression failed for space %lu name %s len %lu rt %d write %lu\n",
space_id, fil_space_name(space), len, err, write_size); space_id, fil_space_name(space), len, err, write_size);
srv_stats.pages_page_compression_error.inc();
*out_len = len; *out_len = len;
return (buf); return (buf);
} }
...@@ -140,6 +141,7 @@ fil_compress_page( ...@@ -140,6 +141,7 @@ fil_compress_page(
"InnoDB: Warning: Compression failed for space %lu name %s len %lu rt %d write %lu\n", "InnoDB: Warning: Compression failed for space %lu name %s len %lu rt %d write %lu\n",
space_id, fil_space_name(space), len, err, write_size); space_id, fil_space_name(space), len, err, write_size);
srv_stats.pages_page_compression_error.inc();
*out_len = len; *out_len = len;
return (buf); return (buf);
} }
...@@ -193,11 +195,11 @@ fil_compress_page( ...@@ -193,11 +195,11 @@ fil_compress_page(
ut_a((write_size % SECT_SIZE) == 0); ut_a((write_size % SECT_SIZE) == 0);
} }
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: Note: Compression succeeded for space %lu name %s len %lu out_len %lu\n", "InnoDB: Note: Compression succeeded for space %lu name %s len %lu out_len %lu\n",
space_id, fil_space_name(space), len, write_size); space_id, fil_space_name(space), len, write_size);
#endif /* UNIV_DEBUG */ #endif /* UNIV_PAGECOMPRESS_DEBUG */
srv_stats.page_compression_saved.add((len - write_size)); srv_stats.page_compression_saved.add((len - write_size));
...@@ -205,7 +207,7 @@ fil_compress_page( ...@@ -205,7 +207,7 @@ fil_compress_page(
srv_stats.page_compression_trim_sect512.add(((len - write_size) / SECT_SIZE)); srv_stats.page_compression_trim_sect512.add(((len - write_size) / SECT_SIZE));
srv_stats.page_compression_trim_sect4096.add(((len - write_size) / (SECT_SIZE*8))); srv_stats.page_compression_trim_sect4096.add(((len - write_size) / (SECT_SIZE*8)));
} }
//srv_stats.page_compressed_trim_op.inc();
srv_stats.pages_page_compressed.inc(); srv_stats.pages_page_compressed.inc();
*out_len = write_size; *out_len = write_size;
...@@ -254,10 +256,10 @@ fil_decompress_page( ...@@ -254,10 +256,10 @@ fil_decompress_page(
// If no buffer was given, we need to allocate temporal buffer // If no buffer was given, we need to allocate temporal buffer
if (page_buf == NULL) { if (page_buf == NULL) {
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: FIL: Note: Compression buffer not given, allocating...\n"); "InnoDB: FIL: Note: Compression buffer not given, allocating...\n");
#endif /* UNIV_DEBUG */ #endif /* UNIV_PAGECOMPRESS_DEBUG */
in_buf = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE)); in_buf = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE));
} else { } else {
in_buf = page_buf; in_buf = page_buf;
...@@ -283,11 +285,11 @@ fil_decompress_page( ...@@ -283,11 +285,11 @@ fil_decompress_page(
if (compression_alg == FIL_PAGE_COMPRESSION_ZLIB) { if (compression_alg == FIL_PAGE_COMPRESSION_ZLIB) {
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: Note: Preparing for decompress for len %lu\n", "InnoDB: Note: Preparing for decompress for len %lu\n",
actual_size); actual_size);
#endif /* UNIV_DEBUG */ #endif /* UNIV_PAGECOMPRESS_DEBUG */
err= uncompress(in_buf, &len, buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (unsigned long)actual_size); err= uncompress(in_buf, &len, buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (unsigned long)actual_size);
...@@ -305,11 +307,11 @@ fil_decompress_page( ...@@ -305,11 +307,11 @@ fil_decompress_page(
ut_error; ut_error;
} }
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: Note: Decompression succeeded for len %lu \n", "InnoDB: Note: Decompression succeeded for len %lu \n",
len); len);
#endif /* UNIV_DEBUG */ #endif /* UNIV_PAGECOMPRESS_DEBUG */
#ifdef HAVE_LZ4 #ifdef HAVE_LZ4
} else if (compression_alg == FIL_PAGE_COMPRESSION_LZ4) { } else if (compression_alg == FIL_PAGE_COMPRESSION_LZ4) {
err = LZ4_decompress_fast((const char *)buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (char *)in_buf, UNIV_PAGE_SIZE); err = LZ4_decompress_fast((const char *)buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE, (char *)in_buf, UNIV_PAGE_SIZE);
......
...@@ -316,6 +316,7 @@ enum monitor_id_t { ...@@ -316,6 +316,7 @@ enum monitor_id_t {
MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP,
MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED,
MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED, MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED,
MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERROR,
/* Index related counters */ /* Index related counters */
MONITOR_MODULE_INDEX, MONITOR_MODULE_INDEX,
......
...@@ -121,6 +121,8 @@ struct srv_stats_t { ...@@ -121,6 +121,8 @@ struct srv_stats_t {
ulint_ctr_64_t page_compressed_trim_op_saved; ulint_ctr_64_t page_compressed_trim_op_saved;
/* Number of pages decompressed with page compression */ /* Number of pages decompressed with page compression */
ulint_ctr_64_t pages_page_decompressed; ulint_ctr_64_t pages_page_decompressed;
/* Number of page compression errors */
ulint_ctr_64_t pages_page_compression_error;
/** Number of data read in total (in bytes) */ /** Number of data read in total (in bytes) */
ulint_ctr_1_t data_read; ulint_ctr_1_t data_read;
...@@ -1117,6 +1119,8 @@ struct export_var_t{ ...@@ -1117,6 +1119,8 @@ struct export_var_t{
ib_int64_t innodb_pages_page_decompressed;/*!< Number of pages ib_int64_t innodb_pages_page_decompressed;/*!< Number of pages
decompressed by page decompressed by page
compression */ compression */
ib_int64_t innodb_pages_page_compression_error;/*!< Number of page
compression errors */
}; };
/** Thread slot in the thread table. */ /** Thread slot in the thread table. */
......
...@@ -6234,7 +6234,7 @@ os_file_trim( ...@@ -6234,7 +6234,7 @@ os_file_trim(
*slot->write_size > 0 && *slot->write_size > 0 &&
len >= *slot->write_size)) { len >= *slot->write_size)) {
#ifdef UNIV_DEBUG #ifdef UNIV_PAGECOMPRESS_DEBUG
fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu\n", fprintf(stderr, "Note: TRIM: write_size %lu trim_len %lu len %lu\n",
*slot->write_size, trim_len, len); *slot->write_size, trim_len, len);
#endif #endif
......
...@@ -926,6 +926,11 @@ static monitor_info_t innodb_counter_info[] = ...@@ -926,6 +926,11 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_NONE, MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED}, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED},
{"compress_pages_page_compression_error", "compression",
"Number of page compression errors",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERROR},
/* ========== Counters for Index ========== */ /* ========== Counters for Index ========== */
{"module_index", "index", "Index Manager", {"module_index", "index", "Index Manager",
MONITOR_MODULE, MONITOR_MODULE,
...@@ -1871,6 +1876,9 @@ srv_mon_process_existing_counter( ...@@ -1871,6 +1876,9 @@ srv_mon_process_existing_counter(
case MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED: case MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED:
value = srv_stats.pages_page_decompressed; value = srv_stats.pages_page_decompressed;
break; break;
case MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERROR:
value = srv_stats.pages_page_compression_error;
break;
default: default:
ut_error; ut_error;
......
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