WL#4876: Parse options before initializing mysysAffects: Server-9.x — Status: Patch-queued — Priority: MediumIn mysqld, mysys is initialized (my_init()) before options are parsed
(handle_options()).
Thus, options which should influence objects part of mysys, don't.
Example: --safe-mutex-deadlock-detector=0 disables mutex deadlock detection in
6.0; but this option is parsed after the pthread_mutex_init() calls of
my_init(). So, mutexes initialized by my_init() always do mutex deadlock
detection, the option doesn't influence them.
Performance Schema is also impacted
The performance schema needs to initialize the server in this order:
1) Parse options affecting the performance schema
Performance schema specific options.
====================================
--performance-schema-enabled={true|false}
--performance-schema-max-mutex-instruments=<number>
--performance-schema-max-rwlock-instruments=<number>
--performance-schema-max-cond-instruments=<number>
--performance-schema-max-thread-instruments=<number>
--performance-schema-max-table-instruments=<number>
--performance-schema-max-file-instruments=<number>
--performance-schema-max-mutex=<number>
--performance-schema-max-rwlock=<number>
--performance-schema-max-cond=<number>
--performance-schema-max-thread=<number>
--performance-schema-max-table=<number>
--performance-schema-max-file=<number>
--performance-schema-events-waits-history-size=<number>
--performance-schema-events-waits-history-long-size=<number>
2) Allocate internal buffers based on options parsed in 1),
and internally deploy the instrumentation in the server
3) Execute MYSQL_MUTEX_INIT, MYSQL_RWLOCK_INIT, MYSQL_COND_INIT,
MYSQL_OPEN, MYSQL_FOPEN and pthread_create in the server code only *after* 2),
to collect instrumentation data.
Because handle_options() happens too late currently, the performance schema
code is duplicating parsing of options from the command line (argc, argv) in main().
This code is a work around that only partially works:
- the server honor ./mysqld --performance-schema-xxx
- the server ignores --performance-schema-xxx in my.cnf, which is not user
friendly and leads to confusion.
Also, code is duplicated because of this.
The desired result is that handle_options() parses all arguments before
initializing any mutex, rwlock, condition, or starting any thread.
It seems impossible to exactly achieve parsing all options before initializing No Comments yet |
VotesWatches0 members are watching this worklog
You must be logged in to track this worklog.
Provide Feedback
You must be logged in to comment
|