Repository navigation
fix(query): record a spilled query's filter segments in its sidecar - #911
Open
VfourTwenty wants to merge 1 commit into
Open
VfourTwenty wants to merge 1 commit into
VfourTwenty wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A spilled result's sidecar kept the query text but not the filter segments from
--segment/--segments-file, so when the spill was gone or unreadabledtctl inspecttold you to re-run a query that reads other rowssegmentsfield toSidecarManifest(id + variables, same shape as the query request'sfilterSegmentsand a--segments-fileentry). it'somitempty, so a query without segments writes the same sidecar as before and old sidecars without the field still read finespill_write.go, streamedspill_stream_exec.go) now fill it from the executor's segmentsinspect's spill_file_not_found / spill_file_unreadable advice adds them to the re-run command as-S 'id?var=a,b'flags. values are single-quoted, so pasting the command doesn't expand$or backticks. if a value can't be written in-Ssyntax (e.g. it has a comma) it points at--segments-fileinstead and names the sidecar whosesegmentslist can be used as that filethe issue says "names and variables", i went with the segment ids Grail actually received, since names given to
-Sare already resolved to UIDs by the time the executor runs and an id is an exact match while a name is a substring one. can switch if names make more sense)Didn't touch
inspect --listentries, the wrong-context advice or the sidecar of an inspect re-spill. + the query text in the same advice is still double-quoted like on main, could single-quote it in a follow-upRelated Issues
Closes #830
Testing
TestE2E_SpillSidecarRecordsTheSegmentsGrailReceivedruns the executor against an httptest Grail on the buffered and the streamed spill path and checks the sidecar'ssegmentsequal thefilterSegmentsin the requestTestInspectAdviceReRunsTheQueryWithItsSegmentsrunsinspecton a spill whose data file is gone, passes the advised command throughbash -cand feeds the-Svalues back throughparseSegmentFlags. they have to give the recorded segments, including values with$, backticks, quotes, tab, newline and a no-break space (skipped on windows)TestInspectAdviceNamesASegmentsFileWhenABindingCannotBeInlinechecks the--segments-filefallback and that the sidecar's list parses throughparseSegmentsFileall three fail on main. ran everything in docker on go 1.26.11
make test)make lint)