Commit 97b4fc5
committed
fix(s3): pass appendPartBlobKeys' pending by pointer so flush observes appends
Gemini high — the previous round split cleanup paths onto
s3MetaBatchOps but missed that `appendPartBlobKeys` still took
`pending []*kv.Elem[kv.OP]` by value. The flush closure inside
`cleanupManifestBlobs` captures the outer `pending` slice header;
appends performed inside the helper update the local header only, so
flush sees length 0 every iteration and silently no-ops. After the
helper returns, the caller reassigns `pending` from the helper's
return value — but by then the entire part's chunks have accumulated
into one slice that bypasses the s3MetaBatchOps cap entirely.
For a manifest with thousands of chunks (e.g. a 5 GiB-object cleanup
with ~5120 chunks), the broken helper builds one giant batch and
hands it to coordinator.Dispatch in a single call, re-introducing
exactly the OOM / oversized-MsgApp risk the s3MetaBatchOps cap was
meant to prevent. This is the same shape as the pre-PR-#636
behaviour s3ChunkBatchOps was tightening, just on the cleanup side.
Fix: take `pending` by pointer (`*[]*kv.Elem[kv.OP]`) and write
through it. Now appends inside the helper update the variable the
flush closure reads, so threshold-triggered flushes fire correctly
and the slice length never exceeds s3MetaBatchOps.
Test:
- TestAppendPartBlobKeys_FlushFiresEveryS3MetaBatchOps builds a part
with 2 × s3MetaBatchOps + 7 chunks, calls the helper directly with
a recording flush closure, and asserts flush fired exactly twice
with batch sizes [s3MetaBatchOps, s3MetaBatchOps] plus 7 trailing
entries left for the caller's tail flush. The test catches the
bug: the value-passing version would record 0 flushes (closure
always saw length 0) — the assertion `Equal(2, flushCalls)`
would fail loudly.
Build / vet / lint clean. All S3 + cleanup tests pass.1 parent 5338c05 commit 97b4fc5
2 files changed
Lines changed: 72 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2237 | 2237 | | |
2238 | 2238 | | |
2239 | 2239 | | |
2240 | | - | |
2241 | | - | |
| 2240 | + | |
2242 | 2241 | | |
2243 | 2242 | | |
2244 | 2243 | | |
2245 | 2244 | | |
2246 | 2245 | | |
2247 | 2246 | | |
2248 | | - | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
2249 | 2259 | | |
2250 | 2260 | | |
2251 | 2261 | | |
2252 | | - | |
| 2262 | + | |
2253 | 2263 | | |
2254 | | - | |
| 2264 | + | |
2255 | 2265 | | |
2256 | 2266 | | |
2257 | 2267 | | |
2258 | | - | |
| 2268 | + | |
2259 | 2269 | | |
2260 | 2270 | | |
2261 | 2271 | | |
2262 | | - | |
| 2272 | + | |
2263 | 2273 | | |
2264 | 2274 | | |
2265 | 2275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
0 commit comments