PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.3Kb
Man Pages (Zip) - 402.5Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
Security in MySQL
Starting and Stopping MySQL
MySQL and Linux/Unix
MySQL and Windows
MySQL and macOS
MySQL and Solaris
Building MySQL from Source
MySQL Restrictions and Limitations
MySQL Partitioning
MySQL Tutorial
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL NDB Cluster 8.0
Thescheduler component is included in MySQL Enterprise Edition, a commercial product. To learn more about commercial products, seehttps://www.mysql.com/products/.
As of MySQL 8.0.34, thescheduler component provides an implementation of themysql_scheduler service that enables applications, components, or plugins to configure, run, and unconfigure tasks everyN seconds. For example, theaudit_log server plugin calls thescheduler component at its initialization and configures a regular, recurring flush of its memory cache (seeEnabling the Audit Log Flush Task).
Purpose: Implements the
component_scheduler.enabledsystem variable that controls whether the scheduler is actively executing tasks. At startup, theschedulercomponent registers theperformance_schema.component_scheduler_taskstable, which lists the currently scheduled tasks and some runtime data about each one.URN:
file://component_scheduler
For installation instructions, seeSection 7.5.1, “Installing and Uninstalling Components”.
Thescheduler component implements the service using these elements:
A priority queue of the registered, inactive scheduled tasks sorted by the next time to run (in ascending order).
A list of the registered, active tasks.
A background thread that:
Sleeps if there are no tasks or if the top task needs more time to run. It wakes periodically to check whether it is time to end.
Compiles a list of the tasks that need to run, moves them from the inactive queue, adds them to the active queue, and executes each task individually.
After executing the task list, removes the tasks from the active list, adds them to the inactive list, and calculates the next time they need to run.
When a caller invokes themysql_scheduler.create() service, it creates a new scheduled task instance to add to the queue, which signals the semaphore of the background thread. A handle to the new task is returned to the caller. The calling code should keep this handle and the service reference to the scheduling service until after calling themysql_scheduler.destroy() service. When the caller invokesdestroy() and passes in the handle it received fromcreate(), the service waits for the task to become inactive (if running) and then removes it from the inactive queue.
The component service calls each application-provided callback (function pointer) into the same scheduler thread, one at a time and in ascending order, based on the time each requires to run.
Developers who wish to incorporate scheduler-queueing capabilities into an application, component, or plugin should consult themysql_scheduler.h file in a MySQL source distribution.
PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.3Kb
Man Pages (Zip) - 402.5Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
Security in MySQL
Starting and Stopping MySQL
MySQL and Linux/Unix
MySQL and Windows
MySQL and macOS
MySQL and Solaris
Building MySQL from Source
MySQL Restrictions and Limitations
MySQL Partitioning
MySQL Tutorial
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL NDB Cluster 8.0