Skip to content

Commit c466d71

Browse files
committed
avail-pyrmts (shadow): thread binCol + range into fetchShardData
Same fix as `7ddb7104` for `/api/avail-geo`. Shadow-mode reader for `/api/totals?kind=availability` was calling `fetchShardData(storage, k)` without filter opts, so hyparquet loaded full `avail/agg/<tier>/<period>` shards into memory. On real station-filtered queries (witnessed via `wrangler tail` while loading a station-detail page) the shadow call OOMs in `waitUntil` — invisible to the client (legacy path succeeds) but defeats shadow-mode's parity-signal purpose. Effective only once shards have multiple RGs sorted by `dt` (true for `avail/agg/<tier>/` per Cascade-compactor convention; not yet for v2 shards — see `specs/avail-pyramid-v2.md` §7).
1 parent 7ddb710 commit c466d71

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

gbfs/api/src/avail_pyrmts.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,10 @@ export async function executeAvailViaPyrmts(
250250

251251
const shardRows = await Promise.all(
252252
plan.segments.map((seg) =>
253-
Promise.all(seg.keys.map((k) => fetchShardData(pyramid.storage, k).catch(() => [] as Row[]))).then((arrs) =>
253+
Promise.all(seg.keys.map((k) => fetchShardData(pyramid.storage, k, {
254+
binCol: pyramid.binCol,
255+
range: { from: seg.from, to: seg.to },
256+
}).catch(() => [] as Row[]))).then((arrs) =>
254257
arrs.flat(),
255258
),
256259
),

0 commit comments

Comments
 (0)