Skip to content
/ server Public

Conversation

@svoj
Copy link
Contributor

@svoj svoj commented Jan 17, 2026

innodb_fts.crash_recovery,release fails sporadically. In release build it silently disables sync points, which allows server to crash at aribitrary point of DDL, specifically when .frm file is created but not yet written.

Subsequent attempt to open such table at recovery (needed to obtain number of high-level indexes) leads to OPEN_FRM_CORRUPTED error rather than something like "file not found" (which is ignored by recovery). Emitted errors were not handler by mtr.

Silently ignore newly created corrupt .frm during recovery. High-level indexes were most probably not created at this point.

It is still probable that .frm got corrupted after high-level indexes were created. In this case recovery won't be able to handle stale high-level indexes and they will be preserved.

This regression was introduced by d506631 "DDL recovery for high-level indexes".

@github-actions github-actions bot added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Jan 18, 2026
@vuvova
Copy link
Member

vuvova commented Jan 19, 2026

  1. would be good to have a test with high-level indexes that you describe
  2. how can frm be corrupted after high-level indexes are created?

@svoj
Copy link
Contributor Author

svoj commented Jan 19, 2026

@vuvova

  1. ok, I will add a test case (I was thinking about adding one myself), though it is not strictly necessary as high-level indexes will not be created anyway
  2. filesystem corruption, some very specific mariadbd malfunction, external tools that access .frm malfunction, whatnot

@vuvova
Copy link
Member

vuvova commented Jan 19, 2026

  1. ok, nothing guarantees data consistency in case of filesystem corruption or external tools mangling the data. It's ok in hlindexes will be orphan in this case.

innodb_fts.crash_recovery,release fails sporadically. In release
build it silently disables sync points, which allows server to
crash at aribitrary point of DDL, specifically when .frm file
is created but not yet written.

Subsequent attempt to open such table at recovery (needed to obtain
number of high-level indexes) leads to OPEN_FRM_CORRUPTED error
rather than something like "file not found" (which is ignored by
recovery). Emitted errors were not handler by mtr.

Silently ignore newly created corrupt .frm during recovery. High-level
indexes were most probably not created at this point.

It is still probable that .frm got corrupted after high-level indexes
were created. In this case recovery won't be able to handle stale
high-level indexes and they will be preserved.

This regression was introduced by "d50663198c0 DDL recovery for
high-level indexes".
@svoj svoj force-pushed the pr-11.8-MDEV-37795 branch from 38ef84d to 194bb9d Compare January 20, 2026 10:10
@gkodinov gkodinov added MariaDB Foundation Pull requests created by MariaDB Foundation and removed External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. labels Jan 21, 2026
@vuvova
Copy link
Member

vuvova commented Jan 23, 2026

In what cases would we want not to ignore corrupted frm on DROP?

@svoj
Copy link
Contributor Author

svoj commented Jan 23, 2026

In what cases would we want not to ignore corrupted frm on DROP?

Initially I thought about cases listed above: filesystem corruption, some very specific mariadbd malfunction, external tools that access .frm malfunction, whatnot. Two important points here:

  1. on DROP we can't get "created but not written .frm" like on CREATE
  2. current behaviour is inconsistent indeed: we report corrupt .frm error and interrupt log entry recovery, but still drop .frm; subsequent recovery attempt (on next restart) of this entry will succeed because there is no .frm

Are you leading towards conclusion that corrupt .frm has to be ignored in all cases?

@vuvova
Copy link
Member

vuvova commented Jan 24, 2026

What I mean is, perhaps DROP should always drop the table, even if frm is corrupted? In MDEV-11412 we've made DROP TABLE to remove the table even if frm is missing. Thinking along these lines, DROP TABLE should generally always drop, even if frm is corrupted, and ignore_corrupt_frm_error shouldn't be needed, because this behavior should be always enabled unconditionally.

@svoj
Copy link
Contributor Author

svoj commented Jan 24, 2026

@vuvova makes sense, I will get this PR updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

3 participants