Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for time bucketed fixed size #968

Merged
merged 5 commits into from
Apr 15, 2024
Merged

Conversation

inahga
Copy link
Contributor

@inahga inahga commented Apr 11, 2024

Supports #291.

I've not plumbed this through the UI, yet.

src/entity/task/new_task.rs Fixed Show fixed Hide fixed
src/entity/task/new_task.rs Fixed Show fixed Hide fixed
@inahga inahga force-pushed the inahga/fixed-size-time-bucketed branch from f3ea55f to 69daf64 Compare April 12, 2024 16:31
src/entity/task/new_task.rs Fixed Show fixed Hide fixed
src/entity/task/new_task.rs Fixed Show fixed Hide fixed
@inahga inahga force-pushed the inahga/fixed-size-time-bucketed branch 5 times, most recently from 1b8c84d to 8c08570 Compare April 12, 2024 19:02
Copy link
Contributor Author

@inahga inahga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to successfully smoke test this in a kind cluster with a Janus leader with this PR divviup/janus#3001, and a Janus helper on 0.7.4.

I'm going to write an in_cluster test that fully exercises this query type, but for now the divviup-api plumbing is complete.

ValidationError::new("time-bucketed-fixed-size-unsupported"),
)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that we're only checking the leader for support here, as noted in #291.

We don't withhold the batch_time_window_size parameter when submitting to the helper. If the helper doesn't directly support the parameter, I'm assuming that it's going to ignore it, i.e. the default behavior of serde.

Note that even without helper direct support, the query_type JSON blob is stored verbatim in the Janus database. So if for some reason the helper needs to become aware that it's running TimeBucketedFixedSize, the knowledge is there.

@inahga inahga marked this pull request as ready for review April 12, 2024 19:33
@inahga inahga requested a review from a team as a code owner April 12, 2024 19:33
@inahga inahga force-pushed the inahga/fixed-size-time-bucketed branch from ba8e981 to 2493c2d Compare April 12, 2024 19:34
@inahga
Copy link
Contributor Author

inahga commented Apr 12, 2024

Hmm, recalling that #874 is a problem, I probably should have gone with the approach of storing the query type explicitly in the database rather than having it continue to be signaled by nullable columns.

Let me pull this back out into draft to explore this.

@inahga inahga marked this pull request as draft April 12, 2024 22:38
@inahga
Copy link
Contributor Author

inahga commented Apr 15, 2024

Let me pull this back out into draft to explore this.

This turns out to be a relatively large and risky yak-shave. We need to migrate existing query type definitions into a new column, possibly keeping both sets of columns in sync for a bit.

I don't think it will be meaningfully more difficult to migrate the additional batch_time_window_size field along with max_batch_size, so I'd like to leave this aside to solve in #874 since it's not the immediate priority.

@inahga inahga marked this pull request as ready for review April 15, 2024 17:39
match value {
QueryType::TimeInterval => None,
QueryType::FixedSize { max_batch_size } => Some(max_batch_size),
impl From<NewTask> for QueryType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better suited as a new method on NewTask that takes &self, rather than a From conversion. Each place we use it, we clone the entire task first.

@inahga inahga force-pushed the inahga/fixed-size-time-bucketed branch from dc5f82f to d09c2e6 Compare April 15, 2024 22:46
@inahga inahga enabled auto-merge (squash) April 15, 2024 22:46
@inahga inahga merged commit 1a87661 into main Apr 15, 2024
7 checks passed
@inahga inahga deleted the inahga/fixed-size-time-bucketed branch April 15, 2024 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants