summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@skysql.com>2014-11-24 10:01:49 +0200
committerJan Lindström <jan.lindstrom@skysql.com>2014-11-24 10:01:49 +0200
commit7f0b11afd13c1d54fcae05228b127892f670f675 (patch)
tree5cc27e4fa5e62019bfa0e475b099857ceee34be4
parentdeffb95bc2849b016e309a1d5803d13d3ceff05a (diff)
downloadmariadb-git-bb-page-compress.tar.gz
MDEV-7166: innodb.innodb-page_compression_zip fails in buildbotbb-page-compress
-rw-r--r--storage/innobase/fil/fil0pagecompress.cc17
-rw-r--r--storage/innobase/os/os0file.cc3
-rw-r--r--storage/xtradb/fil/fil0pagecompress.cc17
-rw-r--r--storage/xtradb/os/os0file.cc3
4 files changed, 40 insertions, 0 deletions
diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc
index 52f3792f649..2b0196c9017 100644
--- a/storage/innobase/fil/fil0pagecompress.cc
+++ b/storage/innobase/fil/fil0pagecompress.cc
@@ -476,6 +476,23 @@ fil_compress_page(
srv_stats.page_compression_saved.add((len - write_size));
srv_stats.pages_page_compressed.inc();
+
+#if defined (__linux__) && (!defined(FALLOC_FL_PUNCH_HOLE) || !defined (FALLOC_FL_KEEP_SIZE))
+ if (srv_use_trim) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: [Warning] System does not support FALLOC_FL_PUNCH_HOLE || FALLOC_FL_KEEP_SIZE.\n"
+ " InnoDB: Disabling trim for now.\n");
+ srv_use_trim = FALSE;
+ }
+#endif
+
+ if (!srv_use_trim) {
+ /* If persistent trims are not used we always write full
+ page */
+ write_size = len;
+ }
+
*out_len = write_size;
return(out_buf);
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index d97f6a39931..a34edcf94e5 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -6395,6 +6395,7 @@ os_file_trim(
if (ret) {
/* After first failure do not try to trim again */
os_fallocate_failed = TRUE;
+ srv_use_trim = FALSE;
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: [Warning] fallocate call failed with error code %d.\n"
@@ -6421,6 +6422,7 @@ os_file_trim(
" InnoDB: [Warning] fallocate not supported on this installation."
" InnoDB: Disabling fallocate for now.");
os_fallocate_failed = TRUE;
+ srv_file_trim = FALSE;
if (slot->write_size) {
*slot->write_size = 0;
}
@@ -6440,6 +6442,7 @@ os_file_trim(
if (!ret) {
/* After first failure do not try to trim again */
os_fallocate_failed = TRUE;
+ srv_file_trim=FALSE;
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: [Warning] fallocate call failed with error.\n"
diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc
index 3852bc49408..20b6b0b1b15 100644
--- a/storage/xtradb/fil/fil0pagecompress.cc
+++ b/storage/xtradb/fil/fil0pagecompress.cc
@@ -473,6 +473,23 @@ fil_compress_page(
srv_stats.page_compression_saved.add((len - write_size));
srv_stats.pages_page_compressed.inc();
+
+#if defined (__linux__) && (!defined(FALLOC_FL_PUNCH_HOLE) || !defined (FALLOC_FL_KEEP_SIZE))
+ if (srv_use_trim) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: [Warning] System does not support FALLOC_FL_PUNCH_HOLE || FALLOC_FL_KEEP_SIZE.\n"
+ " InnoDB: Disabling trim for now.\n");
+ srv_use_trim = FALSE;
+ }
+#endif
+
+ if (!srv_use_trim) {
+ /* If persistent trims are not used we always write full
+ page */
+ write_size = len;
+ }
+
*out_len = write_size;
return(out_buf);
diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc
index aa39e7bab7a..bb67f2d453c 100644
--- a/storage/xtradb/os/os0file.cc
+++ b/storage/xtradb/os/os0file.cc
@@ -6498,6 +6498,7 @@ os_file_trim(
if (ret) {
/* After first failure do not try to trim again */
os_fallocate_failed = TRUE;
+ srv_use_trim = FALSE;
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: [Warning] fallocate call failed with error code %d.\n"
@@ -6524,6 +6525,7 @@ os_file_trim(
" InnoDB: [Warning] fallocate not supported on this installation."
" InnoDB: Disabling fallocate for now.");
os_fallocate_failed = TRUE;
+ srv_use_trim = FALSE;
if (slot->write_size) {
*slot->write_size = 0;
}
@@ -6543,6 +6545,7 @@ os_file_trim(
if (!ret) {
/* After first failure do not try to trim again */
os_fallocate_failed = TRUE;
+ srv_use_trim = FALSE;
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: [Warning] fallocate call failed with error.\n"