From 30c1ed537f9e123a0d6fbd7256d0e336b520f624 Mon Sep 17 00:00:00 2001 From: yfeng Date: Tue, 20 Sep 2022 14:29:16 +0800 Subject: [PATCH] Fixed some issues with foundationdb meta engine compilation --- .github/actions/clickhouse/action.yml | 6 --- .github/actions/fio/action.yml | 6 --- .github/actions/gateway/action.yml | 5 --- .github/actions/load/action.yml | 6 --- .github/actions/rmr/action.yml | 5 --- .github/actions/sysbenchrndrw/action.yml | 5 --- .github/actions/sysbenchseqrw/action.yml | 6 --- .github/actions/vdbench/action.yml | 6 --- .github/actions/version-compatible/action.yml | 6 --- .github/workflows/aitests.yml | 5 --- .github/workflows/aitests_limitcache.yml | 5 --- .github/workflows/config.yml | 5 --- .github/workflows/elastictest.yml | 5 --- .github/workflows/encoding_mysql.yml | 5 --- .github/workflows/format.yml | 5 --- .github/workflows/gateway.yml | 5 --- .github/workflows/gc.yml | 5 --- .github/workflows/integrationtests.yml | 5 --- .github/workflows/ltpfs.yml | 5 --- .github/workflows/ltpsyscallshead.yml | 5 --- .github/workflows/ltpsyscallsmiddle.yml | 5 --- .github/workflows/ltpsyscallstail.yml | 5 --- .github/workflows/mdtest.yml | 5 --- .github/workflows/mongodb_mmap.yml | 5 --- .github/workflows/mysqltest_bigtable.yml | 5 --- .github/workflows/mysqltest_smalltable.yml | 5 --- .github/workflows/pjdfstest.yml | 5 --- .github/workflows/redis_compile.yml | 5 --- .github/workflows/sdktest.yml | 5 --- .github/workflows/sync.yml | 10 ----- .github/workflows/tpcds.yml | 5 --- .github/workflows/unittests.yml | 12 +++--- .github/workflows/verify.yml | 19 ++++----- Makefile | 7 +++- pkg/meta/benchmarks_test.go | 3 +- pkg/meta/tkv_fdb.go | 4 +- pkg/meta/tkv_fdb_test.go | 41 +++++++++++++++++++ pkg/meta/tkv_mem.go | 3 -- pkg/meta/tkv_test.go | 8 ---- 39 files changed, 63 insertions(+), 200 deletions(-) create mode 100644 pkg/meta/tkv_fdb_test.go diff --git a/.github/actions/clickhouse/action.yml b/.github/actions/clickhouse/action.yml index f0708ad8a25a0..f0f37dc2e56b1 100644 --- a/.github/actions/clickhouse/action.yml +++ b/.github/actions/clickhouse/action.yml @@ -26,12 +26,6 @@ runs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - shell: bash - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target shell: bash run: make juicefs diff --git a/.github/actions/fio/action.yml b/.github/actions/fio/action.yml index f8ba5ff59e698..fead90b3f5c94 100644 --- a/.github/actions/fio/action.yml +++ b/.github/actions/fio/action.yml @@ -78,12 +78,6 @@ runs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - shell: bash - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/actions/gateway/action.yml b/.github/actions/gateway/action.yml index 7e4d93b07f610..e7d2d2b8e9e91 100644 --- a/.github/actions/gateway/action.yml +++ b/.github/actions/gateway/action.yml @@ -51,11 +51,6 @@ runs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - shell: bash - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - name: Build linux target run: | diff --git a/.github/actions/load/action.yml b/.github/actions/load/action.yml index 3b4f8f7a0d886..5bd93178abf58 100644 --- a/.github/actions/load/action.yml +++ b/.github/actions/load/action.yml @@ -27,12 +27,6 @@ runs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - shell: bash - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/actions/rmr/action.yml b/.github/actions/rmr/action.yml index 19bd5fabdeea5..233554cf32503 100644 --- a/.github/actions/rmr/action.yml +++ b/.github/actions/rmr/action.yml @@ -30,11 +30,6 @@ runs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - shell: bash - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - name: Build linux target run: | diff --git a/.github/actions/sysbenchrndrw/action.yml b/.github/actions/sysbenchrndrw/action.yml index effc84593c9c8..c811cae555e8b 100644 --- a/.github/actions/sysbenchrndrw/action.yml +++ b/.github/actions/sysbenchrndrw/action.yml @@ -25,11 +25,6 @@ runs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - shell: bash - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - name: Build linux target shell: bash diff --git a/.github/actions/sysbenchseqrw/action.yml b/.github/actions/sysbenchseqrw/action.yml index 2dd1170e64515..8e149fba2bc89 100644 --- a/.github/actions/sysbenchseqrw/action.yml +++ b/.github/actions/sysbenchseqrw/action.yml @@ -26,12 +26,6 @@ runs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - shell: bash - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target shell: bash run: make juicefs diff --git a/.github/actions/vdbench/action.yml b/.github/actions/vdbench/action.yml index d318f8ba58ba4..1a5eef345727a 100644 --- a/.github/actions/vdbench/action.yml +++ b/.github/actions/vdbench/action.yml @@ -74,12 +74,6 @@ runs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - shell: bash - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target shell: bash run: | diff --git a/.github/actions/version-compatible/action.yml b/.github/actions/version-compatible/action.yml index fa1b88aeed78d..03c89c49ff9be 100644 --- a/.github/actions/version-compatible/action.yml +++ b/.github/actions/version-compatible/action.yml @@ -41,12 +41,6 @@ runs: with: go-version: '1.18.x' - - name: Install Fdb C Lib - shell: bash - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/aitests.yml b/.github/workflows/aitests.yml index 2eb6a252a8da5..e4e06661d7a1f 100644 --- a/.github/workflows/aitests.yml +++ b/.github/workflows/aitests.yml @@ -43,11 +43,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/aitests_limitcache.yml b/.github/workflows/aitests_limitcache.yml index 6d917612baaad..cc47af3bb33cd 100644 --- a/.github/workflows/aitests_limitcache.yml +++ b/.github/workflows/aitests_limitcache.yml @@ -43,11 +43,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 2d874b2ac7c43..cb0df1888e76b 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -52,11 +52,6 @@ jobs: uses: actions/setup-go@v2 with: go-version: '1.18.x' - - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - uses: actions/cache@v3 with: diff --git a/.github/workflows/elastictest.yml b/.github/workflows/elastictest.yml index 4465347e16450..47f4e5b95c392 100644 --- a/.github/workflows/elastictest.yml +++ b/.github/workflows/elastictest.yml @@ -43,11 +43,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: make juicefs diff --git a/.github/workflows/encoding_mysql.yml b/.github/workflows/encoding_mysql.yml index 13f0755e73d43..f722237c333e4 100644 --- a/.github/workflows/encoding_mysql.yml +++ b/.github/workflows/encoding_mysql.yml @@ -49,11 +49,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | url=https://github.com/juicedata/juicefs/releases/download/v1.0.0-beta2/juicefs-1.0.0-beta2-linux-amd64.tar.gz diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 6f7d59ac714c1..057e158d82301 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -52,11 +52,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: make juicefs diff --git a/.github/workflows/gateway.yml b/.github/workflows/gateway.yml index 7d0a781eb190f..8b9af4546ed04 100644 --- a/.github/workflows/gateway.yml +++ b/.github/workflows/gateway.yml @@ -536,11 +536,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/gc.yml b/.github/workflows/gc.yml index 2d3f5f703683a..d4f680e0b11b9 100644 --- a/.github/workflows/gc.yml +++ b/.github/workflows/gc.yml @@ -50,11 +50,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: make juicefs diff --git a/.github/workflows/integrationtests.yml b/.github/workflows/integrationtests.yml index 7d6a6747a086a..13eabd7943118 100644 --- a/.github/workflows/integrationtests.yml +++ b/.github/workflows/integrationtests.yml @@ -45,11 +45,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/ltpfs.yml b/.github/workflows/ltpfs.yml index b150a5ee9d9ce..c7dd5162aa83b 100644 --- a/.github/workflows/ltpfs.yml +++ b/.github/workflows/ltpfs.yml @@ -42,11 +42,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/ltpsyscallshead.yml b/.github/workflows/ltpsyscallshead.yml index bdd85568f738e..5a3565788420a 100644 --- a/.github/workflows/ltpsyscallshead.yml +++ b/.github/workflows/ltpsyscallshead.yml @@ -42,11 +42,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/ltpsyscallsmiddle.yml b/.github/workflows/ltpsyscallsmiddle.yml index eb7d9a3c42adb..63a883d0f4470 100644 --- a/.github/workflows/ltpsyscallsmiddle.yml +++ b/.github/workflows/ltpsyscallsmiddle.yml @@ -42,11 +42,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/ltpsyscallstail.yml b/.github/workflows/ltpsyscallstail.yml index 34cc9a032bfe0..aa657a5a19d78 100644 --- a/.github/workflows/ltpsyscallstail.yml +++ b/.github/workflows/ltpsyscallstail.yml @@ -42,11 +42,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/mdtest.yml b/.github/workflows/mdtest.yml index 52031ec6818e5..677d38d0867c3 100644 --- a/.github/workflows/mdtest.yml +++ b/.github/workflows/mdtest.yml @@ -49,11 +49,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | export GOPATH=/usr/local/go diff --git a/.github/workflows/mongodb_mmap.yml b/.github/workflows/mongodb_mmap.yml index b3e649813b608..9a18826f8f3a6 100644 --- a/.github/workflows/mongodb_mmap.yml +++ b/.github/workflows/mongodb_mmap.yml @@ -46,11 +46,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/mysqltest_bigtable.yml b/.github/workflows/mysqltest_bigtable.yml index c42f5e057129b..40802f8d85c3a 100644 --- a/.github/workflows/mysqltest_bigtable.yml +++ b/.github/workflows/mysqltest_bigtable.yml @@ -42,11 +42,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: make juicefs diff --git a/.github/workflows/mysqltest_smalltable.yml b/.github/workflows/mysqltest_smalltable.yml index 26db0a4924040..1b8da2a57897b 100644 --- a/.github/workflows/mysqltest_smalltable.yml +++ b/.github/workflows/mysqltest_smalltable.yml @@ -42,11 +42,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: make juicefs diff --git a/.github/workflows/pjdfstest.yml b/.github/workflows/pjdfstest.yml index 9e9f42279dc6e..e3a34df7b8b96 100644 --- a/.github/workflows/pjdfstest.yml +++ b/.github/workflows/pjdfstest.yml @@ -49,11 +49,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: make juicefs diff --git a/.github/workflows/redis_compile.yml b/.github/workflows/redis_compile.yml index 1b727dad5daa9..270a07cf5a09c 100644 --- a/.github/workflows/redis_compile.yml +++ b/.github/workflows/redis_compile.yml @@ -39,11 +39,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: make juicefs diff --git a/.github/workflows/sdktest.yml b/.github/workflows/sdktest.yml index b390460ff3fa9..0e72381349d29 100644 --- a/.github/workflows/sdktest.yml +++ b/.github/workflows/sdktest.yml @@ -47,11 +47,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: | make juicefs diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 8e93bb5decc3f..74d84567c1a1f 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -50,11 +50,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: make juicefs @@ -184,11 +179,6 @@ jobs: uses: actions/setup-go@v2 with: go-version: '1.18.x' - - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - uses: actions/cache@v3 with: diff --git a/.github/workflows/tpcds.yml b/.github/workflows/tpcds.yml index c580bcfdfbde1..d0259d4e12703 100644 --- a/.github/workflows/tpcds.yml +++ b/.github/workflows/tpcds.yml @@ -60,11 +60,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: Build linux target run: make juicefs diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index a61764c20329a..c7bbc7582c34d 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -66,11 +66,6 @@ jobs: sudo apt install -y attr sudo mkdir -p /home/travis/.m2/ - - name: Install FoundationDB - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-server_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb foundationdb-server_6.3.23-1_amd64.deb - name: Download Zip run: | @@ -78,6 +73,8 @@ jobs: wget -O /home/travis/.m2/rclone-v1.57.0-linux-amd64.zip --no-check-certificate https://downloads.rclone.org/v1.57.0/rclone-v1.57.0-linux-amd64.zip wget -O /home/travis/.m2/litmus-0.13.tar.gz http://www.webdav.org/neon/litmus/litmus-0.13.tar.gz wget -O /home/travis/.m2/etcd-v3.5.2-linux-amd64.tar.gz https://github.com/etcd-io/etcd/releases/download/v3.5.2/etcd-v3.5.2-linux-amd64.tar.gz + wget -O /home/travis/.m2/foundationdb-clients_6.3.23-1_amd64.deb https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb + wget -O /home/travis/.m2/foundationdb-server_6.3.23-1_amd64.deb https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-server_6.3.23-1_amd64.deb unzip /home/travis/.m2/rclone-v1.57.0-linux-amd64.zip -d /home/travis/.m2/ tar -zxvf /home/travis/.m2/litmus-0.13.tar.gz -C /home/travis/.m2/ cd /home/travis/.m2/litmus-0.13/ && ./configure && make && cd - @@ -103,6 +100,7 @@ jobs: source /home/runner/.bash_profile tiup -v nohup tiup playground --mode tikv-slim >> output.log 2>&1 & + sudo dpkg -i /home/travis/.m2/foundationdb-clients_6.3.23-1_amd64.deb /home/travis/.m2/foundationdb-server_6.3.23-1_amd64.deb docker run -d -p 9000:9000 -p 9001:9001 -e "MINIO_ROOT_USER=testUser" -e "MINIO_ROOT_PASSWORD=testUserPassword" quay.io/minio/minio:RELEASE.2022-01-25T19-56-04Z server /data --console-address ":9001" go install github.com/minio/mc@RELEASE.2022-01-07T06-01-38Z && mc config host add local http://127.0.0.1:9000 testUser testUserPassword && mc mb local/testbucket nohup /home/travis/.m2/rclone-v1.57.0-linux-amd64/rclone serve webdav local --addr 127.0.0.1:9007 >> rclone.log 2>&1 & @@ -114,7 +112,7 @@ jobs: chmod +x travis-setup-hdfs.sh sudo lsof -i :8020 || true ./travis-setup-hdfs.sh - for i in {2222,3306,5432,8020,9000,9007} ; do echo "lsof port:"$i;sudo lsof -i :$i;if [ $? != 0 ];then sleep 5; else continue; fi;sudo lsof -i :$i; if [ $? != 0 ];then echo "service not ready, port:"$i; exit 1;fi; done + for i in {2222,3306,5432,8020,9000,9007,4500} ; do echo "lsof port:"$i;sudo lsof -i :$i;if [ $? != 0 ];then sleep 5; else continue; fi;sudo lsof -i :$i; if [ $? != 0 ];then echo "service not ready, port:"$i; exit 1;fi; done sudo lsof -i :2379;if [ $? != 0 ];then echo "tikv is not ready";cat output.log;exit 1; fi @@ -125,6 +123,8 @@ jobs: make test cat cov1.out >> coverage.txt cat cov2.out >> coverage.txt + make test.fdb + cat cov3.out >> coverage.txt sudo ./juicefs umount /jfs || sudo lsof /jfs && sudo ./juicefs umount --force /jfs || true sudo ./juicefs gc localhost sudo ./juicefs fsck localhost diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index a50c0dec749b5..fa3b1bf5707e2 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -27,12 +27,6 @@ jobs: with: go-version: '1.17.x' - uses: actions/checkout@v2 - - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: @@ -53,11 +47,6 @@ jobs: run: | sudo apt-get update sudo apt-get install g++-multilib gcc-mingw-w64 - - - name: Install Fdb C Lib - run: | - wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb - uses: actions/cache@v3 with: @@ -84,4 +73,10 @@ jobs: run: | sudo apt-get update sudo apt-get install librados-dev - GOPATH=$HOME/go make juicefs.ceph \ No newline at end of file + GOPATH=$HOME/go make juicefs.ceph + + - name: build fdb + run: | + wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb + sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb + GOPATH=$HOME/go make juicefs.fdb \ No newline at end of file diff --git a/Makefile b/Makefile index b6ac3f948c311..c259dc6ea0c18 100644 --- a/Makefile +++ b/Makefile @@ -24,12 +24,14 @@ juicefs: Makefile cmd/*.go pkg/*/*.go go.* go build -ldflags="$(LDFLAGS)" -o juicefs . juicefs.lite: Makefile cmd/*.go pkg/*/*.go - go build -tags nogateway,nowebdav,nocos,nobos,nohdfs,noibmcos,noobs,nooss,noqingstor,noscs,nosftp,noswift,noupyun,noazure,nogs,noufile,nob2,nosqlite,nomysql,nopg,notikv,nobadger,noetcd,nofdb \ + go build -tags nogateway,nowebdav,nocos,nobos,nohdfs,noibmcos,noobs,nooss,noqingstor,noscs,nosftp,noswift,noupyun,noazure,nogs,noufile,nob2,nosqlite,nomysql,nopg,notikv,nobadger,noetcd \ -ldflags="$(LDFLAGS)" -o juicefs.lite . juicefs.ceph: Makefile cmd/*.go pkg/*/*.go go build -tags ceph -ldflags="$(LDFLAGS)" -o juicefs.ceph . +juicefs.fdb: Makefile cmd/*.go pkg/*/*.go + go build -tags fdb -ldflags="$(LDFLAGS)" -o juicefs.fdb . # This is the script for compiling the Linux version on the MacOS platform. # Please execute the `brew install FiloSottile/musl-cross/musl-cross` command before using it. @@ -71,3 +73,6 @@ release: test: go test -v -cover -count=1 -timeout=8m ./pkg/... -coverprofile=cov1.out sudo JFS_GC_SKIPPEDTIME=1 MINIO_ACCESS_KEY=testUser MINIO_SECRET_KEY=testUserPassword go test -v -count=1 -cover -timeout=8m ./cmd/... -coverprofile=cov2.out -coverpkg=./pkg/...,./cmd/... + +test.fdb: + go test -v -cover -count=1 -timeout=8m ./pkg/meta/ -tags fdb -run=TestFdb -coverprofile=cov3.out \ No newline at end of file diff --git a/pkg/meta/benchmarks_test.go b/pkg/meta/benchmarks_test.go index 7833e349f6667..c88c757d52006 100644 --- a/pkg/meta/benchmarks_test.go +++ b/pkg/meta/benchmarks_test.go @@ -30,8 +30,7 @@ const ( sqlAddr = "sqlite3://juicefs.db" // sqlAddr = "mysql://root:@/juicefs" // MySQL // sqlAddr = "mysql://root:@tcp(127.0.0.1:4000)/juicefs" // TiDB - tkvAddr = "fdb:///etc/foundationdb/fdb.cluster:fdb_test" - // tkvAddr = "badger://test_db" + tkvAddr = "badger://test_db" // tkvAddr = "tikv://127.0.0.1:2379/juicefs" ) diff --git a/pkg/meta/tkv_fdb.go b/pkg/meta/tkv_fdb.go index 470f3b6126751..79a8f645a4b2a 100644 --- a/pkg/meta/tkv_fdb.go +++ b/pkg/meta/tkv_fdb.go @@ -1,5 +1,5 @@ -//go:build !nofdb -// +build !nofdb +//go:build fdb +// +build fdb /* * JuiceFS, Copyright 2022 Juicedata, Inc. diff --git a/pkg/meta/tkv_fdb_test.go b/pkg/meta/tkv_fdb_test.go new file mode 100644 index 0000000000000..5bd6139a20cd3 --- /dev/null +++ b/pkg/meta/tkv_fdb_test.go @@ -0,0 +1,41 @@ +//go:build fdb +// +build fdb + +/* + * JuiceFS, Copyright 2022 Juicedata, Inc. + * + * 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. + */ + +//nolint:errcheck +package meta + +import ( + "testing" +) + +func TestFdbClient(t *testing.T) { + m, err := newKVMeta("fdb", "/etc/foundationdb/fdb.cluster:fdb-test2", &Config{}) + if err != nil { + t.Fatalf("create meta: %s", err) + } + testMeta(t, m) +} + +func TestFdb(t *testing.T) { + c, err := newFdbClient("/etc/foundationdb/fdb.cluster:fdb-test1") + if err != nil { + t.Fatal(err) + } + testTKV(t, c) +} diff --git a/pkg/meta/tkv_mem.go b/pkg/meta/tkv_mem.go index cb7299de06aed..869554b3402a1 100644 --- a/pkg/meta/tkv_mem.go +++ b/pkg/meta/tkv_mem.go @@ -1,6 +1,3 @@ -//go:build !fdb -// +build !fdb - /* * JuiceFS, Copyright 2021 Juicedata, Inc. * diff --git a/pkg/meta/tkv_test.go b/pkg/meta/tkv_test.go index d075afbf327db..6d18a84452442 100644 --- a/pkg/meta/tkv_test.go +++ b/pkg/meta/tkv_test.go @@ -56,14 +56,6 @@ func TestEtcdClient(t *testing.T) { testMeta(t, m) } -func TestFdbClient(t *testing.T) { - m, err := newKVMeta("fdb", "/etc/foundationdb/fdb.cluster:fdb_test", &Config{}) - if err != nil { - t.Fatalf("create meta: %s", err) - } - testMeta(t, m) -} - func testTKV(t *testing.T, c tkvClient) { txn := func(f func(kt kvTxn)) { if err := c.txn(func(kt kvTxn) error {