Wedge
Public area => The Pub => Plugins => Topic started by: Arantor on January 20th, 2013, 08:38 PM
-
For most plugins, it's no big deal to do their installation, even down to creating new tables and so on.
But plugins that modify tables, especially if they're going to modify big tables that are heavily used (topics, messages, members), it seems to me that it might be worth enforcing the site is in maintenance mode before installing such (because the tables will be locked during that time)
I'm sort of torn on whether this is needed or not (though I think it is certainly useful), and though part of me is tempted to enforce it, I think what I'd rather do is leave it to the plugin author whether they want to use it.
What I'd do in that case is provide an attribute somewhere which indicates what action/actions require maintenance mode or not, for example, <plugin id="Arantor:plugin" maintenance="enable,remove-clean"> to mirror the possible scripts that something could run; typically only enable and remove-clean are the times this is an issue anyway since it is enable and remove-clean that invariably are schema changing.
Thoughts?
-
I'd not leave this decision to the plugin author.. maybe it's needed and he doesn't recognize it (and maybe compromise the db).
What about the contrary? The plugin author must explicity tell to not go in maintenance mode while installing.
-
It's not so much a case of 'compromise'. It's more a case that if a plugin is going to modify the messages or topics tables, it's going to stall everything else while that occurs - which is of course a big performance issue potentially.
The thing is, if the plugin author declares it, it can be figured out and handled (efficiently) before the user even presses the button. It can't be done efficiently if it has to evaluate the plugin fully before making the decision.
-
It's not so much a case of 'compromise'. It's more a case that if a plugin is going to modify the messages or topics tables, it's going to stall everything else while that occurs - which is of course a big performance issue potentially.
Couldn't a concurrent access to the same table break something?
-
Nope, that's the point. While the table is being rewritten, it's locked from all other accesses. The point is that if you're modifying a huge table, you're going to be blocking access to all other concurrent accesses. The point of having it in maintenance mode is that it drastically cuts down on those concurrent accesses.
It's more about being a courtesy to users and cutting down the limit of how long it's going to take.
-
Ok, makes sense. :)
-
I guess it makes sense for large forums, option can't hurt.
PS: Is there an emergency disable all plugins option? Couldn't find one in Settings.php
-
There are options to that, you can either rename everything in the plugins directory, or empty out 'plugins_enabled' in the settings table.
-
That sounds like a nifty idea. Concerning plugin developers the documentations for making plugins should heavily encourage developers to make use of these options when necessary, with examples of necessity.
While we're on the subject.. Would it be a good idea to retain certain actions such as a forum posts during maintenance mode?
1. Admin installs a plugin involving the need for maintenance mode.
2. User "posts something very long".
3. User gets "maintenance mode" message at top, with their UNPOSTED info at the bottom asking the user to save their post and try again later.
-
The whole point of maintenance mode is to stop the user doing things like that, maintenance mode means that limited functionality is there to limit what happens with the database.
Fortunately we have auto saving posts for such things ;)
-
I can't think of anything that would be against adding this option, so yeah, why not..? :)