diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2020-10-15 13:26:18 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2020-10-19 22:18:29 +0530 |
commit | 36f5ea8b1092099e7ad96251bdefd43142bbe6c3 (patch) | |
tree | 5db0c1e9577d27abb786a09097bcbef1458112d4 | |
parent | 311b7f94e6115b50e947767af3172a73508958eb (diff) | |
download | mariadb-git-bb-10.3-MDEV-23072.tar.gz |
MDEV-23072 Diskspace not reused for Blob in data filebb-10.3-MDEV-23072
- This issue is caused by commit a4948dafcd7eee65f16d848bdc6562fc49ef8916.
Purge doesn't free the externally stored page associated with the
last record of the root page. In that case, purge thread does empty
the root page and leads to more orphaned blob page in the tablespace.
Purge thread should free the blob even for the last record of the
root page.
Reviewed-by: Marko Mäkelä
-rw-r--r-- | storage/innobase/btr/btr0cur.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index a68bc6550d7..a682148a482 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -5469,7 +5469,6 @@ btr_cur_optimistic_delete_func( mem_heap_t* heap = NULL; rec_offs offsets_[REC_OFFS_NORMAL_SIZE]; rec_offs* offsets = offsets_; - ibool no_compress_needed; rec_offs_init(offsets_); ut_ad(flags == 0 || flags == BTR_CREATE_FLAG); @@ -5490,6 +5489,20 @@ btr_cur_optimistic_delete_func( rec = btr_cur_get_rec(cursor); + offsets = rec_get_offsets(rec, cursor->index, offsets, true, + ULINT_UNDEFINED, &heap); + + const ibool no_compress_needed = !rec_offs_any_extern(offsets) + && btr_cur_can_delete_without_compress( + cursor, rec_offs_size(offsets), mtr); + + if (!no_compress_needed) { + /* prefetch siblings of the leaf for the pessimistic + operation. */ + btr_cur_prefetch_siblings(block); + goto func_exit; + } + if (UNIV_UNLIKELY(block->page.id.page_no() == cursor->index->page && page_get_n_recs(block->frame) == 1 + (cursor->index->is_instant() @@ -5528,18 +5541,10 @@ btr_cur_optimistic_delete_func( index->remove_instant(); } - return true; + goto func_exit; } - offsets = rec_get_offsets(rec, cursor->index, offsets, true, - ULINT_UNDEFINED, &heap); - - no_compress_needed = !rec_offs_any_extern(offsets) - && btr_cur_can_delete_without_compress( - cursor, rec_offs_size(offsets), mtr); - - if (no_compress_needed) { - + { page_t* page = buf_block_get_frame(block); page_zip_des_t* page_zip= buf_block_get_page_zip(block); @@ -5599,10 +5604,6 @@ btr_cur_optimistic_delete_func( ibuf_update_free_bits_low(block, max_ins, mtr); } } - } else { - /* prefetch siblings of the leaf for the pessimistic - operation. */ - btr_cur_prefetch_siblings(block); } func_exit: |