Repository navigation
fix(load): publish a csv source's row estimate before its first batch - #1159
azimafroozeh merged 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
RecommendationRequest changes. The publication order is the right fix. The regression stays green on the old order, so this commit does not lock the bug. This head is already merged. The follow-up is the expectation. The order in this commit can stay. WhyA CSV overwrite sizes its uniqueness holder tables from the source row estimate. The sweep reads that estimate after it holds a batch. Before this change the source stored the sample after What this commit does
Why the order holdsOne caller reads the estimate: BlockingThe new test and the I moved
Change the step to expect OptionalThe sample is still the first slice any partition parses. Partitions whose first slices differ in row count can still size the tables to different powers of two, once a shard's share reaches 8 rows. This case has one partition, so that split does not apply here. A multi-partition overwrite near a bucket boundary can still make LiabilityThe fix removes a schedule-dependent refusal for a one-partition overwrite. It adds one ValidationReviewed head: The old-order probes kept the new
CI Temporary edits were restored. Nothing was pushed. LimitationsI did not see the lost order under the DST scheduler without the sleep. Local runs of the old order, with no sleep, took the sized path. I did not run a multi-partition source whose first slices differ in row count. Inline comment for This assertion stays green when |
A csv overwrite's validate sweep sizes its uniqueness check's holder tables from the source's row estimate on the first batch that has one, and the source publishes that estimate after the batch is sent: a sweep that reads first finds none, the tables stay unsized, and the
query_memory_bytesrefusal that follows reports their bytes less, 456 here. TheGQT (dst)replay ofwrite_max_bytes_removed_id_charge.gqtseed 0 saw both orders on main after #1158,actual 398742against399198, every assertion green in both attempts; #1158's seed-42 fix ordered the source's admission before its first poll and left this read after the send.The estimate now has its own sample, the first parsed slice's row count, published once before that slice's batches are sent, so the channel's send is the happens-before edge from the sample to every batch a consumer can hold. The
LoadSliceExecutedrecord stays after the send, since itsend_nsis the moment the slice's last batch left.the_row_estimate_precedes_the_first_batchtakes a partition's first batch from the stream and asserts the estimate is set at that point; without the change the assertion is the race itself, and a 20 ms gap forced between the send and the record's push in a probe build reproduces CI's attempt 0 to the byte,actual 398742.For review: the decision to challenge is the sample's source, the first slice any partition parses, where the record's
first()was the first slice any partition finished; with several partitions either is whichever partition gets there first, so a partitioned source whose first slices differ in rows is the input that gives two table sizes, unchanged by this diff. Least sure is that no local schedule ever produced the lost order, so a greenGQT (dst)on this branch is the usual order, not the proof. Nothing in the diff reads or writes storage, so the cost golden is unchanged; the estimate's value is unchanged, so no release note.