diff --git a/.github/workflows/containerfiles/Dockerfile.percona-debian-build b/.github/workflows/containerfiles/Dockerfile.percona-debian-build index 9c5cbb60..a8b6c4f1 100644 --- a/.github/workflows/containerfiles/Dockerfile.percona-debian-build +++ b/.github/workflows/containerfiles/Dockerfile.percona-debian-build @@ -1,4 +1,4 @@ -FROM docker.io/ubuntu:20.04 AS builder +FROM docker.io/ubuntu:20.04 RUN apt-get update \ && \ @@ -23,44 +23,6 @@ RUN apt-get update \ libgflags-dev \ bison \ wget \ - && apt-get clean - -ENV WORK_PATH=/percona/work -ENV INSTALL_PATH=/percona/dest -RUN mkdir -p $WORK_PATH -RUN mkdir -p $INSTALL_PATH - -WORKDIR $WORK_PATH - -ARG PERCONA_SERVER_BASE -ARG ZENFS_REPO -ARG ZENFS_BRANCH -RUN mkdir -p /tmp/BUILD_PS - -# Following the percona blog post to build the debian packages: https://www.percona.com/blog/2021/03/10/how-to-build-percona-server-for-mysql-from-sources/ - -RUN wget https://raw.githubusercontent.com/percona/percona-server/8.0/build-ps/percona-server-8.0_builder.sh -RUN sed -i 's=#!/bin/sh=#!/bin/bash=' percona-server-8.0_builder.sh -RUN chmod +x percona-server-8.0_builder.sh -ENV DEB_RELEASE_EXTRA=experimentalZenFS -RUN ./percona-server-8.0_builder.sh --builddir=/tmp/BUILD_PS --install_deps=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA} -# PERCONA_SERVER_BASE must have an origin in a Percona-Server-* tag. -RUN ./percona-server-8.0_builder.sh --builddir=/tmp/BUILD_PS --get_sources=1 --branch=${PERCONA_SERVER_BASE} --with_zenfs=1 --zenfs_branch=${ZENFS_BRANCH} --zenfs_repo=${ZENFS_REPO} --deb_release=${DEB_RELEASE_EXTRA} -RUN ./percona-server-8.0_builder.sh --builddir=/tmp/BUILD_PS --build_source_deb=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA} -RUN ./percona-server-8.0_builder.sh --builddir=/tmp/BUILD_PS --build_deb=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA} - -ENV PATH="$INSTALL_PATH/bin:$PATH" -ENV LD_LIBRARY_PATH="$INSTALL_PATH/lib" - - -FROM docker.io/ubuntu:20.04 - -ENV DEBIAN_FRONTEND=noninteractive -ENV DEBCONF_NONINTERACTIVE_SEEN=true - -RUN apt-get update \ - && \ - apt-get install --yes --quiet=2 \ zlib1g-dev \ valgrind \ libssl1.1 \ @@ -85,32 +47,50 @@ RUN apt-get update \ python2 \ build-essential \ python-dev \ - wget \ sudo \ automake \ libtool \ pkg-config \ libaio-dev \ - git \ && apt-get clean -RUN wget https://repo.percona.com/apt/pool/main/j/jemalloc/libjemalloc1_3.6.0-2.focal_amd64.deb -RUN dpkg -i libjemalloc1_3.6.0-2.focal_amd64.deb - -ENV WORK_PATH=/percona/work/ +ENV WORK_PATH=/percona/work ENV INSTALL_PATH=/percona/dest -ENV ZENFS_SOURCE_PATH=$INSTALL_PATH/zenfs +ENV BUILD_PATH=/tmp/BUILD_PS RUN mkdir -p $WORK_PATH RUN mkdir -p $INSTALL_PATH -RUN mkdir -p $ZENFS_SOURCE_PATH +RUN mkdir -p $BUILD_PATH WORKDIR $WORK_PATH -COPY --from=builder /tmp/BUILD_PS/*.deb $WORK_PATH -COPY --from=builder /tmp/BUILD_PS/percona-server-*/storage/rocksdb/rocksdb_plugins/zenfs $ZENFS_SOURCE_PATH +ARG PERCONA_SERVER_BASE +ARG ZENFS_REPO +ARG ZENFS_BRANCH +# Following the percona blog post to build the debian packages: https://www.percona.com/blog/2021/03/10/how-to-build-percona-server-for-mysql-from-sources/ + +RUN wget https://raw.githubusercontent.com/percona/percona-server/8.0/build-ps/percona-server-8.0_builder.sh +RUN sed -i 's=#!/bin/sh=#!/bin/bash=' percona-server-8.0_builder.sh +RUN chmod +x percona-server-8.0_builder.sh +ENV DEB_RELEASE_EXTRA=experimentalZenFS +RUN ./percona-server-8.0_builder.sh --builddir=${BUILD_PATH} --install_deps=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA} +# PERCONA_SERVER_BASE must have an origin in a Percona-Server-* tag. +RUN ./percona-server-8.0_builder.sh --builddir=${BUILD_PATH} --get_sources=1 --branch=${PERCONA_SERVER_BASE} --with_zenfs=1 --zenfs_branch=${ZENFS_BRANCH} --zenfs_repo=${ZENFS_REPO} --deb_release=${DEB_RELEASE_EXTRA} +RUN ./percona-server-8.0_builder.sh --builddir=${BUILD_PATH} --build_source_deb=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA} +RUN ./percona-server-8.0_builder.sh --builddir=${BUILD_PATH} --build_deb=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA} + +ENV PATH="$INSTALL_PATH/bin:$PATH" +ENV LD_LIBRARY_PATH="$INSTALL_PATH/lib" + +RUN wget https://repo.percona.com/apt/pool/main/j/jemalloc/libjemalloc1_3.6.0-2.focal_amd64.deb +RUN dpkg -i libjemalloc1_3.6.0-2.focal_amd64.deb + +WORKDIR $BUILD_PATH RUN dpkg -i *.deb +RUN find ${BUILD_PATH} -type f -name zenfs | xargs -I {} cp {} ${INSTALL_PATH} +RUN find ${BUILD_PATH} -type f -name mysql-test-run.pl | grep builddir | xargs -I {} ln -s {} ${INSTALL_PATH}/mtr + RUN apt-get update \ && \ apt-get install --yes --quiet=2 \ @@ -126,6 +106,3 @@ RUN git clone https://github.com/akopytov/sysbench.git \ && make -j \ && make install \ && cd - - -ENV PATH="$INSTALL_PATH/bin:$PATH" -ENV LD_LIBRARY_PATH="$INSTALL_PATH/lib" diff --git a/.github/workflows/containerfiles/Dockerfile.percona-server b/.github/workflows/containerfiles/Dockerfile.percona-server new file mode 100644 index 00000000..e73ebd60 --- /dev/null +++ b/.github/workflows/containerfiles/Dockerfile.percona-server @@ -0,0 +1,99 @@ +FROM docker.io/ubuntu:22.04 AS builder + +RUN apt-get update \ + && \ + DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + apt-get install --yes --quiet=2 \ + build-essential \ + git \ + pkg-config \ + cmake \ + autoconf \ + autoconf-archive \ + automake \ + libtool \ + zlib1g-dev \ + valgrind \ + libssl-dev \ + libncurses-dev \ + libldap2-dev \ + libreadline-dev \ + libcurl4-openssl-dev \ + libgflags-dev \ + bison \ + && apt-get clean + +ENV WORK_PATH=/percona/work +ENV INSTALL_PATH=/percona/dest +RUN mkdir -p $WORK_PATH +RUN mkdir -p $INSTALL_PATH + +WORKDIR $WORK_PATH + +ARG LIBZBD_GIT_CHECKOUT +RUN git clone --quiet --single-branch --branch master -n --quiet http://github.com/westerndigitalcorporation/libzbd.git \ + && cd libzbd \ + && git checkout $LIBZBD_GIT_CHECKOUT +RUN cd libzbd && sh autogen.sh && ./configure --prefix=${INSTALL_PATH} && make install + +COPY percona-server percona-server +RUN PKG_CONFIG_PATH=$INSTALL_PATH/lib/pkgconfig \ + cmake ./percona-server \ + -DUSE_VALGRIND=ON \ + -DCMAKE_C_FLAGS="-mno-avx512f" \ + -DCMAKE_CXX_FLAGS="-mno-avx512f" \ + -DWITH_AUTHENTICATION_KERBEROS=OFF \ + -DWITH_AUTHENTICATION_LDAP=OFF \ + -DWITH_KERBEROS=none \ + -DWITH_ROCKSDB=ON \ + -DROCKSDB_PLUGINS=zenfs \ + -DWITH_ZENFS_UTILITY=ON \ + -DDOWNLOAD_BOOST=1\ + -DWITH_BOOST=$WORK_PATH/boost \ + -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \ + && make -j$(nproc) \ + && make install + +FROM docker.io/ubuntu:22.04 +RUN apt-get update \ + && \ + DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + apt-get install --yes --quiet=2 \ + build-essential \ + zlib1g-dev \ + valgrind \ + libssl3 \ + libssl-dev \ + libncurses6 \ + libncursesw6 \ + libldap2-dev \ + libreadline8 \ + libcurl4 \ + libgflags2.2 \ + libmysqlclient-dev \ + perl \ + python3-dev \ + python3-pip \ + python-is-python3 \ + pkg-config \ + && apt-get clean + +ENV WORK_PATH=/percona/work +ENV INSTALL_PATH=/percona/dest +RUN mkdir -p $WORK_PATH +RUN mkdir -p $INSTALL_PATH + +WORKDIR $WORK_PATH + +COPY --from=builder $INSTALL_PATH $INSTALL_PATH +# Changeing access permissions of directories in $INSTALL_PATH is needed for the mysql-test-run.pl (see line 2415 and 3053) +RUN find $INSTALL_PATH -type d -exec chmod 777 {} + +RUN adduser --quiet --disabled-password mysql +RUN apt-get update && apt-get install -y --quiet sudo + +ENV PATH="$INSTALL_PATH/bin:$PATH" +ENV LD_LIBRARY_PATH="$INSTALL_PATH/lib" + +RUN export MYSQLCLIENT_CFLAGS=$(pkg-config mysqlclient --cflags); export MYSQLCLIENT_LDFLAGS=$(pkg-config mysqlclient --libs); pip install mysqlclient; diff --git a/.github/workflows/mtr-test.yaml b/.github/workflows/mtr-test.yaml index a91a1002..3985ae1d 100644 --- a/.github/workflows/mtr-test.yaml +++ b/.github/workflows/mtr-test.yaml @@ -1,3 +1,4 @@ +#TODO: make sure to run on 1TB zns drives -> look at disk-select option on: workflow_dispatch: schedule: @@ -5,58 +6,111 @@ on: name: MTR Tests jobs: mtr-tests: - runs-on: self-hosted + runs-on: nvme-zns timeout-minutes: 1440 steps: - name: Clean run: rm -rf ${GITHUB_WORKSPACE}/* - - name: Checkout build scripts - run: git clone ~/harness.git - - name: Checkout percona-server - uses: actions/checkout@v2 - with: - repository: percona/percona-server - ref: release-8.0.30-22 - path: harness/percona-context/percona-server - submodules: true - - name: Remove default zenfs - run: rm -r harness/percona-context/percona-server/storage/rocksdb/rocksdb_plugins/zenfs - - name: Checkout recent zenfs - uses: actions/checkout@v2 + + - name: Prepare zoned block devices + run: | + for i in $(seq 0 3) + do + DEV="ZBD$i" + if [ ! -b "/dev/${!DEV}" ] + then + echo "/dev/${!DEV} is not available for zenfs-mtr!" + exit 1 + fi + echo deadline > /sys/block/${!DEV}/queue/scheduler + done + + - name: Checkout zenfs + uses: actions/checkout@v4 with: fetch-depth: 0 - path: harness/percona-context/percona-server/storage/rocksdb/rocksdb_plugins/zenfs + path: zenfs + + - name: Create build directory + run: | + mkdir -p percona-build-dir + + - name: Create result directory + run: | + mkdir -p percona-results + + - name: Build docker image + run: | + podman build --cgroup-manager cgroupfs \ + -t percona-debian \ + -f zenfs/.github/workflows/containerfiles/Dockerfile.percona-debian-build \ + --build-arg PERCONA_SERVER_BASE=Percona-Server-8.0.34-26 \ + --build-arg ZENFS_BRANCH=${GITHUB_SHA} \ + --build-arg ZENFS_REPO=https://github.com/${GITHUB_REPOSITORY}.git \ + . + - name: Run MTR RocksDB test id: mtrTest1 - run: cd harness && st --silent -o logs/makeMtrRocksdb -- disk-select --disk 1TB -- make NO_VAGRANT=1 RUN_ARGS="mtrRocksdbTest" results/zenfs-mtr.xml + run: | + podman run --rm -i --device /dev/$ZBD0 \ + --volume ${GITHUB_WORKSPACE}/zenfs/.github/workflows/mtr:/scripts \ + --workdir /scripts \ + --env DEVICE0="$ZBD0" \ + percona-debian \ + bash wrapper.sh bash mtr-rocksdb-test.sh continue-on-error: true - - name: Collect MTR RocksDB results - run: cd harness && make NO_VAGRANT=1 upload - if: always() + - name: Run MTR RocksDB replication test id: mtrTest2 - run: cd harness && st --silent -o logs/makeMtrRocksdbReplication -- disk-select --disk 1TB --disk 1TB -- make NO_VAGRANT=1 RUN_ARGS="mtrRocksdbReplicationTest" results/zenfs-mtr.xml + run: | + podman run --rm -i --device /dev/$ZBD0 \ + --device /dev/$ZBD1 \ + --volume ${GITHUB_WORKSPACE}/zenfs/.github/workflows/mtr:/scripts \ + --workdir /scripts \ + --env DEVICE0="$ZBD0" \ + --env DEVICE1="$ZBD1" \ + percona-debian \ + bash wrapper.sh bash mtr-rocksdb-replication-test.sh continue-on-error: true - - name: Collect MTR RocksDB replication results - run: cd harness && make NO_VAGRANT=1 upload - if: always() + - name: Run MTR RocksDB parallel test id: mtrTest3 - run: cd harness && st --silent -o logs/makeMtrRocksdbParallel -- disk-select --disk 1TB --disk 1TB --disk 1TB --disk 1TB -- make NO_VAGRANT=1 RUN_ARGS="mtrRocksdbParallelTest" results/zenfs-mtr.xml + run: | + podman run --rm -i --device /dev/$ZBD0 \ + --device /dev/$ZBD1 \ + --device /dev/$ZBD2 \ + --device /dev/$ZBD3 \ + --volume ${GITHUB_WORKSPACE}/zenfs/.github/workflows/mtr:/scripts \ + --workdir /scripts \ + --env DEVICE0="$ZBD0" \ + --env DEVICE1="$ZBD1" \ + --env DEVICE2="$ZBD2" \ + --env DEVICE3="$ZBD3" \ + percona-debian \ + bash wrapper.sh bash mtr-rocksdb-parallel-test.sh continue-on-error: true - - name: Collect MTR RocksDB parallel results - run: cd harness && make NO_VAGRANT=1 upload - if: always() + - name: Run MTR RocksDB parallel replication test id: mtrTest4 - run: cd harness && st --silent -o logs/makeMtrRocksdbParallelReplication -- disk-select --disk 1TB --disk 1TB --disk 1TB --disk 1TB -- make NO_VAGRANT=1 RUN_ARGS="mtrRocksdbParallelReplicationTest" results/zenfs-mtr.xml + run: | + podman run --rm -i --device /dev/$ZBD0 \ + --device /dev/$ZBD1 \ + --device /dev/$ZBD2 \ + --device /dev/$ZBD3 \ + --volume ${GITHUB_WORKSPACE}/zenfs/.github/workflows/mtr:/scripts \ + --workdir /scripts \ + --env DEVICE0="$ZBD0" \ + --env DEVICE1="$ZBD1" \ + --env DEVICE2="$ZBD2" \ + --env DEVICE3="$ZBD3" \ + percona-debian \ + bash wrapper.sh bash mtr-rocksdb-parallel-replication-test.sh continue-on-error: true - - name: Collect MTR RocksDB parallel replication results - run: cd harness && make NO_VAGRANT=1 upload - if: always() + - name: Remove images run: podman image prune --force if: always() + - name: Failure check - if: steps.mtrTest1.outcome != 'success' || steps.mtrTest2.outcome != 'success' || steps.mtrTest3.outcome != 'success' || steps.mtrTest4.outcome != 'success' + if: steps.mtrTest1.outcome != 'success' || steps.mtrTest2.outcome != 'success' || steps.mtrTest3.outcome != 'success' || steps.mtrTest4.outcome != 'success' run: exit 1 diff --git a/.github/workflows/mtr/expected-mtr-failures b/.github/workflows/mtr/expected-mtr-failures new file mode 100644 index 00000000..500a6812 --- /dev/null +++ b/.github/workflows/mtr/expected-mtr-failures @@ -0,0 +1,17 @@ +rocksdb.check_ignore_unknown_options : WL#0000 Need adapting +rocksdb.drop_table2 : WL#0000 Need adapting +rocksdb.rocksdb_fault_injection : WL#0000 Need adapting +rocksdb.track_and_verify_wals_in_manifest : WL#0000 Need adapting +rocksdb.type_char_index_ver_bump_verify : WL#0000 Need adapting +rocksdb.checkpoint : WL#0000 Need fixing the server +rocksdb.bloomfilter3 : WL#0000 Sporadic failures +rocksdb.bloomfilter_skip : WL#0000 Sporadic failures +rocksdb.rocksdb_read_free_rpl : WL#0000 Sporadic failures +rocksdb.optimize_table : WL#0000 Need adapting +rocksdb.issue896 : WL#0000 Sporadic failures +rocksdb.non_blocking_manual_compaction : WL#0000 Sporadic failures +rocksdb.add_index_inplace: WL#0000 Sporadic failures +rocksdb.partial_index_stress: WL#0000 TODO FIND OUT WHY THIS FAILS +rocksdb.show_table_status: WL#0000 TODO FIND OUT WHY THIS FAILS +rocksdb.rocksdb_icp: WL#0000 TODO FIND OUT WHY THIS FAILS +rocksdb.rocksdb_icp_rev: WL#0000 TODO FIND OUT WHY THIS FAILS diff --git a/.github/workflows/mtr/fs-cleanup-parallel-replication.sh b/.github/workflows/mtr/fs-cleanup-parallel-replication.sh new file mode 100755 index 00000000..c4681157 --- /dev/null +++ b/.github/workflows/mtr/fs-cleanup-parallel-replication.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +WORKER=$1 +AUX1=$((WORKER*2-2)) +AUX2=$((AUX1+1)) +SOURCE_VARNAME=SOURCE_FS_URI$WORKER +REPLICA_VARNAME=REPLICA_FS_URI$WORKER +SOURCE_FS_URI=${!SOURCE_VARNAME} +REPLICA_FS_URI=${!REPLICA_VARNAME} +SOURCE_ZBD=${SOURCE_FS_URI#zenfs://dev:} +REPLICA_ZBD=${REPLICA_FS_URI#zenfs://dev:} + +echo reinitializing ${SOURCE_ZBD} \(source\) and ${REPLICA_ZBD} \(replica\) for worker $1 + +rm -fr /tmp/zenfs_aux_$AUX1 +rm -fr /tmp/zenfs_aux_$AUX2 +zenfs mkfs --zbd=$SOURCE_ZBD --aux-path=/tmp/zenfs_aux_$AUX1 --force +zenfs mkfs --zbd=$REPLICA_ZBD --aux-path=/tmp/zenfs_aux_$AUX2 --force diff --git a/.github/workflows/mtr/fs-cleanup-parallel.sh b/.github/workflows/mtr/fs-cleanup-parallel.sh new file mode 100755 index 00000000..b988ebac --- /dev/null +++ b/.github/workflows/mtr/fs-cleanup-parallel.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +WORKER=$1 +WORKER=$((WORKER-1)) +DEV="DEVICE$WORKER" +echo "Reinitializing $DEV" +if [ -z "${!DEV}" ] +then + echo "$DEV must be set for zenfs-mtr" + exit 1 +fi + +rm -fr /tmp/zenfs_aux_$WORKER +zenfs mkfs --zbd=${!DEV} --aux-path=/tmp/zenfs_aux_$WORKER --force diff --git a/.github/workflows/mtr/fs-cleanup-replication.sh b/.github/workflows/mtr/fs-cleanup-replication.sh new file mode 100755 index 00000000..15e549fd --- /dev/null +++ b/.github/workflows/mtr/fs-cleanup-replication.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) +$SCRIPT_DIR/fs-multidev-cleanup.sh 1 diff --git a/.github/workflows/mtr/fs-multidev-cleanup.sh b/.github/workflows/mtr/fs-multidev-cleanup.sh new file mode 100755 index 00000000..0c08be83 --- /dev/null +++ b/.github/workflows/mtr/fs-multidev-cleanup.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +if [ -z "${1}" ] +then + echo "Usage: $0 LAST_DEVICE_INDEX" + exit 1 +fi + +for i in $(seq 0 $1) +do + DEV="DEVICE$i" + echo "Reinitializing $DEV" + if [ -z "${!DEV}" ] + then + echo "$DEV must be set for zenfs-mtr" + exit 1 + fi + + rm -fr /tmp/zenfs_aux_$i + zenfs mkfs --zbd=${!DEV} --aux-path=/tmp/zenfs_aux_$i --force +done diff --git a/.github/workflows/mtr/mtr-rocksdb-parallel-replication-test.sh b/.github/workflows/mtr/mtr-rocksdb-parallel-replication-test.sh new file mode 100755 index 00000000..f4db7211 --- /dev/null +++ b/.github/workflows/mtr/mtr-rocksdb-parallel-replication-test.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +/scripts/fs-multidev-cleanup.sh 3 + +cd $INSTALL_PATH + +SOURCE_FS_URI1=zenfs://dev:$DEVICE0 SOURCE_FS_URI2=zenfs://dev:$DEVICE2 \ + REPLICA_FS_URI1=zenfs://dev:$DEVICE1 REPLICA_FS_URI2=zenfs://dev:$DEVICE3 \ + ./mtr --suite=rocksdb \ + --skip-test-list /scripts/expected-mtr-failures \ + --defaults-extra-file=/scripts/zenfs_rpl.cnf \ + --fs-cleanup-hook="@/scripts/fs-cleanup-parallel-replication.sh" \ + --parallel=2 diff --git a/.github/workflows/mtr/mtr-rocksdb-parallel-test.sh b/.github/workflows/mtr/mtr-rocksdb-parallel-test.sh new file mode 100755 index 00000000..36e90ee4 --- /dev/null +++ b/.github/workflows/mtr/mtr-rocksdb-parallel-test.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +/scripts/fs-multidev-cleanup.sh 3 + +cd $INSTALL_PATH + +FS_URI1=zenfs://dev:$DEVICE0 FS_URI2=zenfs://dev:$DEVICE1 \ + FS_URI3=zenfs://dev:$DEVICE2 FS_URI4=zenfs://dev:$DEVICE3 \ + ./mtr --suite=rocksdb \ + --skip-rpl \ + --skip-test-list /scripts/expected-mtr-failures \ + --defaults-extra-file=/scripts/zenfs_parallel.cnf \ + --fs-cleanup-hook="@/scripts/fs-cleanup-parallel.sh" \ + --parallel=4 diff --git a/.github/workflows/mtr/mtr-rocksdb-replication-test.sh b/.github/workflows/mtr/mtr-rocksdb-replication-test.sh new file mode 100755 index 00000000..bea4412f --- /dev/null +++ b/.github/workflows/mtr/mtr-rocksdb-replication-test.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +/scripts/fs-cleanup-replication.sh + +cd $INSTALL_PATH + +SOURCE_FS_URI1=zenfs://dev:$DEVICE0 \ + REPLICA_FS_URI1=zenfs://dev:$DEVICE1 \ + ./mtr --suite=rocksdb \ + --skip-test-list /scripts/expected-mtr-failures \ + --defaults-extra-file=/scripts/zenfs_rpl.cnf \ + --fs-cleanup-hook="@/scripts/fs-cleanup-replication.sh" diff --git a/.github/workflows/mtr/mtr-rocksdb-test.sh b/.github/workflows/mtr/mtr-rocksdb-test.sh new file mode 100755 index 00000000..7ffd282c --- /dev/null +++ b/.github/workflows/mtr/mtr-rocksdb-test.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +if [ -z "${DEVICE0}" ] +then + echo "DEVICE0 not set for the test script" + exit 1 +fi + +rm -fr /tmp/zenfs_aux +zenfs mkfs --zbd=$DEVICE0 --aux-path=/tmp/zenfs_aux --force + +cd $INSTALL_PATH + +./mtr --suite=rocksdb \ + --skip-rpl \ + --skip-test-list /scripts/expected-mtr-failures \ + --mysqld=--loose-rocksdb-fs-uri=zenfs://dev:$DEVICE0 \ + --fs-cleanup-hook="rm -rf /tmp/zenfs_aux; zenfs mkfs --zbd=$DEVICE0 --aux_path=/tmp/zenfs_aux --force" diff --git a/.github/workflows/mtr/wrapper.sh b/.github/workflows/mtr/wrapper.sh new file mode 100755 index 00000000..d0ae6964 --- /dev/null +++ b/.github/workflows/mtr/wrapper.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +for i in $(seq 0 3) +do + DEV="DEVICE$i" + if [ -n "${!DEV}" ] + then + chown mysql:mysql /dev/${!DEV} + fi +done + +sudo --preserve-env=LD_LIBRARY_PATH,PATH,PERCONA_SRC,PERCONA_BUILD,PERCONA_INSTALL,DEVICE,DEVICE0,DEVICE1,DEVICE2,DEVICE3,DEVICE4,DEVICE5,INSTALL_PATH $@ diff --git a/.github/workflows/mtr/zenfs_parallel.cnf b/.github/workflows/mtr/zenfs_parallel.cnf new file mode 100644 index 00000000..32e958ce --- /dev/null +++ b/.github/workflows/mtr/zenfs_parallel.cnf @@ -0,0 +1,2 @@ +[mysqld] +rocksdb-fs-uri=@envarray.FS_URI \ No newline at end of file diff --git a/.github/workflows/mtr/zenfs_rpl.cnf b/.github/workflows/mtr/zenfs_rpl.cnf new file mode 100644 index 00000000..ae963dd5 --- /dev/null +++ b/.github/workflows/mtr/zenfs_rpl.cnf @@ -0,0 +1,5 @@ +[mysqld] +rocksdb-fs-uri=@envarray.REPLICA_FS_URI + +[mysqld.1] +rocksdb-fs-uri=@envarray.SOURCE_FS_URI \ No newline at end of file