[MDEV-15888] Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK for views Created: 2018-04-16 Updated: 2021-07-03 Resolved: 2021-05-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Views |
| Fix Version/s: | 10.6.2 |
| Type: | Task | Priority: | Critical |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | views | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK does not currently work for views. For example, if we have this view:
We can see this behavior:
However, LOCK TABLES ... READ is smart enough to lock the underlying tables:
Some users would like to see FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK work similarly for views. |
| Comments |
| Comment by Sergei Golubchik [ 2018-04-17 ] |
|
FLUSH TABLE v works for views, and LOCK TABLES v READ works for views. One can expect FLUSH TABLE v WITH READ LOCK to work too. |
| Comment by Alexey Botchkov [ 2018-10-30 ] |
|
http://lists.askmonty.org/pipermail/commits/2018-October/013042.html |
| Comment by Sergey Vojtovich [ 2019-01-11 ] |
|
holyfoot, relevant code have changed in all major versions, which means we have to have like 5 According to Rasmus there's no strong need to have it in GA versions. So, let's retarget for 10.4. In 10.4 we should call extra(HA_EXTRA_FLUSH) instead of closing tables. Also I'm not sure if blocking commits is really needed here. If not, instead of taking BACKUP locks, we should probably take MDL_SHARED_READ_ONLY in TABLE namespace. |
| Comment by Alexey Botchkov [ 2021-02-09 ] |
|
I tried to adapt the previous solution for this issue - to collect all the related tables in one list to do the first lock_table_names(SNR) lock. |
| Comment by Alexey Botchkov [ 2021-05-23 ] |
|
https://github.com/MariaDB/server/commit/a40a36d9b9dc8b78171214905dce6d7fe19961d7 |
| Comment by Sergei Golubchik [ 2021-05-26 ] |
|
a40a36d9b9dc is ok to push |
| Comment by Alexey Botchkov [ 2021-05-31 ] |
|
https://github.com/MariaDB/server/commit/b118f92be6b8d7294f3b57f824559ced3dcccc6b |