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

[metasrv] feature: exchange protocol version with client #5645

Merged
merged 10 commits into from
May 29, 2022
Merged
19 changes: 1 addition & 18 deletions .github/actions/test_compat/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,10 @@ runs:
- name: Setup Build Tool
uses: ./.github/actions/setup_build_tool

Copy link
Member

Choose a reason for hiding this comment

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

installing python libs is also not need, and already done by build tool image

- name: Install python dependences
shell: bash
run: |
pip3 install --user boto3 "moto[all]" yapf shfmt-py mysql-connector pymysql sqlalchemy clickhouse_driver

- uses: actions/download-artifact@v2
with:
name: ${{ inputs.profile }}-${{ github.sha }}-${{ inputs.target }}
path: ./current/

- uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'datafuselabs/databend'
# 2022-05-23
version: 'tags/v0.7.57-nightly'
file: 'databend-v0.7.57-nightly-x86_64-unknown-linux-gnu.tar.gz'

- shell: bash
run: |
mkdir ./old
tar -xf databend-v0.7.57-nightly-x86_64-unknown-linux-gnu.tar.gz -C ./old
path: ./bins/current/

- name: Test compatibility
shell: bash
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/developing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/check
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -45,6 +48,9 @@ jobs:
- aarch64-apple-darwin
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/build_debug
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -60,6 +66,9 @@ jobs:
- aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/build_debug
with:
target: ${{ matrix.target }}
Expand All @@ -69,6 +78,9 @@ jobs:
needs: check
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_unit
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -78,20 +90,29 @@ jobs:
needs: build_linux
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_metactl

test_compat:
runs-on: ubuntu-latest
needs: build_linux
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_compat

test_stateless_standalone_linux:
runs-on: ubuntu-latest
needs: build_linux
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_stateless_standalone_linux

# https://github.com/datafuselabs/databend/issues/5287
Expand All @@ -107,25 +128,37 @@ jobs:
needs: build_linux
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_stateless_cluster_linux

test_stateless_cluster_macos:
runs-on: macos-11
needs: build_macos
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_stateless_cluster_macos

test_stateful_standalone:
runs-on: ubuntu-latest
needs: build_linux
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_stateful_standalone

test_stateful_hive_standalone:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_stateful_hive_standalone
27 changes: 27 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/check
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -35,6 +38,9 @@ jobs:
- aarch64-apple-darwin
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/build_release
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -50,6 +56,9 @@ jobs:
- aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/build_release
with:
target: ${{ matrix.target }}
Expand All @@ -59,6 +68,9 @@ jobs:
needs: check
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_unit
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -68,6 +80,9 @@ jobs:
needs: build_linux
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_stateless_standalone_linux
with:
profile: release
Expand All @@ -86,6 +101,9 @@ jobs:
needs: build_linux
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_stateless_cluster_linux
with:
profile: release
Expand All @@ -95,6 +113,9 @@ jobs:
needs: build_macos
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_stateless_cluster_macos
with:
profile: release
Expand All @@ -104,6 +125,9 @@ jobs:
needs: build_linux
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/test_stateful_standalone
with:
profile: release
Expand All @@ -122,6 +146,9 @@ jobs:
- { target: x86_64-unknown-linux-gnu, platform: linux/amd64 }
steps:
- uses: actions/checkout@v2
with:
# fetch all tags, metasrv and metaclient need tag as its version.
fetch-depth: 0
- uses: ./.github/actions/publish_image
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
10 changes: 8 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions common/exception/src/exception_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ build_exceptions! {
MetaServiceError(2001),
InvalidConfig(2002),
MetaStorageError(2003),
InvalidArgument(2004),

TableVersionMismatched(2009),
OCCRetryFailure(2011),
Expand Down
5 changes: 5 additions & 0 deletions common/meta/grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ common-tracing = { path = "../../tracing" }

derive_more = "0.99.17"
futures = "0.3.21"
once_cell = "1.10.0"
prost = "=0.9.0"
rand = "0.8.5"
semver = "1.0.9"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79"
thiserror = "1.0.30"
tonic = { version = "=0.6.2", features = ["transport", "codegen", "prost", "tls-roots", "tls"] }

[dev-dependencies]

[build-dependencies]
common-building = { path = "../../building" }
16 changes: 16 additions & 0 deletions common/meta/grpc/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2021 Datafuse Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
fn main() {
common_building::setup();
}
Loading