Skip to content

Commit 49dfaf2

Browse files
committed
feat(flight): add New Flight inbound transport
1 parent 14bd3e8 commit 49dfaf2

52 files changed

Lines changed: 5947 additions & 1344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Test Query Flight Reconnect with TPC-H"
2+
description: "Verify New Flight reconnects after a random live link reset"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: ./.github/actions/setup_test
7+
with:
8+
artifacts: meta,query,sqllogictests
9+
10+
- uses: ./.github/actions/setup_minio
11+
12+
- name: Run TPC-H Flight reconnect test
13+
shell: bash
14+
run: ./scripts/ci/ci-run-query-flight-reconnect-tpch.sh

.github/workflows/reuse.linux.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,24 @@ jobs:
423423
with:
424424
name: test-stateful-cluster-linux
425425

426+
test_query_flight_reconnect_tpch:
427+
needs: [build, check]
428+
runs-on:
429+
- self-hosted
430+
- "${{ inputs.runner_arch }}"
431+
- Linux
432+
- 2c
433+
- "${{ inputs.runner_provider }}"
434+
steps:
435+
- uses: actions/checkout@v6
436+
- uses: ./.github/actions/test_query_flight_reconnect_tpch
437+
timeout-minutes: 20
438+
- name: Upload failure
439+
if: failure() || cancelled()
440+
uses: ./.github/actions/artifact_failure
441+
with:
442+
name: test-query-flight-reconnect-tpch
443+
426444
test_stateful_large_data:
427445
if: contains(github.event.pull_request.labels.*.name, 'ci-largedata')
428446
needs: [build, check]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2020-2026 The Databend Authors.
3+
# SPDX-License-Identifier: Apache-2.0.
4+
5+
set -euo pipefail
6+
7+
export STORAGE_TYPE=s3
8+
export STORAGE_S3_BUCKET=testbucket
9+
export STORAGE_S3_ROOT=admin
10+
export STORAGE_S3_ENDPOINT_URL=http://127.0.0.1:9900
11+
export STORAGE_S3_ACCESS_KEY_ID=minioadmin
12+
export STORAGE_S3_SECRET_ACCESS_KEY=minioadmin
13+
export STORAGE_ALLOW_INSECURE=true
14+
15+
readonly BUILD_PROFILE="${BUILD_PROFILE:-debug}"
16+
readonly SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
17+
readonly REPO_PATH="$(cd "$SCRIPT_PATH/../.." >/dev/null 2>&1 && pwd)"
18+
readonly TPCH_DATA_PATH=/tmp/tpch_1
19+
20+
python3 -m pip install --quiet mysql-connector-python requests
21+
sudo apt-get update -yq
22+
sudo apt-get install -yq iproute2 iptables lsof
23+
24+
cd "$REPO_PATH"
25+
./scripts/ci/deploy/databend-query-cluster-3-nodes.sh
26+
27+
rm -rf -- "$TPCH_DATA_PATH"
28+
bash tests/sqllogictests/scripts/prepare_tpch_data.sh tpch_test 1
29+
30+
python3 tests/query-flight-reconnect/test_tpch_reconnect.py \
31+
--sqllogictests "target/${BUILD_PROFILE}/databend-sqllogictests" \
32+
--tpch-suite tests/sqllogictests/suites/tpch/queries.test \
33+
--operation-log .databend/tpch-flight-reconnect/operations.log \
34+
--repo-dir "$REPO_PATH"

src/query/service/src/schedulers/fragments/query_fragment_actions.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ impl QueryFragmentsActions {
230230

231231
/// unique map(target, map(source, vec(fragment_id)))
232232
fn fragments_connections(&self, builder: &mut DataflowDiagramBuilder) -> Result<()> {
233+
let new_flight = self.ctx.get_settings().get_enable_experiment_new_flight()?;
234+
233235
for fragment_actions in &self.fragments_actions {
234236
if let Some(exchange) = &fragment_actions.data_exchange {
235237
let destinations = exchange.get_destinations();
@@ -249,7 +251,11 @@ impl QueryFragmentsActions {
249251
)?;
250252
} else {
251253
for channel in exchange.get_channels(destination) {
252-
builder.add_data_edge(&source, destination, &channel)?;
254+
if new_flight && matches!(exchange, DataExchange::Merge(_)) {
255+
builder.add_merge_edge(&source, destination, &channel)?;
256+
} else {
257+
builder.add_data_edge(&source, destination, &channel)?;
258+
}
253259
}
254260
}
255261
}

0 commit comments

Comments
 (0)