Commit df33365
Fix range mtr tests
Summary:
During the rebase to 8.0.28, the MEM_ROOT for quick range allocation has changed from using its own MEM_ROOT to using the main MEM_ROOT, which makes accounting trickier.
While normal builds will allocate memory in large chunks and satisfy requests for memory from those chunks, asan/valgrind will convert all requests for memory into explicit allocations. This means that we allocate memory more frequently in asan/valgrind which means that we perform more frequent checks to see if we've exceeded the limit.
This leads to 2 issues:
- The main MEM_ROOT will already have memory allocated on it, which may already exceed the limit. The next allocation will always fail in that case. The fix is to set the limit to the already allocated amount plus the range max mem limit. There's some additional code in the error handler to ensure that the correct error message is displayed.
- It's generally non-deterministic whether a query will fail or not. This is because there is still unused allocated memory on the main MEM_ROOT, and depending on how much we have left and how much the range optimizer takes, we may or may not hit an error. To fix this, I just disabled the `main.range_with_memory_limit_error` test in asan/valgrind.
Squash with: D34256842
Reviewed By: hermanlee
Differential Revision: D42949953
fbshipit-source-id: bfc64bf1 parent e8a5f4a commit df33365
File tree
4 files changed
+29
-3
lines changed- mysql-test/t
- sql
- range_optimizer
4 files changed
+29
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
101 | 116 | | |
102 | 117 | | |
103 | 118 | | |
| |||
108 | 123 | | |
109 | 124 | | |
110 | 125 | | |
| 126 | + | |
111 | 127 | | |
112 | 128 | | |
113 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
594 | 598 | | |
595 | 599 | | |
596 | 600 | | |
597 | 601 | | |
598 | | - | |
599 | | - | |
600 | 602 | | |
601 | 603 | | |
602 | 604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6103 | 6103 | | |
6104 | 6104 | | |
6105 | 6105 | | |
| 6106 | + | |
| 6107 | + | |
| 6108 | + | |
6106 | 6109 | | |
| 6110 | + | |
6107 | 6111 | | |
6108 | 6112 | | |
6109 | 6113 | | |
| |||
0 commit comments