Skip to content

Commit 742f148

Browse files
committed
Bug #31685095 INNODB] ASSERTION FAILURE: FSP0FSP.CC:4648:NOT_FULL_N_USED_1 == NOT_FULL_N_USED_
Post push fix to resolve a valgrind failure by removing debug code. This is a follow up fix for bug#31685095. There are two places where the changes to the first page of zlob was done using btr_mtr. These changes are now done by using local_mtr. rb#26924 approved by Kuba <[email protected]>
1 parent 67d3a55 commit 742f148

File tree

7 files changed

+39
-57
lines changed

7 files changed

+39
-57
lines changed

storage/innobase/btr/btr0btr.cc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -450,14 +450,6 @@ buf_block_t *btr_page_alloc_priv(dict_index_t *index, page_no_t hint_page_no,
450450
) {
451451
buf_block_t *new_block;
452452

453-
#ifdef UNIV_DEBUG
454-
{
455-
std::ostringstream out;
456-
out << "[Allocating Page: mtr=" << (void *)mtr << ", " << loc;
457-
mtr->m_trace.push_back(out.str());
458-
}
459-
#endif /* UNIV_DEBUG */
460-
461453
if (dict_index_is_ibuf(index)) {
462454
return (btr_page_alloc_for_ibuf(index, mtr));
463455
}
@@ -546,15 +538,6 @@ void btr_page_free_lower(dict_index_t *index, buf_block_t *block, ulint level,
546538
fseg_header_t *seg_header;
547539
page_t *root;
548540

549-
#ifdef UNIV_DEBUG
550-
{
551-
std::ostringstream out;
552-
out << "[Freeing Page: mtr=" << (void *)mtr
553-
<< ": page_id=" << block->get_page_id() << ", " << loc << "]";
554-
mtr->m_trace.push_back(out.str());
555-
}
556-
#endif /* UNIV_DEBUG */
557-
558541
ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table));
559542
/* The page gets invalid for optimistic searches: increment the frame
560543
modify clock */

