Commit 7a329ad
committed
refactor: harden FileCleanupStrategy with retry and parallel deletes
Rebases onto apache#687's executor pool support per @wgtmac's review:
* FileCleanupStrategy now takes an OptionalExecutor in its constructor.
When the custom DeleteWith() callback is configured, per-path deletes
fan out through a TaskGroup that uses the executor (or runs serially
when none is set, preserving prior behavior).
* The FileIO bulk delete path wraps file_io_->DeleteFiles in a tight
RetryRunner<retry::StopRetryOn<kNotFound>> so transient FileIO errors
no longer give up after the first attempt. Mirrors Java's
Tasks.foreach(...).stopRetryOn(NotFoundException.class).retry(N).
* Adds ExpireSnapshots::Executor(OptionalExecutor) so callers can opt
in to parallel deletion, and threads it down through both
IncrementalFileCleanup and ReachableFileCleanup.
* Drops the std::async / std::thread / std::span machinery and the
ad-hoc retry loop -- replaced by util/task_group.h and
util/retry_util.h from apache#687.
Adds ExecutorDispatchesDeletesConcurrently test that wires a
test::ThreadExecutor through the new API and asserts the executor
received one submission per file.1 parent ae29c3d commit 7a329ad
3 files changed
Lines changed: 118 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
444 | 447 | | |
445 | 448 | | |
446 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
447 | 489 | | |
448 | 490 | | |
449 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
68 | | - | |
69 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
70 | 76 | | |
71 | 77 | | |
72 | 78 | | |
| |||
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
102 | 113 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
106 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
107 | 137 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 138 | + | |
| 139 | + | |
114 | 140 | | |
| 141 | + | |
115 | 142 | | |
116 | 143 | | |
117 | 144 | | |
| |||
153 | 180 | | |
154 | 181 | | |
155 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
156 | 195 | | |
157 | 196 | | |
158 | 197 | | |
| |||
161 | 200 | | |
162 | 201 | | |
163 | 202 | | |
164 | | - | |
| 203 | + | |
165 | 204 | | |
166 | 205 | | |
167 | 206 | | |
| |||
366 | 405 | | |
367 | 406 | | |
368 | 407 | | |
369 | | - | |
| 408 | + | |
370 | 409 | | |
371 | 410 | | |
372 | 411 | | |
| |||
703 | 742 | | |
704 | 743 | | |
705 | 744 | | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
706 | 750 | | |
707 | 751 | | |
708 | 752 | | |
| |||
934 | 978 | | |
935 | 979 | | |
936 | 980 | | |
937 | | - | |
| 981 | + | |
938 | 982 | | |
939 | 983 | | |
940 | 984 | | |
941 | | - | |
| 985 | + | |
942 | 986 | | |
943 | 987 | | |
944 | 988 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
143 | 159 | | |
144 | 160 | | |
145 | 161 | | |
| |||
184 | 200 | | |
185 | 201 | | |
186 | 202 | | |
| 203 | + | |
187 | 204 | | |
188 | 205 | | |
189 | 206 | | |
| |||
0 commit comments