maria-developers team mailing list archive
Mailing list archive
can "set read_only" be non-blocking?
It can be dangerous for us to run "set read_only" on a production server
because it can block in close_cached_tables. More details about the pain
this caused at a previous job are at:
Per the code in set_var.cc:
Perform a 'FLUSH TABLES WITH READ LOCK'.
This is a 3 step process:
-  lock_global_read_lock()
-  close_cached_tables()
-  make_global_read_lock_block_commit()
 prevents new connections from obtaining tables locked for write.
 waits until all existing connections close their tables.
 prevents transactions from being committed.
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.