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

[timeseries] Part-4: Complete Support for Multi-Server Queries #14676

Merged
merged 4 commits into from
Dec 25, 2024

Conversation

ankitsultana
Copy link
Contributor

@ankitsultana ankitsultana commented Dec 17, 2024

Finishes the ongoing work to support Time Series queries on tables that can have numInstancesPerReplicaGroup > 1.

The Timeseries Quickstart also now starts with 2 servers.

Also tested in one of our smaller clusters and we are able to get 50-100 QPS consistently.

@ankitsultana ankitsultana added the timeseries-engine Tracking tag for generic time-series engine work label Dec 17, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 3.44828% with 196 lines in your changes missing coverage. Please review.

Project coverage is 63.97%. Comparing base (59551e4) to head (245d1ff).
Report is 1505 commits behind head on master.

Files with missing lines Patch % Lines
...va/org/apache/pinot/query/runtime/QueryRunner.java 0.00% 37 Missing ⚠️
.../pinot/query/service/dispatch/QueryDispatcher.java 2.85% 34 Missing ⚠️
...ispatch/timeseries/TimeSeriesDispatchObserver.java 0.00% 28 Missing ⚠️
...imeseries/PhysicalTimeSeriesBrokerPlanVisitor.java 8.00% 23 Missing ⚠️
...pinot/tsdb/planner/TimeSeriesQueryEnvironment.java 0.00% 23 Missing ⚠️
.../pinot/tsdb/planner/physical/TableScanVisitor.java 0.00% 15 Missing ⚠️
...b/planner/physical/TimeSeriesDispatchablePlan.java 0.00% 15 Missing ⚠️
...imeseries/PhysicalTimeSeriesServerPlanVisitor.java 0.00% 10 Missing ⚠️
...roker/requesthandler/TimeSeriesRequestHandler.java 0.00% 4 Missing ⚠️
...runtime/timeseries/TimeSeriesExecutionContext.java 50.00% 4 Missing ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14676      +/-   ##
============================================
+ Coverage     61.75%   63.97%   +2.22%     
- Complexity      207     1608    +1401     
============================================
  Files          2436     2707     +271     
  Lines        133233   149242   +16009     
  Branches      20636    22871    +2235     
============================================
+ Hits          82274    95484   +13210     
- Misses        44911    46763    +1852     
- Partials       6048     6995     +947     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.93% <3.44%> (+2.22%) ⬆️
java-21 63.87% <3.44%> (+2.24%) ⬆️
skip-bytebuffers-false 63.95% <3.44%> (+2.20%) ⬆️
skip-bytebuffers-true 63.84% <3.44%> (+36.12%) ⬆️
temurin 63.97% <3.44%> (+2.22%) ⬆️
unittests 63.97% <3.44%> (+2.22%) ⬆️
unittests1 56.28% <3.51%> (+9.39%) ⬆️
unittests2 34.43% <1.47%> (+6.70%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ankitsultana ankitsultana changed the title [WIP] [timeseries] Part-4: Complete Support for Multi-Server Queries [timeseries] Part-4: Complete Support for Multi-Server Queries Dec 19, 2024
@ankitsultana ankitsultana marked this pull request as ready for review December 20, 2024 02:09
Copy link
Contributor

@tibrewalpratik17 tibrewalpratik17 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ankitsultana ankitsultana merged commit a6a3b40 into apache:master Dec 25, 2024
21 checks passed
StandardCharsets.UTF_8))
.build();
responseObserver.onNext(response);
for (int index = 0; index < fragmentOpChains.size(); index++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this be blocking till all the fragments are executed? What happens when query times out?

if (planNode instanceof LeafTimeSeriesPlanNode) {
throw new IllegalStateException("Found leaf time series plan node in broker");
} else if (planNode instanceof TimeSeriesExchangeNode) {
int numInputServers = numInputServersByExchangeNode.get(planNode.getId());
Copy link
Contributor

Choose a reason for hiding this comment

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

How will the input servers be computed?

}
}

TimeSeriesBlock submitAndGet(long requestId, TimeSeriesDispatchablePlan plan, long timeoutMs,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you share short blurb about this method?

* buffer the data sent by the sender. This is set large enough that we should never hit this for any practical
* use-case, while guarding us against bugs.
*/
public static final int MAX_QUEUE_CAPACITY = 4096;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a per server Queue ?

@@ -30,37 +35,57 @@
* engine integration.
*/
public class TimeSeriesDispatchObserver implements StreamObserver<Worker.TimeSeriesResponse> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Now as Broker is doing reduce work ? Can broker become bottleneck? Did you perform any analysis for broker in your cluster testing?

List<BaseTimeSeriesPlanNode> planNodes, Map<String, Map<String, List<String>>> leafIdToSegmentsByInstanceId) {
// TODO(timeseries): Handle this gracefully and return an empty block.
Preconditions.checkState(!serverInstances.isEmpty(), "No servers selected for the query");
if (serverInstances.size() == 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to differentiate between single server vs multi server? Shouldn't it be transparent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
timeseries-engine Tracking tag for generic time-series engine work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants