Forcing maintenance mode first?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Forcing maintenance mode first?
« 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?
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

MultiformeIngegno

  • Posts: 1,337
Re: Forcing maintenance mode first?
« Reply #1, on January 20th, 2013, 08:56 PM »
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.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Forcing maintenance mode first?
« Reply #2, on January 20th, 2013, 09:01 PM »
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.

MultiformeIngegno

  • Posts: 1,337
Re: Forcing maintenance mode first?
« Reply #3, on January 20th, 2013, 09:06 PM »
Quote from Arantor on January 20th, 2013, 09:01 PM
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?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Forcing maintenance mode first?
« Reply #4, on January 20th, 2013, 09:07 PM »
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.

MultiformeIngegno

  • Posts: 1,337

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Forcing maintenance mode first?
« Reply #6, on January 21st, 2013, 03:34 PM »
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
The way it's meant to be

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Forcing maintenance mode first?
« Reply #7, on January 21st, 2013, 07:56 PM »
There are options to that, you can either rename everything in the plugins directory, or empty out 'plugins_enabled' in the settings table.

Auk

  • Can I get a Box?
  • Posts: 64
Re: Forcing maintenance mode first?
« Reply #8, on January 22nd, 2013, 08:01 PM »
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.

Nothing is more despicable than respect based on fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Forcing maintenance mode first?
« Reply #9, on January 22nd, 2013, 09:25 PM »
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 ;)

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Forcing maintenance mode first?
« Reply #10, on January 23rd, 2013, 03:14 PM »
I can't think of anything that would be against adding this option, so yeah, why not..? :)