mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 09:14:17 +01:00
MDEV-20094 InnoDB blob allocation allocates extra extents
- InnoDB reserves the free extents unnecessarily during blob page allocation even though btr_page_alloc() can handle reserving the extent when the existing ran out of pages to be used.
This commit is contained in:
parent
8cc36fb743
commit
9b5d711ac3
6 changed files with 21 additions and 25 deletions
|
@ -1,5 +1,5 @@
|
||||||
--- mysql-test/suite/innodb/r/check_ibd_filesize.result 2022-08-16 17:28:06.462350465 +0530
|
--- mysql-test/suite/innodb/r/check_ibd_filesize.result
|
||||||
+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject 2022-08-16 17:29:25.129637040 +0530
|
+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject
|
||||||
@@ -3,18 +3,12 @@
|
@@ -3,18 +3,12 @@
|
||||||
# SPACE IN 5.7 THAN IN 5.6
|
# SPACE IN 5.7 THAN IN 5.6
|
||||||
#
|
#
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
-# bytes: 65536
|
-# bytes: 65536
|
||||||
+# bytes: 131072
|
+# bytes: 131072
|
||||||
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
||||||
-# bytes: 4194304
|
-# bytes: 2097152
|
||||||
-DROP TABLE t1;
|
-DROP TABLE t1;
|
||||||
-CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
-CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
||||||
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--- mysql-test/suite/innodb/r/check_ibd_filesize.result 2022-08-16 17:28:06.462350465 +0530
|
--- mysql-test/suite/innodb/r/check_ibd_filesize.result
|
||||||
+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject 2022-08-16 17:31:39.288769153 +0530
|
+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject
|
||||||
@@ -3,18 +3,18 @@
|
@@ -3,18 +3,18 @@
|
||||||
# SPACE IN 5.7 THAN IN 5.6
|
# SPACE IN 5.7 THAN IN 5.6
|
||||||
#
|
#
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
-# bytes: 65536
|
-# bytes: 65536
|
||||||
+# bytes: 16384
|
+# bytes: 16384
|
||||||
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
||||||
# bytes: 4194304
|
# bytes: 2097152
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
||||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--- mysql-test/suite/innodb/r/check_ibd_filesize.result 2022-08-16 17:28:06.462350465 +0530
|
--- mysql-test/suite/innodb/r/check_ibd_filesize.result
|
||||||
+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject 2022-08-16 17:30:28.957174270 +0530
|
+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject
|
||||||
@@ -3,18 +3,12 @@
|
@@ -3,18 +3,12 @@
|
||||||
# SPACE IN 5.7 THAN IN 5.6
|
# SPACE IN 5.7 THAN IN 5.6
|
||||||
#
|
#
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
-# bytes: 65536
|
-# bytes: 65536
|
||||||
+# bytes: 262144
|
+# bytes: 262144
|
||||||
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
||||||
-# bytes: 4194304
|
-# bytes: 2097152
|
||||||
-DROP TABLE t1;
|
-DROP TABLE t1;
|
||||||
-CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
-CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
||||||
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--- mysql-test/suite/innodb/r/check_ibd_filesize.result 2022-08-16 17:28:06.462350465 +0530
|
--- mysql-test/suite/innodb/r/check_ibd_filesize.result
|
||||||
+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject 2022-08-16 17:31:03.516962339 +0530
|
+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject
|
||||||
@@ -3,18 +3,18 @@
|
@@ -3,18 +3,18 @@
|
||||||
# SPACE IN 5.7 THAN IN 5.6
|
# SPACE IN 5.7 THAN IN 5.6
|
||||||
#
|
#
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
-# bytes: 65536
|
-# bytes: 65536
|
||||||
+# bytes: 32768
|
+# bytes: 32768
|
||||||
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
||||||
# bytes: 4194304
|
# bytes: 2097152
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
||||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||||
|
|
|
@ -10,7 +10,7 @@ DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB;
|
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB;
|
||||||
# bytes: 65536
|
# bytes: 65536
|
||||||
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
|
||||||
# bytes: 4194304
|
# bytes: 2097152
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
|
||||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||||
|
|
|
@ -7684,7 +7684,6 @@ btr_store_big_rec_extern_fields(
|
||||||
buf_block_t* block;
|
buf_block_t* block;
|
||||||
page_t* page;
|
page_t* page;
|
||||||
const ulint commit_freq = 4;
|
const ulint commit_freq = 4;
|
||||||
ulint r_extents;
|
|
||||||
|
|
||||||
ut_ad(page_align(field_ref) == page_align(rec));
|
ut_ad(page_align(field_ref) == page_align(rec));
|
||||||
|
|
||||||
|
@ -7723,20 +7722,17 @@ btr_store_big_rec_extern_fields(
|
||||||
alloc_mtr = &mtr;
|
alloc_mtr = &mtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fsp_reserve_free_extents(&r_extents,
|
|
||||||
index->table->space, 1,
|
|
||||||
FSP_BLOB, alloc_mtr,
|
|
||||||
1)) {
|
|
||||||
|
|
||||||
alloc_mtr->commit();
|
|
||||||
error = DB_OUT_OF_FILE_SPACE;
|
|
||||||
goto func_exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
block = btr_page_alloc(index, hint_page_no, FSP_NO_DIR,
|
block = btr_page_alloc(index, hint_page_no, FSP_NO_DIR,
|
||||||
0, alloc_mtr, &mtr);
|
0, alloc_mtr, &mtr);
|
||||||
|
|
||||||
index->table->space->release_free_extents(r_extents);
|
if (!block) {
|
||||||
|
error = DB_OUT_OF_FILE_SPACE;
|
||||||
|
alloc_mtr->commit();
|
||||||
|
if (op == BTR_STORE_INSERT_BULK) {
|
||||||
|
mtr.commit();
|
||||||
|
}
|
||||||
|
goto func_exit;
|
||||||
|
}
|
||||||
|
|
||||||
if (UNIV_UNLIKELY(op == BTR_STORE_INSERT_BULK)) {
|
if (UNIV_UNLIKELY(op == BTR_STORE_INSERT_BULK)) {
|
||||||
mtr_bulk.commit();
|
mtr_bulk.commit();
|
||||||
|
|
Loading…
Add table
Reference in a new issue