mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-7166: innodb.innodb-page_compression_zip fails in buildbot
Analysis: If innodb_use_trim is not enabled or system does not support fallocate to make persistent trim, we should always write full page not only partial pages.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -5265,9 +5265,17 @@ os_aio_windows_handle(
|
||||
if (ret && len == slot->len) {
|
||||
|
||||
ret_val = TRUE;
|
||||
} else if (os_file_handle_error(slot->name, "Windows aio", __FILE__, __LINE__)) {
|
||||
} else if (!ret || (len != slot->len)) {
|
||||
|
||||
retry = TRUE;
|
||||
if (!ret) {
|
||||
if (os_file_handle_error(slot->name, "Windows aio", __FILE__, __LINE__)) {
|
||||
retry = TRUE;
|
||||
} else {
|
||||
ret_val = FALSE;
|
||||
}
|
||||
} else {
|
||||
retry = TRUE;
|
||||
}
|
||||
} else {
|
||||
|
||||
ret_val = FALSE;
|
||||
@@ -6395,6 +6403,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 +6430,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;
|
||||
}
|
||||
@@ -6440,6 +6450,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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user