Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-35602: Wrong table column count mentioning corruption harmful #3685

Open
wants to merge 1 commit into
base: 10.6
Choose a base branch
from

Conversation

grooverdan
Copy link
Member

  • The Jira issue number for this PR is: MDEV-35602

Description

ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 mentioning the table is possibly corrupted leaves users with no avenue as to what action to take.

The simpler version of just saying the column count isn't matching leaves a manual reconciliation and mariadb-upgrade paths as something that can be attempted.

Release Notes

"Possible corruption" notices around system table with the wrong column count was unlikely to be corruption, just a non-standard upgrade path.

How can this PR be tested?

TODO: modify the automated test suite to verify that the PR causes MariaDB to behave as intended.
Consult the documentation on "Writing good test cases".

If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

@grooverdan grooverdan force-pushed the MDEV-35602-wrong-count-isnt-corruption branch from 34887e9 to 6d9b26b Compare December 9, 2024 03:23
@cvicentiu
Copy link
Member

Hi Daniel!

I don't agree with your proposed wording. If you intend the error message to steer users towards a solution, you should change the error messages to actually say that. What you have done now is leave users in an even more confused state.

From a user's POV:
The column count doesn't match... ok, how did I get here and what do I do now?

@cvicentiu cvicentiu self-requested a review December 9, 2024 09:47
Copy link
Member

@cvicentiu cvicentiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain the problem you are fixing in the MDEV properly.

  • What is the user story behind this?
  • Where does this problem come from?
  • What kind of use cases lead to this error?

Because if users run into this issue, there must be a "tutorial" somewhere that tells them to shoot themselves in the foot.

If you want users to have an easier time, make sure that the errors clearly explain what the problem is and what to look at in order to resolve things. With your suggested changes you do not explain to the user anything extra.

@cvicentiu cvicentiu added the MariaDB Foundation Pull requests created by MariaDB Foundation label Dec 9, 2024
The calls to Proc_table::report_error from various code paths populate
the error and code related to the error. For the mysql.proc table, all
this information is ignored and a common ER_CANNOT_LOAD_FROM_TABLE_V2
error is thrown. We correct this by using the error provided.

The documented purpose of the Proc_table_intact::report_error
function was to report the error only ony once.

With a code==0 passed to the function it fails to achieve
this objective. This behaviour was preserved anyway as otherwise some
to preserve some of the current messages.

SHOW PROCEDURE STATUS got an explict error of ER_SP_PROC_TABLE_CORRUPT
pushed outside the transaction in fill_schema_proc.

In the implementation of Proc_table::report_error,  Rather than doing
a write to buffer implementation of this using my_printv_error as a
common implementation that takes a varglist and the same implementation
as the current my_message call.

The sp-destruct test case, as expected, started to produce
different results. The more general exposure of ER_SP_PROC_TABLE_CORRUPT
highlighted "Internal code" as a reason, expanded this to
text to make to more readable (but not great).
@grooverdan grooverdan force-pushed the MDEV-35602-wrong-count-isnt-corruption branch from 6d9b26b to 33aba50 Compare December 11, 2024 10:37
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.

2 participants