Commit e1b2223
committed
Handle empty index array in
When a stream is created but no segment has been flushed yet, the index
file exists on disk but contains no records after the header. The call
to `rabbitmq_stream_s3_array:at/3` on an empty binary crashes with
`badarg`.
Add a guard clause matching `<<>>` that returns a default empty
fragment, consistent with the `[]` branch in `init_manifest/2`.recover_fragments/7
1 parent 846762c commit e1b2223
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
229 | 241 | | |
230 | 242 | | |
231 | 243 | | |
| |||
0 commit comments