Skip to content

Commit

Permalink
PXB-3390: Table Flags Mismatch Causing Assertion Failure in InnoDB Ta…
Browse files Browse the repository at this point in the history
…blespace

Problem:
========
For every IBD file, we open the file twice.
Datafile::open
Fil_shard::get_file_size

Between these two operations, a general tablespace may become
ENCRYPTION Y->N or N->Y

So the tablespace flags can mismatch. This should be tolerated because

Fix:
----
we track this encryption change and recopy them under lock anyway
  • Loading branch information
satya-bodapati committed Oct 18, 2024
1 parent 98b1d22 commit b499851
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions storage/innobase/fil/fil0fil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2824,10 +2824,12 @@ dberr_t Fil_shard::get_file_size(fil_node_t *file, bool read_only_mode) {
detect encryption from recovery and set the in-memory space->flags
to be encrypted. So on-disk (flags) may not have encryption set
but in-memory flags have encryption set (from redo parsing). This
happens only with undo because it writes space flags in two separate
steps */
happens undo because it writes space flags in two separate
steps. Also general tablespaces are affected because the encryption is
in-place. */
if ((space->flags != flags) && !(opt_lock_ddl == LOCK_DDL_REDUCED &&
fsp_is_undo_tablespace(space->id))) {
(fsp_is_undo_tablespace(space->id) ||
fsp_is_shared_tablespace(space->flags)))) {
ib::error(ER_IB_MSG_272, ulong{space->flags}, file->name, ulonglong{flags});
ut_error;
}
Expand Down

0 comments on commit b499851

Please sign in to comment.