storage/innobase/include/mtr0mtr.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -664,17 +664,6 @@ struct mtr_t {
664664
static Logging s_logging;
665665
#endif /* !UNIV_HOTBACKUP */
666666

667-
#ifdef UNIV_DEBUG
668-
public:
669-
std::list<std::string> m_trace;
670-
671-
std::ostream &print_trace(std::ostream &out) const {
672-
std::copy(m_trace.begin(), m_trace.end(),
673-
std::ostream_iterator<std::string>(out, "\n"));
674-
return out;
675-
}
676-
#endif /* UNIV_DEBUG */
677-
678667
private:
679668
Impl m_impl;
680669

storage/innobase/include/zlob0first.h

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,14 @@ struct z_first_page_t {
264264
return (fil_addr_t(page_no, offset));
265265
}
266266

267-
/** All the index pages are singled linked with each other, and
267+
/** All the index pages are singly linked with each other, and
268268
the first page contains the link to one index page.
269269
@param[in] page_no the page number of an index page. */
270270
void set_index_page_no(page_no_t page_no) {
271-
ut_ad(m_mtr != nullptr);
272-
mlog_write_ulint(frame() + OFFSET_INDEX_PAGE_NO, page_no, MLOG_4BYTES,
273-
m_mtr);
271+
set_index_page_no(page_no, m_mtr);
274272
}
275273

276-
/** All the index pages are singled linked with each other, and
274+
/** All the index pages are singly linked with each other, and
277275
the first page contains the link to one index page.
278276
@param[in] page_no the page number of an index page.
279277
@param[in] mtr use this mini transaction context for redo logs. */
@@ -282,7 +280,7 @@ struct z_first_page_t {
282280
mlog_write_ulint(frame() + OFFSET_INDEX_PAGE_NO, page_no, MLOG_4BYTES, mtr);
283281
}
284282

285-
/** All the index pages are singled linked with each other, and
283+
/** All the index pages are singly linked with each other, and
286284
the first page contains the link to one index page. Get that index
287285
page number.
288286
@return the index page number. */
@@ -312,30 +310,44 @@ struct z_first_page_t {
312310
bool verify_frag_page_no();
313311
#endif /* UNIV_DEBUG */
314312

315-
/** All the fragment pages are doubly linked with each other, and
316-
the first page contains the link to one fragment page in FIL_PAGE_PREV.
313+
/** All the fragment pages (@see z_frag_page_t) are doubly linked with each
314+
other, and the first page contains the link to one fragment page in
315+
FIL_PAGE_PREV.
317316
@param[in] mtr Mini-transaction for this modification.
318317
@param[in] page_no The page number of a fragment page. */
319318
void set_frag_page_no(mtr_t *mtr, page_no_t page_no) {
320319
ut_ad(verify_frag_page_no());
321320
set_prev_page_no(page_no, mtr);
322321
}
323322

324-
/** All the fragment pages are doubly linked with each other, and
325-
the first page contains the link to one fragment page in FIL_PAGE_PREV.
323+
/** All the fragment pages (@see z_frag_page_t) are doubly linked with each
324+
other, and the first page contains the link to one fragment page in
325+
FIL_PAGE_PREV.
326326
@param[in] page_no the page number of a fragment page. */
327327
void set_frag_page_no(page_no_t page_no) {
328328
ut_ad(verify_frag_page_no());
329329
set_prev_page_no(page_no, m_mtr);
330330
}
331331

332-
/** All the frag node pages are singled linked with each other, and
333-
the first page contains the link to one frag node page.
332+
/** All the frag node pages (@see z_frag_node_page_t) are singly linked with
333+
each other, and the first page contains the link to the last allocated frag
334+
node page. The last allocated FIL_PAGE_TYPE_ZLOB_FRAG_ENTRY page will be the
335+
first in this list. This list is used to free these pages.
334336
@param[in] page_no the page number of an frag node page. */
335337
void set_frag_node_page_no(page_no_t page_no) {
336-
ut_ad(m_mtr != nullptr);
338+
set_frag_node_page_no(page_no, m_mtr);
339+
}
340+
341+
/** All the frag node pages (@see z_frag_node_page_t) are singly linked with
342+
each other, and the first page contains the link to the last allocated frag
343+
node page. The last allocated FIL_PAGE_TYPE_ZLOB_FRAG_ENTRY page will be the
344+
first in this list. This list is used to free these pages.
345+
@param[in] page_no the page number of an frag node page.
346+
@param[in] mtr mini trx context to generate redo logs. */
347+
void set_frag_node_page_no(page_no_t page_no, mtr_t *mtr) {
348+
ut_ad(mtr != nullptr);
337349
mlog_write_ulint(frame() + OFFSET_FRAG_NODES_PAGE_NO, page_no, MLOG_4BYTES,
338-
m_mtr);
350+
mtr);
339351
}
340352

341353
/** Free all the z_frag_page_t pages. All the z_frag_page_t pages are
@@ -368,7 +380,7 @@ struct z_first_page_t {
368380
@return the number of pages freed. */
369381
size_t free_all_data_pages();
370382

371-
/** All the frag node pages are singled linked with each other, and the
383+
/** All the frag node pages are singly linked with each other, and the
372384
first page contains the link to one frag node page. Get that frag node
373385
page number.
374386
@return the index page number. */

storage/innobase/lob/lob0purge.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ static void z_purge(DeleteContext *ctx, dict_index_t *index, trx_id_t trxid,
337337
ref.set_length(0, nullptr);
338338
ctx->zblob_write_blobref(ctx->m_field_no, mtr);
339339
} else {
340+
/* Only purge operation should reach this else block. */
341+
ut_ad(purge_node != nullptr);
342+
340343
/* Note that page_zip will be NULL in
341344
row_purge_upd_exist_or_extern(). */
342345
ref.set_page_no(FIL_NULL, mtr);

storage/innobase/lob/zlob0first.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ size_t z_first_page_t::free_all_frag_node_pages() {
350350
z_frag_node_page_t frag_node_page(&local_mtr, m_index);
351351
frag_node_page.load_x(page_no);
352352
page_no_t next_page = frag_node_page.get_next_page_no();
353-
set_frag_node_page_no(next_page);
353+
354+
/* Make all changes to the first page using local_mtr. */
355+
set_frag_node_page_no(next_page, &local_mtr);
354356
frag_node_page.dealloc();
355357
n_pages_freed++;
356358

@@ -380,10 +382,8 @@ size_t z_first_page_t::free_all_index_pages() {
380382
index_page.load_x(page_no);
381383
page_no_t next_page = index_page.get_next_page_no();
382384

383-
/* The z_first_page_t::set_index_page_no() modifies the first page of
384-
zlob. Since the m_mtr also modifies first page of zlob, we cannot use
385-
local_mtr here. Use m_mtr here. */
386-
set_index_page_no(next_page);
385+
/* Make all changes to the first page using local_mtr. */
386+
set_index_page_no(next_page, &local_mtr);
387387

388388
index_page.dealloc();
389389
n_pages_freed++;

storage/innobase/mtr/mtr0mtr.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,7 @@ bool mtr_t::conflicts_with(const mtr_t *mtr2) const {
223223
bool conflict = !m_impl.m_memo.for_each_block_in_reverse(iterator);
224224
if (conflict) {
225225
print_memos(std::cout);
226-
print_trace(std::cout);
227226
mtr2->print_memos(std::cout);
228-
mtr2->print_trace(std::cout);
229227
}
230228
return conflict;
231229
}
@@ -695,9 +693,6 @@ void mtr_t::commit() {
695693
#endif /* !UNIV_HOTBACKUP */
696694

697695
ut_d(remove_from_debug_list());
698-
#ifdef UNIV_DEBUG
699-
m_trace.clear();
700-
#endif /* UNIV_DEBUG */
701696
}
702697

703698
#ifdef UNIV_DEBUG

unittest/gunit/innodb/lob/zlob0int.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,21 +563,21 @@ struct z_first_page_t {
563563
return (fil_addr_t(page_no, offset));
564564
}
565565

566-
/** All the index pages are singled linked with each other, and the first
566+
/** All the index pages are singly linked with each other, and the first
567567
page contains the link to one index page.
568568
@param[in] page_no the page number of an index page. */
569569
void set_index_page_no(page_no_t page_no) {
570570
mlog_write_ulint(frame() + OFFSET_INDEX_PAGE_NO, page_no, MLOG_4BYTES);
571571
}
572572

573-
/** All the index pages are singled linked with each other, and the first
573+
/** All the index pages are singly linked with each other, and the first
574574
page contains the link to one index page. Get that index page number.
575575
@return the index page number. */
576576
page_no_t get_index_page_no() const {
577577
return (mach_read_from_4(frame() + OFFSET_INDEX_PAGE_NO));
578578
}
579579

580-
/** All the frag node pages are singled linked with each other, and the
580+
/** All the frag node pages are singly linked with each other, and the
581581
first page contains the link to one frag node page.
582582
@param[in] page_no the page number of an frag node page. */
583583
void set_frag_node_page_no(page_no_t page_no) {
@@ -592,7 +592,7 @@ struct z_first_page_t {
592592
/** Free all the index pages. */
593593
void free_all_index_pages();
594594

595-
/** All the frag node pages are singled linked with each other, and the
595+
/** All the frag node pages are singly linked with each other, and the
596596
first page contains the link to one frag node page. Get that frag node
597597
page number.
598598
@return the index page number. */

0 commit comments

Comments
 (0)