diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-06-30 19:43:34 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-07-14 20:14:48 +0300 |
commit | a9960ef0ec0994b6f5c6d43d13ecb2f4a8d52090 (patch) | |
tree | f05a80f540ac9307e972638559aff151b78dc4b6 /storage/xtradb/fsp | |
parent | 0a43236fbe7671faaca64a0f84a86f4fc69d1c26 (diff) | |
download | mariadb-git-a9960ef0ec0994b6f5c6d43d13ecb2f4a8d52090.tar.gz |
MDEV-8386: MARIADB creates very big tmp file > 351Gb. Started happening after Version 10.0.16-15
Fixed small size limit and added additional information if we reserve
new pages more then 50 times.
Diffstat (limited to 'storage/xtradb/fsp')
-rw-r--r-- | storage/xtradb/fsp/fsp0fsp.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/storage/xtradb/fsp/fsp0fsp.cc b/storage/xtradb/fsp/fsp0fsp.cc index 1f894d43031..cb51366df16 100644 --- a/storage/xtradb/fsp/fsp0fsp.cc +++ b/storage/xtradb/fsp/fsp0fsp.cc @@ -2724,6 +2724,8 @@ fsp_reserve_free_extents( ulint reserve; ibool success; ulint n_pages_added; + size_t total_reserved = 0; + ulint rounds = 0; ut_ad(mtr); *n_reserved = n_ext; @@ -2737,7 +2739,7 @@ fsp_reserve_free_extents( try_again: size = mtr_read_ulint(space_header + FSP_SIZE, MLOG_4BYTES, mtr); - if (size < FSP_EXTENT_SIZE) { + if (size < FSP_EXTENT_SIZE / 2) { /* Use different rules for small single-table tablespaces */ *n_reserved = 0; return(fsp_reserve_free_pages(space, space_header, size, mtr)); @@ -2752,7 +2754,6 @@ try_again: some of them will contain extent descriptor pages, and therefore will not be free extents */ - ut_ad(size >= free_limit); n_free_up = (size - free_limit) / FSP_EXTENT_SIZE; if (n_free_up > 0) { @@ -2793,6 +2794,7 @@ try_again: } success = fil_space_reserve_free_extents(space, n_free, n_ext); + *n_reserved = n_ext; if (success) { return(TRUE); @@ -2802,6 +2804,16 @@ try_to_extend: space_header, mtr); if (success && n_pages_added > 0) { + rounds++; + total_reserved += n_pages_added; + + if (rounds > 50) { + ib_logf(IB_LOG_LEVEL_INFO, + "Space id %lu trying to reserve %lu extents actually reserved %lu " + " reserve %lu free %lu size %lu rounds %lu total_reserved %lu", + space, n_ext, n_pages_added, reserve, n_free, size, rounds, total_reserved); + } + goto try_again; } |