Commit 7e32c10
committed
schemeshard: fix copy-tables memory hog
Export launches copy-tables operation, copy-tables invokes multiple
copy table suboperations, each copy-table suboperation grabs and
saves aside metadata of table's subdomain (to be able to restore
original subdomain state in case IgniteOperation() fails).
Straightforward implementation of TMemChanges resulted in that
the same and only subdomain being copied multiple times.
Which for massive export actions with many-many tables copied
is both cpu intensive and, more importantly, requires excessive
amount of memory (up to several observed OOM events).
This fix changes TMemChanges to store only one subdomain state
version per operation. Which is correct and appropriate for
copy-tables and all other (sub)operations.
KIKIMR-202421 parent 8ce7edb commit 7e32c10
File tree
2 files changed
+19
-12
lines changed- ydb/core/tx/schemeshard
2 files changed
+19
-12
lines changedLines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| |||
178 | 184 | | |
179 | 185 | | |
180 | 186 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
189 | 191 | | |
| 192 | + | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | | - | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
0 commit comments