Commit a7b5c46
Konstantin Osipov
A new implementation for the TABLE_SHARE cache in MDL
subsystem. Fix a number of caveates that the previous
implementation suffered from, including unprotected
access to shared data and lax resource accounting
(share->ref_count) that could lead to deadlocks.
The new implementation still suffers from a number
of potential deadlocks in some edge cases, and this is
still not enabled by default. Especially since performance
testing has shown that it gives only marginable (not even
exceeding measuring accuracy) improvements.
@todo:
- Remove calls to close_cached_tables() with REFRESH_FAST,
and have_lock, because they break the MDL cache.
- rework FLUSH TABLES <list> to not use close_cached_tables()
- make sure that whenever we set TABLE_SHARE::version to
0 we free MDL cache references to it.
--BZR--
revision-id: [email protected]
property-branch-nick: trunk-runtime-mdl-cache
property-file-info: ld7:file_id40:mdl.cc-20080523121737-j62pi0m62eaw1hq6-17:message134:We may cache references to TABLE_SHARE objects in
property-file-info: MDL_lock objects for tables. Create a separate
property-file-info: MDL_lock class to represent a table.4:path10:sql/mdl.cced7:file_id39:mdl.h-20080523121748-o4y2wcq3maotb9do-17:message42:Adjust the MDL caching API to avoid races.4:path9:sql/mdl.hed7:file_id64:sp1f-sql_base.cc-19700101030959-w7tul2gb2n4jzayjwlslj3ybmf3uhk6a7:message154:Move all caching functionality close together.
property-file-info: Implement a solution for deadlocks caused by
property-file-info: close_cached_tables() when MDL cache is enabled (incomplete).4:path15:sql/sql_base.cced7:file_id64:sp1f-sql_yacc.yy-19700101030959-wvn4qyy2drpmge7kaq3dysprbhlrv27j7:message158:Adjust FLUSH rule to do the necessary initialization of
property-file-info: TABLE_LIST elements used in for FLUSH TABLES <list>, and thus
property-file-info: work OK with flush_mdl_cache() function.4:path15:sql/sql_yacc.yyee
testament3-sha1: 9cb593d806d0531fdc31d259a0dc8a20b26ba0471 parent 172a513 commit a7b5c46
4 files changed
+228
-80
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
| 287 | + | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
366 | | - | |
| 365 | + | |
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
370 | 369 | | |
371 | 370 | | |
372 | 371 | | |
373 | 372 | | |
| 373 | + | |
| 374 | + | |
374 | 375 | | |
375 | 376 | | |
376 | 377 | | |
| |||
458 | 459 | | |
459 | 460 | | |
460 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
461 | 481 | | |
462 | 482 | | |
463 | 483 | | |
| |||
674 | 694 | | |
675 | 695 | | |
676 | 696 | | |
677 | | - | |
678 | | - | |
| 697 | + | |
679 | 698 | | |
680 | 699 | | |
681 | 700 | | |
| |||
839 | 858 | | |
840 | 859 | | |
841 | 860 | | |
| 861 | + | |
| 862 | + | |
842 | 863 | | |
843 | 864 | | |
844 | 865 | | |
| |||
1181 | 1202 | | |
1182 | 1203 | | |
1183 | 1204 | | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
1188 | | - | |
1189 | 1205 | | |
1190 | 1206 | | |
1191 | 1207 | | |
| |||
1655 | 1671 | | |
1656 | 1672 | | |
1657 | 1673 | | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
1661 | | - | |
1662 | 1674 | | |
1663 | 1675 | | |
1664 | 1676 | | |
1665 | 1677 | | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
1666 | 1681 | | |
1667 | 1682 | | |
1668 | 1683 | | |
| |||
1864 | 1879 | | |
1865 | 1880 | | |
1866 | 1881 | | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
1867 | 1885 | | |
1868 | 1886 | | |
1869 | 1887 | | |
| |||
2450 | 2468 | | |
2451 | 2469 | | |
2452 | 2470 | | |
2453 | | - | |
| 2471 | + | |
2454 | 2472 | | |
2455 | 2473 | | |
2456 | 2474 | | |
| |||
2460 | 2478 | | |
2461 | 2479 | | |
2462 | 2480 | | |
2463 | | - | |
2464 | | - | |
| 2481 | + | |
2465 | 2482 | | |
2466 | | - | |
| 2483 | + | |
2467 | 2484 | | |
2468 | 2485 | | |
2469 | 2486 | | |
2470 | | - | |
2471 | | - | |
2472 | | - | |
2473 | | - | |
2474 | | - | |
2475 | | - | |
2476 | | - | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
2477 | 2490 | | |
2478 | | - | |
2479 | | - | |
| 2491 | + | |
2480 | 2492 | | |
2481 | 2493 | | |
2482 | 2494 | | |
2483 | 2495 | | |
2484 | 2496 | | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
2485 | 2508 | | |
2486 | 2509 | | |
2487 | 2510 | | |
| |||
2492 | 2515 | | |
2493 | 2516 | | |
2494 | 2517 | | |
2495 | | - | |
| 2518 | + | |
| 2519 | + | |
2496 | 2520 | | |
2497 | 2521 | | |
2498 | 2522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
401 | | - | |
| 400 | + | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| |||
724 | 724 | | |
725 | 725 | | |
726 | 726 | | |
| 727 | + | |
727 | 728 | | |
728 | 729 | | |
729 | 730 | | |
| |||
0 commit comments