Commit f51a654
committed
[mysql_raft] Adding a flag to delay auto binlog rotation when a raft purge is active
Summary:
Purging logs in raft is very expensive because we read logs to
find the last opid for every to-be-purged binlog. Ideally we should be
storing this info in the index file like the prev gtid set but that is a
big work item. Purge can cause stalls in the commit pipeline when auto
rotation is triggered (current binlog goes beyond max_binlog_size). To
quick fix added an atomic to indicate if a raft purge is active, if yes,
we delay to auto rotate operation in group commit, avoiding stalls at
the cost of slighly exceeding max_binlog_size.
Test Plan: mtr
Reviewers: arahut
Reviewed By: arahut
Subscribers: webscalesql-eng@fb.com
Differential Revision: https://phabricator.intern.facebook.com/D40743288
Tasks: T130891182
(cherry picked from commit 002c1059a64aa42c037454f668e994f41831d267)1 parent 474c6a7 commit f51a654
File tree
10 files changed
+188
-4
lines changed- mysql-test
- r
- suite
- rpl_raft
- r
- t
- sys_vars
- r
- t
- sql
10 files changed
+188
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
389 | 394 | | |
390 | 395 | | |
391 | 396 | | |
| |||
3099 | 3104 | | |
3100 | 3105 | | |
3101 | 3106 | | |
| 3107 | + | |
3102 | 3108 | | |
3103 | 3109 | | |
3104 | 3110 | | |
| |||
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3964 | 3964 | | |
3965 | 3965 | | |
3966 | 3966 | | |
3967 | | - | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
3968 | 3980 | | |
3969 | 3981 | | |
3970 | 3982 | | |
| |||
4024 | 4036 | | |
4025 | 4037 | | |
4026 | 4038 | | |
4027 | | - | |
4028 | | - | |
| 4039 | + | |
| 4040 | + | |
| 4041 | + | |
| 4042 | + | |
| 4043 | + | |
| 4044 | + | |
| 4045 | + | |
| 4046 | + | |
| 4047 | + | |
| 4048 | + | |
| 4049 | + | |
| 4050 | + | |
| 4051 | + | |
4029 | 4052 | | |
4030 | 4053 | | |
4031 | 4054 | | |
| |||
11987 | 12010 | | |
11988 | 12011 | | |
11989 | 12012 | | |
11990 | | - | |
| 12013 | + | |
| 12014 | + | |
11991 | 12015 | | |
11992 | 12016 | | |
11993 | 12017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| 599 | + | |
| 600 | + | |
599 | 601 | | |
600 | 602 | | |
601 | 603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1239 | 1239 | | |
1240 | 1240 | | |
1241 | 1241 | | |
| 1242 | + | |
1242 | 1243 | | |
1243 | 1244 | | |
1244 | 1245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
471 | 472 | | |
472 | 473 | | |
473 | 474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9038 | 9038 | | |
9039 | 9039 | | |
9040 | 9040 | | |
| 9041 | + | |
| 9042 | + | |
| 9043 | + | |
| 9044 | + | |
| 9045 | + | |
| 9046 | + | |
| 9047 | + | |
| 9048 | + | |
9041 | 9049 | | |
9042 | 9050 | | |
9043 | 9051 | | |
| |||
0 commit comments