Commit 25ab388
committed
fix(shuffle): route s3 partition fetches through object store and stream per-partition IPC as a single Arrow stream
Two independent object-store shuffle correctness bugs that were latent until
PR #42 fixed the writer-side prefix bug and let intermediate shuffles actually
land in S3:
1. BallistaClient::fetch_partition was always going via the gRPC
Action::FetchPartition, whose executor-side handler does
`tokio::fs::File::open(path)` and only understands local paths and
`memory://`. With object-store shuffle enabled, writers reported
`location.path = s3://...` and the gRPC handler then failed with
`Failed to open file: No such file or directory`. Dispatch on the path
scheme (s3 / abfs / az / gs) and route those to the existing object-store
reader, sharing it via two new pub(crate) helpers
(path_is_object_store, fetch_object_store_partition_stream).
2. Both the no-repart and hash-repart Arrow IPC writer paths serialised
each batch via serialize_batch_to_ipc_bytes — every call writes a
complete IPC stream WITH a StreamWriter::finish() EOS marker — and
concatenated those streams into one S3 object. StreamReader stops at the
first EOS, so any partition holding more than one batch came back as
`Arrow error: Ipc error: Unexpected EOS`. Replace with a long-lived
StreamingMultipartIpcUploader that writes the header once on
construction, appends each batch's bytes into the multipart upload, and
emits the EOS marker exactly once on finish().
Verified end-to-end against a 1 scheduler + 2 executor local Spice cluster
with a multi-segment-prefix `shuffle_location: s3://bucket/<prefix>`:
- `SELECT COUNT(*) FROM t` (single-stage; exercises Bug A): succeeds.
- `SELECT col, COUNT(*) FROM t GROUP BY col ORDER BY ... LIMIT 5`
(hash-repartition shuffle; exercises Bug B): succeeds.1 parent f62181c commit 25ab388
5 files changed
Lines changed: 251 additions & 156 deletions
File tree
- ballista/core/src
- execution_plans
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
167 | 181 | | |
168 | 182 | | |
169 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
772 | 775 | | |
773 | 776 | | |
774 | 777 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
935 | | - | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
936 | 943 | | |
937 | | - | |
938 | | - | |
939 | | - | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
940 | 955 | | |
941 | 956 | | |
942 | 957 | | |
| |||
948 | 963 | | |
949 | 964 | | |
950 | 965 | | |
951 | | - | |
952 | | - | |
953 | | - | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
954 | 969 | | |
955 | 970 | | |
956 | 971 | | |
| |||
961 | 976 | | |
962 | 977 | | |
963 | 978 | | |
964 | | - | |
965 | | - | |
966 | | - | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
967 | 982 | | |
968 | 983 | | |
969 | 984 | | |
970 | 985 | | |
971 | 986 | | |
972 | | - | |
| 987 | + | |
973 | 988 | | |
974 | 989 | | |
975 | 990 | | |
| |||
1178 | 1193 | | |
1179 | 1194 | | |
1180 | 1195 | | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
1184 | 1201 | | |
1185 | 1202 | | |
1186 | 1203 | | |
1187 | 1204 | | |
1188 | 1205 | | |
1189 | 1206 | | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
1190 | 1212 | | |
1191 | 1213 | | |
1192 | 1214 | | |
| |||
0 commit comments