Repository navigation
Remove the old timestamp selection - #34712
Conversation
ece50ad to
e5b7d27
Compare
f39cf63 to
1cc5929
Compare
| # ----- | ||
| # Others (ordered by name) | ||
| "allow_real_time_recency": "true", | ||
| "constraint_based_timestamp_selection": "verify", |
There was a problem hiding this comment.
We might want to keep this for older versions
There was a problem hiding this comment.
Yes, I've added it back.
319a8be to
4ddb963
Compare
aljoscha
left a comment
There was a problem hiding this comment.
Changes look good, but I had a comment about naming that we might want to change. And about the lifetime of comments.
| Reason::ComputeInput(ids) => { | ||
| let formatted: Vec<_> = | ||
| ids.iter().map(|(c, g)| format!("({}, {})", c, g)).collect(); | ||
| write!(f, "Indexed inputs: [{}]", formatted.join(", ")) |
There was a problem hiding this comment.
I think I get where you're coming from, but before we at least had the symmetry of "Storage inputs" and "Compute Inputs". And I'm not 100 % sure that a compute input is always an indexed input, or that this will stay true in the future.
There was a problem hiding this comment.
I'm fairly certain that currently it's always an indexed input: It comes from CollectionIdBundle::compute_ids, whose comment is /// The identifiers for indexes in the compute layer..
My problem with "Compute Inputs" is that this phrase does not tell much to users, in that they probably don't realize that it's an index. I would feel a little bad to print this in a non-understandable way because of a future possibility of introducing some other thing here later.
How about I add a comment on CollectionIdBundle::compute_ids and Reason::ComputeInput that if this ever changes to include other things than indexes, then we should update the printing of Reason::ComputeInput?
There was a problem hiding this comment.
I've added the code comment, and merging the PR. We can get back to this later if needed.
| } | ||
| }, | ||
| "when": "AtLeastTimestamp:13", | ||
| "instance": "s1" |
There was a problem hiding this comment.
Why did the "instance" output go away here?
There was a problem hiding this comment.
It's not an output, but an input to the test. It went away because:
- this json mirrors the
Determinestruct insrc/adapter/tests/timestamp_selection.rs, and I removed theinstancefield from that struct. - And the reason for that is that the
determine_timestamp_forcall intest_timestamp_selectionno longer needs it, because I removed thecompute_instanceargument ofdetermine_timestamp_for. - And the reason I removed that is that it was only used by the
generate_timestamp_not_valid_error_msgcall, which I completely removed, and instead using the constraints in the error message.
4ddb963 to
7549684
Compare
7549684 to
625d540
Compare
Wrong version set in MaterializeInc#34712
Wrong version set in #34712 Seen in https://buildkite.com/materialize/nightly/builds/15502#019ccfc9-a458-4db4-b6c6-8d12a64a6c35 Test run: https://buildkite.com/materialize/nightly/builds/15514
The first commit removes the old timestamp selection, as discussed here: https://materializeinc.slack.com/archives/C08A62E0751/p1767794273757089?thread_ts=1764865885.225539&cid=C08A62E0751 The second commit updates a bunch of tests and fixes the error message when we don't find a suitable timestamp: Both the old and the new timestamp selection were relying on `generate_timestamp_not_valid_error_msg`, but that doesn't work well for the new timestamp selection for `AS OF` queries: the candidate comes out not as the `AS OF` time, so ``` SELECT * FROM t AS OF 1 ``` would regress from ``` Timestamp (1) is not valid for all inputs: [u1] ``` to ``` Timestamp (1768481949666) is not valid for all inputs: [] ``` which does not make sense: The `[]` is the list of inputs that this timestamp is not valid for, so we can see that actually this timestamp is valid for all inputs. But the problem here is not that this timestamp is not valid for an input, but the problem is the `AS OF`, which is not mentioned by the error msg. So, the PR makes the error message print the constraints instead. It also tweaks the formatting of constraints a bit, to use more user-facing terminology, e.g., instead of `ComputeInput` we now say `Indexed input`. So, now we have stuff like: ``` select * from t AS OF 7; ERROR: could not find a valid timestamp for the query DETAIL: Constraints: lower: (Storage inputs: [u1]): [1768492534743 (2026-01-15 15:55:34.743)] upper: (Query's AS OF): [ 7 (1970-01-01 00:00:00.007)] ``` ~**Edit:** I'm still fighting with a lot of annoying test output rewrites.~ **Edit 2:** Nightly is green. https://buildkite.com/materialize/nightly/builds/14740
Wrong version set in MaterializeInc#34712 Seen in https://buildkite.com/materialize/nightly/builds/15502#019ccfc9-a458-4db4-b6c6-8d12a64a6c35 Test run: https://buildkite.com/materialize/nightly/builds/15514
The first commit removes the old timestamp selection, as discussed here: https://materializeinc.slack.com/archives/C08A62E0751/p1767794273757089?thread_ts=1764865885.225539&cid=C08A62E0751
The second commit updates a bunch of tests and fixes the error message when we don't find a suitable timestamp: Both the old and the new timestamp selection were relying on
generate_timestamp_not_valid_error_msg, but that doesn't work well for the new timestamp selection forAS OFqueries: the candidate comes out not as theAS OFtime, sowould regress from
to
which does not make sense: The
[]is the list of inputs that this timestamp is not valid for, so we can see that actually this timestamp is valid for all inputs. But the problem here is not that this timestamp is not valid for an input, but the problem is theAS OF, which is not mentioned by the error msg.So, the PR makes the error message print the constraints instead. It also tweaks the formatting of constraints a bit, to use more user-facing terminology, e.g., instead of
ComputeInputwe now sayIndexed input. So, now we have stuff like:Edit: I'm still fighting with a lot of annoying test output rewrites.Edit 2: Nightly is green. https://buildkite.com/materialize/nightly/builds/14740