[MDEV-136] Non-blocking "set read_only" Created: 2012-02-02 Updated: 2012-06-04 Due: 2012-05-16 Resolved: 2012-05-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | 5.3.8 |
| Type: | Task | Priority: | Major |
| Reporter: | Rasmus Johansson (Inactive) | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | pf1 | ||
| Issue Links: |
|
||||||||
| Description |
|
It can be dangerous to run "set read_only" on a production server because it can block in close_cached_tables. More details about the pain this caused previously are at: Per the code in set_var.cc:
Can there be a variant that doesn't do #2? My workload doesn't use MyISAM and I don't know if #2 is done because of MyISAM. Calling close_cached_tables seems like a heavy way to force LOCK TABLEs to be unlocked. Any long running queries will cause #2 to block. See also http://lists.mysql.com/commits/142825 |
| Comments |
| Comment by Rasmus Johansson (Inactive) [ 2012-02-02 ] |
|
By Monty: The reason for 2 is to ensure that that all table info is written to This is mostly for MyISAM and non transactional tables, but it will |
| Comment by Rasmus Johansson (Inactive) [ 2012-02-02 ] |
|
By Mark: We want a fast version of this to support other admin activities. In this case we don't care if this doesn't make it safe to backup MyISAM. Is it possible to provide that option and is it interesting for MariaDB to have such an option? |
| Comment by Rasmus Johansson (Inactive) [ 2012-02-02 ] |
|
By Monty: This is how innodb/xtradb works just now. However, I assume it should not be hard to fix XtraDB to flush things completely for tables that are closed and flushed and not in use by any transaction. (This is what Aria does today). What is possible relatively easy is to add the above FAST keyword to FLUSH TABLES. For MyISAM tables it would do as I describe above, for other table type it would basicly be a nop and would thus solve your problem while being useful for others. |
| Comment by Rasmus Johansson (Inactive) [ 2012-02-02 ] |
|
Assuming this won't block waiting for running queries to finish, yes let's proceed with a worklog. |
| Comment by Michael Widenius [ 2012-03-06 ] |
|
Suggestion of how solve the issue that [2] (closed_cahched_tables()) I would prefer that setting 'readonly' would mean that The syncing is not critical for transactional tables (like InnoDB). I suggest that we change close_cached_tables(), for the case of This can be done by adding a handler specific flag to the above If you are only using InnoDB tables, there would not be any waits anymore Estimate amount of work (with testing): 8-16 hours (probably closer to 8). |
| Comment by Mark Callaghan [ 2012-04-30 ] |
|
Will "refresh_version" still be incremented in this case? And if yes, then doesn't that create a significant performance impact by forcing all InnoDB table instances to be reopened? |
| Comment by Michael Widenius [ 2012-05-07 ] |
|
We can skip incrementing refresh_version for the case of The reason we increment refresh_version is to ensure that we will close any old instances of the table and read the possible new table definition (that may have changed during FLUSH TABLES). |
| Comment by Alexey Botchkov [ 2012-05-09 ] |
|
Patch committed |
| Comment by Rasmus Johansson (Inactive) [ 2012-05-14 ] |
|
As agreed with Monty, please review this |
| Comment by Alexey Botchkov [ 2012-05-17 ] |
|
New patch committed: |