-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
MDEV-37784 Introduce @@new_mode variable #4333
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
base: 11.8
Are you sure you want to change the base?
Conversation
net-read-timeout 30 | ||
net-retry-count 10 | ||
net-write-timeout 60 | ||
new-mode NOW_DEFAULT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's NOW_DEFAULT
? I think the intent was that by default the variable would be empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOW_DEFAULT is a placeholder for features that were opt-in in previous versions, but are now default.
So for example, we introduce [NEW_MODE_]FIX_DISK_TMPTABLE_COSTS as a flag disabled by default.
#define NEW_MODE_FIX_DISK_TMPTABLE_COSTS (1 << 1)
when we wish to make this default, all we need to do is..
#define NEW_MODE_FIX_DISK_TMPTABLE_COSTS (1 << 0)
We wont need to (though we should) change the actual code itself.
sql/sys_vars.cc
Outdated
|
||
static Sys_var_set Sys_new_behavior( | ||
"new_mode", | ||
"Used to introduce new behavior to new MariaDB versions", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can introduce new behavior to new versions just fine.
@@new_mode's purpose is to allow new behaviors to be added to OLD versions. Where we have to have them switchable and disabled by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change the wording.
NUMERIC_MIN_VALUE NULL | ||
NUMERIC_MAX_VALUE NULL | ||
NUMERIC_BLOCK_SIZE NULL | ||
ENUM_VALUE_LIST NOW_DEFAULT,FIX_DISK_TMPTABLE_COSTS,FIX_SEMIJOIN_DUPS_WEEDOUT_CHECK,TEST_WARNING1,TEST_WARNING2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it feasible to get rid of TEST_WARNINGs here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to see NOW_DEFAULT either, since it is pointless setting this. Looking...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can introduce a set of "hidden" values in Sys_var_typelib, default empty.
fb5c53c
to
0785e75
Compare
d54ab4f
to
df8f699
Compare
@@new_mode is a set of flags to control introduced features. Flags are by default off. Setting a flag in @@new_mode will introduce a new different server behaviour and/or set of features. We also introduce a new option 'hidden_values' into some system variable types to hide options that we do not wish to show as options.
df8f699
to
714b1ce
Compare
Ouch, I've made a mistake: pushed another fix into this PR branch, |
So,
|
I would expect the warnings not to be there... |
Has the name Possible replacements of the word ‘new’ would include ‘extended’ or ‘backported’. Perhaps some native English speakers can think of even better alternatives? |
@dr-m , well, |
- Don't print hidden values in mysqld --help output. - Better function names and formatting.
- Make get_options() use the same logic as check_new_mode_value() does. - More renames
714b1ce
to
ed803c1
Compare
.. pushed 3 commits with obvious fixes. |
If we are to be able to change the behaviour by changing our flags and leaving the rest of the codebase alone when a feature transitions from 'beta' to 'default' (which i think will be an important property), we need the evaluation of
to be non-zero, so some bit in thd->variables.new_mode needs to be non-zero. |
That's internal reason. Let's look at this from the user point of view.
Two points: What if for some reason we want the logic in the code to remain? if (optimizer_new_mode(thd, NEW_MODE_FIX_SEMIJOIN_DUPS_WEEDOUT_CHECK) && optimizer_new_mode at the moment is inline bool optimizer_new_mode(const THD *thd, ulonglong mode_flag)
{
return (thd->variables.new_behavior & mode_flag);
} We could introduce
and then eventually we would do
and then |
array_elements(innodb_linux_aio_names) - 1, | ||
"innodb_linux_aio_typelib", | ||
innodb_linux_aio_names, | ||
NULL | ||
NULL, NULL | ||
}; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this change about? Why is it needed? There is no mention of this in the commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TYPELIB
is changed, so every TYPELIB
static initializer has to be too. I'll change this place to use CREATE_TYPELIB_FOR()
macro (like few lines above)
@@new_mode is a set of flags to control introduced features. Flags are by default off. Setting a flag in @@new_mode will introduce a new different server behaviour and/or set of features.
Description
@@new_mode is a set of flags to control introduced features.
Flags are by default off. Setting a flag in @@new_mode will introduce
a new different server behaviour and/or set of features.
Release Notes
New global and session variable new_mode.
This needs updating.
https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables
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
main
branch.PR quality check