diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d44f3e4..38d32e7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,7 @@ BuildInfo_Create(${build_info_PATH} # Add installcheck targets add_subdirectory(tests) +add_subdirectory(upgrade_test) # NOTE: keep install part at the end of file, to overwrite previous binary install(PROGRAMS "cmake/install_gpdb_component" DESTINATION ".") diff --git a/arenadata/README.md b/arenadata/README.md index fff0b986..40ae250c 100644 --- a/arenadata/README.md +++ b/arenadata/README.md @@ -26,3 +26,14 @@ docker run --rm -it --sysctl 'kernel.sem=500 1024000 200 4096' \ -v :/home/gpadmin/bin_cmake/cmake-3.20.0-linux-x86_64.sh \ hub.adsw.io/library/gpdb6_regress:latest diskquota_src/concourse/scripts/entry.sh test ``` + +4. Run upgrade test. +Change and to the appropriate paths on your local machine. +``` +sudo docker run --rm -it -e DISKQUOTA_OS=rhel7 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \ + --sysctl 'kernel.sem=500 1024000 200 4096' \ + -v /tmp/diskquota_artifacts:/home/gpadmin/bin_diskquota \ + -v :/home/gpadmin/diskquota_src \ + -v :/home/gpadmin/bin_cmake/cmake-3.20.0-linux-x86_64.sh \ + hub.adsw.io/library/gpdb6_regress:latest diskquota_src/concourse/scripts/upgrade_test_diskquota.sh +``` diff --git a/concourse/scripts/upgrade_test_diskquota.sh b/concourse/scripts/upgrade_test_diskquota.sh new file mode 100755 index 00000000..49f4cb80 --- /dev/null +++ b/concourse/scripts/upgrade_test_diskquota.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Install cmake +cd bin_cmake/ +./cmake-3.20.0-linux-x86_64.sh --skip-license --exclude-subdir +export PATH="/home/gpadmin/bin_cmake/bin:$PATH" +cmake --version +cd .. + +# Build and start GPDB +source gpdb_src/concourse/scripts/common.bash +install_and_configure_gpdb +gpdb_src/concourse/scripts/setup_gpadmin_user.bash +make_cluster +source /usr/local/greenplum-db-devel/greenplum_path.sh; +source gpdb_src/gpAux/gpdemo/gpdemo-env.sh; + +# Build diskquota-1.0.3 (last tag 1.0.3_arenadata2) +cp -r diskquota_src/ diskquota_src_tmp +cd diskquota_src_tmp +git checkout -- ./ +git checkout 1.0.3_arenadata2 +git clean -xf +make +make install +cd .. +rm -rf diskquota_src_tmp + +# Build test version of diskquota +cd diskquota_src/ +rm -rf build +mkdir build +cd build +cmake .. +make install + +# Add permissions +chown gpadmin:gpadmin -R /usr/local/greenplum-db-devel/ +chown gpadmin:gpadmin -R /home/gpadmin/ + +# Run tests +# To make fly debug easier +echo "source /usr/local/greenplum-db-devel/greenplum_path.sh" >> /home/gpadmin/.bashrc +su gpadmin -c \ + "source /home/gpadmin/.bashrc && \ + make upgradecheck" diff --git a/src/diskquota.c b/src/diskquota.c index d5630700..580f73eb 100644 --- a/src/diskquota.c +++ b/src/diskquota.c @@ -381,7 +381,7 @@ disk_quota_worker_main(Datum main_arg) int major = -1, minor = -1; int has_error = worker_spi_get_extension_version(&major, &minor) != 0; - if (major == DISKQUOTA_MAJOR_VERSION && minor == DISKQUOTA_MINOR_VERSION) break; + if (major == DISKQUOTA_MAJOR_VERSION) break; #if GP_VERSION_NUM < 70000 /* MemoryAccount has been removed on gpdb7 */ MemoryAccounting_Reset();