Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30645

CREATE TRIGGER FOR { STARTUP | SHUTDOWN }

Details

    Description

      Event Schduler Trigger when right after STARTUP / right before Shutdown.
      not only time repeatation. but one time call for STARTUP and Shutdown

      Should prepared alternative method to turn of/off switch by configuration for emergency.

      To know DB's startup and shutdown
      prepare system batch data(like mart).

      Questions:

      • what schema are these triggers in? Any schema? mysql? something new?
      • what privileges are needed to create/drop them?

      Attachments

        Issue Links

          Activity

            npdmailing@gmail.com Mitchell Lee created issue -
            npdmailing@gmail.com Mitchell Lee made changes -
            Field Original Value New Value
            npdmailing@gmail.com Mitchell Lee made changes -
            npdmailing@gmail.com Mitchell Lee made changes -
            npdmailing@gmail.com Mitchell Lee made changes -
            Description - Event Schduler Trigger when right after STARTUP / right before Shutdown.
             > not only time repeatation. but one time call for STARTUP and Shutdown
             > Should prepared alternative method to turn of/off switch by configuration for emergency.

            - Event Schduler Trigger when right after STARTUP / right before Shutdown.
             > not only time repeatation. but one time call for STARTUP and Shutdown
             > Should prepared alternative method to turn of/off switch by configuration for emergency.

            To know DB's startup and shutdown
            prepare system batch data(like mart).
            ralf.gebhardt Ralf Gebhardt made changes -
            Component/s Events [ 10102 ]
            serg Sergei Golubchik made changes -
            Summary Feature request - Event Schduler Trigger when right after STARTUP / right before Shutdown. Feature request - Event Scheduler Trigger when right after STARTUP / right before Shutdown.
            serg Sergei Golubchik made changes -
            Summary Feature request - Event Scheduler Trigger when right after STARTUP / right before Shutdown. CREATE TRIGGER FOR { STARTUP | SHUTDOWN }
            serg Sergei Golubchik added a comment - - edited

            or may be

            CREATE TRIGGER ... AFTER STARTUP ...
            CREATE TRIGGER ... BEFORE SHUTDOWN ...
            

            at the same time we could also add

            CREATE TRIGGER ... ON SCHEDULE ...
            

            just for consistency.

            serg Sergei Golubchik added a comment - - edited or may be CREATE TRIGGER ... AFTER STARTUP ... CREATE TRIGGER ... BEFORE SHUTDOWN ... at the same time we could also add CREATE TRIGGER ... ON SCHEDULE ... just for consistency.
            npdmailing@gmail.com Mitchell Lee added a comment - - edited

            serg, exactly what I want.

            npdmailing@gmail.com Mitchell Lee added a comment - - edited serg , exactly what I want.
            nikitamalyavin Nikita Malyavin made changes -
            Labels beginner-friendly
            ralf.gebhardt Ralf Gebhardt made changes -
            Component/s Triggers [ 10109 ]

            Could you provide an example of what you'd like to do at startup or at shutdown?

            serg Sergei Golubchik added a comment - Could you provide an example of what you'd like to do at startup or at shutdown?
            npdmailing@gmail.com Mitchell Lee added a comment - - edited

            serg
            Let me correct the term to go further.
            My term the 'Trigger' means literally 'triggering' action not the TRIGGER on behalf of table.
            For 'Startup' or 'Shutdown' is that to execute any of procedure, function, or even normal queries that
            the normal EVENT can do.
            So the implementation should not be part of the TRIGGER. but part of EVENT.
            Is that reasonable for all of us? That is why I used the word 'event scheduler' in the very first context.

            npdmailing@gmail.com Mitchell Lee added a comment - - edited serg Let me correct the term to go further. My term the 'Trigger' means literally 'triggering' action not the TRIGGER on behalf of table. For 'Startup' or 'Shutdown' is that to execute any of procedure, function, or even normal queries that the normal EVENT can do. So the implementation should not be part of the TRIGGER. but part of EVENT. Is that reasonable for all of us? That is why I used the word 'event scheduler' in the very first context.
            serg Sergei Golubchik made changes -
            Description - Event Schduler Trigger when right after STARTUP / right before Shutdown.
             > not only time repeatation. but one time call for STARTUP and Shutdown
             > Should prepared alternative method to turn of/off switch by configuration for emergency.

            To know DB's startup and shutdown
            prepare system batch data(like mart).
            Event Schduler Trigger when right after STARTUP / right before Shutdown.
            not only time repeatation. but one time call for STARTUP and Shutdown

            Should prepared alternative method to turn of/off switch by configuration for emergency.

            To know DB's startup and shutdown
            prepare system batch data(like mart).
            serg Sergei Golubchik added a comment - - edited

            yes, that's what I mean too. A generalized "trigger" which is triggered by specific event, be it INSERT/UPDATE/DELETE in a table, a specific point in time, a startup or shutdown of the server, or whatever. I'm sure there will be more requests in the future, e.g. a login or logout of the user, start or stop of replication, etc.

            It'd help to understand the feature better if you could provide examples of actions you want to do on startup or on shutdown. You surely already have something in mind.

            serg Sergei Golubchik added a comment - - edited yes, that's what I mean too. A generalized "trigger" which is triggered by specific event, be it INSERT/UPDATE/DELETE in a table, a specific point in time, a startup or shutdown of the server, or whatever. I'm sure there will be more requests in the future, e.g. a login or logout of the user, start or stop of replication, etc. It'd help to understand the feature better if you could provide examples of actions you want to do on startup or on shutdown. You surely already have something in mind.
            npdmailing@gmail.com Mitchell Lee added a comment - - edited

            Use cases should be

            • For startup : clean temp table(not by create temporary table but normal one for temporary data purpose), create preset daily data insertion for query boost up
            • For shutdown : rebuild table (by query 'OPTIMIZE NO_WRITE_TO_BINLOG TABLE tt_a') and batch job before end up.

            A need to consider some points are:

            • What if got an error or warning when do something while shutdown event, how to handle it? stop shutting down or?
            • On windows environment, usually the db gets shutdown signal when OS shutting down. What if the shutdown 'OPTIMIZE' script take....an hour or more, can the MariaDB hold the shutting down until it finishes?
            npdmailing@gmail.com Mitchell Lee added a comment - - edited Use cases should be For startup : clean temp table(not by create temporary table but normal one for temporary data purpose), create preset daily data insertion for query boost up For shutdown : rebuild table (by query 'OPTIMIZE NO_WRITE_TO_BINLOG TABLE tt_a') and batch job before end up. A need to consider some points are: What if got an error or warning when do something while shutdown event, how to handle it? stop shutting down or? On windows environment, usually the db gets shutdown signal when OS shutting down. What if the shutdown 'OPTIMIZE' script take....an hour or more, can the MariaDB hold the shutting down until it finishes?

            MariaDB can already have a very slow shutdown (e.g. flushing a big InnoDB buffer pool, if it's enabled) and it can have errors during shutdown. These new cases won't be any conceptually different.

            Depends on how OS is configured, it can forcefully kill the slow process or it can wait

            serg Sergei Golubchik added a comment - MariaDB can already have a very slow shutdown (e.g. flushing a big InnoDB buffer pool, if it's enabled) and it can have errors during shutdown. These new cases won't be any conceptually different. Depends on how OS is configured, it can forcefully kill the slow process or it can wait
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Description Event Schduler Trigger when right after STARTUP / right before Shutdown.
            not only time repeatation. but one time call for STARTUP and Shutdown

            Should prepared alternative method to turn of/off switch by configuration for emergency.

            To know DB's startup and shutdown
            prepare system batch data(like mart).
            Event Schduler Trigger when right after STARTUP / right before Shutdown.
            not only time repeatation. but one time call for STARTUP and Shutdown

            Should prepared alternative method to turn of/off switch by configuration for emergency.

            To know DB's startup and shutdown
            prepare system batch data(like mart).

            Questions:
            * what schema are these triggers in? Any schema? {{mysql}}? something new?
            * what privileges are needed to create/drop them?
            npdmailing@gmail.com Mitchell Lee added a comment -

            @Sergei Golubchik,


            Let me correct the term to go further.
            My term the 'Trigger' means literally 'triggering' action not the TRIGGER on behalf of table.
            For 'Startup' or 'Shutdown' is that to execute any of procedure, function, or even normal queries that
            the normal EVENT can do.
            So the implementation should not be part of the TRIGGER. but part of EVENT.
            Is that reasonable for all of us? That is why I used the word 'event scheduler' in the very first context.
            ------
            Don't keep get confuse with the word 'trigger' what we are talking about is the EVENT which already exsist. but triggerring time setting enhancement for startup/shutdown.

            npdmailing@gmail.com Mitchell Lee added a comment - @Sergei Golubchik, Let me correct the term to go further. My term the 'Trigger' means literally 'triggering' action not the TRIGGER on behalf of table. For 'Startup' or 'Shutdown' is that to execute any of procedure, function, or even normal queries that the normal EVENT can do. So the implementation should not be part of the TRIGGER. but part of EVENT. Is that reasonable for all of us? That is why I used the word 'event scheduler' in the very first context. ------ Don't keep get confuse with the word 'trigger' what we are talking about is the EVENT which already exsist. but triggerring time setting enhancement for startup/shutdown.

            I think the word "trigger" is just a general way of describing the commands.

            The end result will be that you will be able to execute any procedure, function, query, etc. after the server startup and before the server shutdown automatically.

            Does that meet your needs?

            andre André Alves added a comment - I think the word "trigger" is just a general way of describing the commands. The end result will be that you will be able to execute any procedure, function, query, etc. after the server startup and before the server shutdown automatically. Does that meet your needs?
            npdmailing@gmail.com Mitchell Lee added a comment -

            Correct.

            npdmailing@gmail.com Mitchell Lee added a comment - Correct.
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Labels beginner-friendly beginner-friendly gsoc24
            ralf.gebhardt Ralf Gebhardt made changes -
            Issue Type Task [ 3 ] New Feature [ 2 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 11.7 [ 29815 ]
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 11.8 [ 29921 ]
            Fix Version/s 11.7 [ 29815 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 11.9 [ 29945 ]
            Fix Version/s 11.8 [ 29921 ]
            svoj Sergey Vojtovich made changes -
            Labels beginner-friendly gsoc24 beginner-friendly contribution gsoc24
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 12.1 [ 29992 ]
            Fix Version/s 12.0 [ 29945 ]

            People

              serg Sergei Golubchik
              npdmailing@gmail.com Mitchell Lee
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.