Skip to content

Commit ea7d2e2

Browse files
gurusamidahlerlend
authored andcommitted
Bug #30417719 ASSERTION FAILURE: FSP0FSP.CC:2371:N_USED_NOT_FULL > 0 || N_TOTAL_NOT_FULL == 0
This is the second post push fix. The test innodb.virtual_basic was failing. The case where the LOB was already purged needed to be handled explicitly. rb#23522
1 parent abe87f8 commit ea7d2e2

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

storage/innobase/include/lob0lob.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ struct ref_mem_t {
178178

179179
/** Whether the blob is being modified. */
180180
bool m_being_modified;
181+
182+
/** Check if the LOB has already been purged.
183+
@return true if LOB has been purged, false otherwise. */
184+
bool is_purged() const {
185+
return ((m_page_no == FIL_NULL) && (m_length == 0));
186+
}
181187
};
182188

183189
extern const byte field_ref_almost_zero[FIELD_REF_SIZE];

storage/innobase/lob/lob0lob.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,11 @@ void ref_t::mark_not_partially_updatable(trx_t *trx, mtr_t *mtr,
12201220

12211221
parse(ref_mem);
12221222

1223+
/* If LOB has already been purged, ignore it. */
1224+
if (ref_mem.is_purged()) {
1225+
return;
1226+
}
1227+
12231228
block = buf_page_get(page_id_t(ref_mem.m_space_id, ref_mem.m_page_no),
12241229
page_size, RW_X_LATCH, mtr);
12251230

storage/innobase/lob/lob0purge.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,15 +425,18 @@ void purge(DeleteContext *ctx, dict_index_t *index, trx_id_t trxid,
425425
mtr_commit(&lob_mtr);
426426
}
427427

428+
if (!ctx->is_ref_valid()) {
429+
/* The LOB reference has changed. Don't proceed. */
430+
return;
431+
}
432+
428433
/* If rec_type is 0, it is not the purge operation. */
429434
if (!is_rollback && rec_type != 0 && !ctx->is_delete_marked()) {
430435
/* This is the purge operation. The delete marked clustered record has been
431436
reused. Purge shouldn't proceed. */
432437
return;
433438
}
434439

435-
ut_ad(ctx->is_ref_valid());
436-
437440
space_id_t space_id = ref.space_id();
438441
ut_ad(space_id == index->space_id());
439442
page_no_t first_page_no = ref.page_no();

0 commit comments

Comments
 (0)