From 1071aad9f1a0bc3a5cbe8f8a3a44cedb804f1415 Mon Sep 17 00:00:00 2001 From: Evgeniy Ratkov Date: Wed, 4 Oct 2023 09:57:04 +0300 Subject: [PATCH 1/6] Revert "temporary disable upgrade tests" This reverts commit 50ed2e4e1883ec8ec4e7086b750cb28cdc5a2dc0. --- CMakeLists.txt | 1 + concourse/scripts/build_diskquota.sh | 3 +++ concourse/scripts/test_diskquota.sh | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d44f3e4e..38d32e7c1 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/concourse/scripts/build_diskquota.sh b/concourse/scripts/build_diskquota.sh index 10b66e341..7b2ee30b6 100755 --- a/concourse/scripts/build_diskquota.sh +++ b/concourse/scripts/build_diskquota.sh @@ -11,7 +11,10 @@ function pkg() { export CXX="$(which g++)" pushd /home/gpadmin/diskquota_artifacts + local last_release_path + last_release_path=$(readlink -eq /home/gpadmin/last_released_diskquota_bin/diskquota-*.tar.gz) cmake /home/gpadmin/diskquota_src \ + -DDISKQUOTA_LAST_RELEASE_PATH="${last_release_path}" \ -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" cmake --build . --target create_artifact popd diff --git a/concourse/scripts/test_diskquota.sh b/concourse/scripts/test_diskquota.sh index 245196ffc..85b2bce15 100755 --- a/concourse/scripts/test_diskquota.sh +++ b/concourse/scripts/test_diskquota.sh @@ -38,6 +38,8 @@ function _main() { activate_standby time cmake --build . --target installcheck fi + # Run upgrade test (with standby master) + time cmake --build . --target upgradecheck popd } From 255e47ff19fad51c61cf9458bab561e42d2d196d Mon Sep 17 00:00:00 2001 From: Evgeniy Ratkov Date: Thu, 5 Oct 2023 15:08:58 +0300 Subject: [PATCH 2/6] Add check to creating symlinks (#21) If previous versions of diskquota were added from DISKQUOTA_LAST_RELEASE_PATH do not need to create symlinks from ealier versions (since 2.0) diskquota to the latest version which added at commit 472eb0652d7d71d8605a70b9f8f15005009ae1c9 New check disable creating symlinks if diskquota was build with -DDISKQUOTA_LAST_RELEASE_PATH and enable creating symlinks if there is not -DDISKQUOTA_LAST_RELEASE_PATH --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38d32e7c1..69dcd5497 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,7 +161,9 @@ install(FILES ${build_info_PATH} DESTINATION ".") file(GLOB sql_files RELATIVE ${DISKQUOTA_DDL_DIR} "${DISKQUOTA_DDL_DIR}/diskquota--2.*.sql") list(FILTER sql_files EXCLUDE REGEX ".*--.*--.*") list(FILTER sql_files EXCLUDE REGEX ".*diskquota--${DISKQUOTA_MAJOR_VERSION}.${DISKQUOTA_MINOR_VERSION}.*") -foreach(so IN LISTS sql_files) - string(REGEX REPLACE "^diskquota--([0-9]+)\.([0-9]+).sql$" "diskquota-\\1.\\2.so" so ${so}) - install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${DISKQUOTA_BINARY_NAME}.so \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/postgresql/${so}\")") -endforeach() +if(NOT DEFINED DISKQUOTA_LAST_RELEASE_PATH) + foreach(so IN LISTS sql_files) + string(REGEX REPLACE "^diskquota--([0-9]+)\.([0-9]+).sql$" "diskquota-\\1.\\2.so" so ${so}) + install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${DISKQUOTA_BINARY_NAME}.so \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/#postgresql/${so}\")") + endforeach() +endif() From 89382df150dedbdc0c9c3dabbfe41f0ab8b1ff7d Mon Sep 17 00:00:00 2001 From: Evgeniy Ratkov Date: Thu, 5 Oct 2023 15:53:38 +0300 Subject: [PATCH 3/6] Update README.md for upgrade tests (#21) Information about how to run upgrade tests for diskquota was added to arenadata/README.md. --- arenadata/README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/arenadata/README.md b/arenadata/README.md index fff0b9868..d890992ca 100644 --- a/arenadata/README.md +++ b/arenadata/README.md @@ -5,18 +5,33 @@ How to build Docker image: (["readme.md"](https://github.com/arenadata/gpdb/blob 1. Download the cmake-3.20 install script from ([source](https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-x86_64.sh)). -2. Build diskquota in the Docker container. -Change and to the appropriate paths on your local machine. +2. Prepare diskquota-.tar.gz which must contains all . versions of diskquota. For each versions you need to use last tag (see `git tag`). Name of this archive must be `diskquota-.tar.gz`, where is tag for the latest version of diskquota in this archive. All `*.so` files must be at `lib/postgresql` path: + +``` +evgeniy@evgeniy-pc:~/gpdb/diskquota_bin$ tar -tvf diskquota-2.2.1_arenadata3.tar.gz +drwxrwxr-x evgeniy/evgeniy 0 2023-10-05 14:40 lib/ +drwxrwxr-x evgeniy/evgeniy 0 2023-10-05 14:41 lib/postgresql/ +-rwxr-xr-x evgeniy/evgeniy 281632 2023-10-03 13:55 lib/postgresql/diskquota.so +-rwxr-xr-x evgeniy/evgeniy 550080 2023-10-03 13:53 lib/postgresql/diskquota-2.0.so +-rwxr-xr-x evgeniy/evgeniy 619824 2023-10-03 13:51 lib/postgresql/diskquota-2.1.so +-rwxr-xr-x evgeniy/evgeniy 755664 2023-10-04 10:11 lib/postgresql/diskquota-2.2.so +``` + +This archive is needed for run upgrade tests for diskquota. This tests may be disabled (see ([commit](https://github.com/arenadata/diskquota/commit/50ed2e4e1883ec8ec4e7086b750cb28cdc5a2dc0)). + +3. Build diskquota in the Docker container. +Change and to the appropriate paths on your local machine. is the same as at step 2. If upgrade test is disabled, line with is not needed. ``` docker run --rm -it -e DISKQUOTA_OS=rhel7 \ -v /tmp/diskquota_artifacts:/home/gpadmin/diskquota_artifacts \ -v :/home/gpadmin/diskquota_src \ -v :/home/gpadmin/bin_cmake/cmake-3.20.0-linux-x86_64.sh \ + -v :/home/gpadmin/last_released_diskquota_bin/diskquota-.tar.gz \ hub.adsw.io/library/gpdb6_regress:latest diskquota_src/concourse/scripts/entry.sh build ``` -3. Run tests. +4. Run tests. Change and to the appropriate paths on your local machine. ``` From 786ee92d71210ed5eb01220b50563aae7342a60f Mon Sep 17 00:00:00 2001 From: Evgeniy Ratkov Date: Fri, 6 Oct 2023 11:21:28 +0300 Subject: [PATCH 4/6] Fix check for find changes at DDL files (#21) After commit 97f1f9b46b0941a86cffdb2120b900b55ce58928 all DDL files were moved to directory "control/ddl". At upgrade test there is check, which finds diff at DDL files from last release version. Path, where DDL files are found, was not changed, and this check did not work. --- upgrade_test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upgrade_test/CMakeLists.txt b/upgrade_test/CMakeLists.txt index 1e3a25628..4e0f9bb6e 100644 --- a/upgrade_test/CMakeLists.txt +++ b/upgrade_test/CMakeLists.txt @@ -37,12 +37,12 @@ exec_program( ) # check whether DDL file (*.sql) is modified -file(GLOB ddl_files ${CMAKE_SOURCE_DIR}/*.sql) +file(GLOB ddl_files ${CMAKE_SOURCE_DIR}/control/ddl/*.sql) foreach(ddl IN LISTS ddl_files) cmake_path(GET ddl FILENAME ddl) exec_program( git ${CMAKE_SOURCE_DIR} ARGS - diff ${latest_tag} --exit-code ${ddl} + diff ${latest_tag} --exit-code control/ddl/${ddl} OUTPUT_VARIABLE NULL RETURN_VALUE "${ddl}_modified") From 7c405b4445c8203f6e7f60778f9f664e28b4d7bf Mon Sep 17 00:00:00 2001 From: Evgeniy Ratkov Date: Tue, 10 Oct 2023 11:00:54 +0300 Subject: [PATCH 5/6] fix get the latest tag of current branch --- upgrade_test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade_test/CMakeLists.txt b/upgrade_test/CMakeLists.txt index 4e0f9bb6e..6be68af64 100644 --- a/upgrade_test/CMakeLists.txt +++ b/upgrade_test/CMakeLists.txt @@ -32,7 +32,7 @@ regresstarget_add( exec_program( git ${CMAKE_SOURCE_DIR} ARGS - tag | sort --version-sort -r | head -n 1 + describe --abbrev=0 --tags OUTPUT_VARIABLE latest_tag ) From 34bb5a1d75411d740b73efa9ff73f9e7466fefec Mon Sep 17 00:00:00 2001 From: Evgeniy Ratkov Date: Wed, 11 Oct 2023 20:30:07 +0300 Subject: [PATCH 6/6] remove waste symbol --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69dcd5497..172201d44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,6 +164,6 @@ list(FILTER sql_files EXCLUDE REGEX ".*diskquota--${DISKQUOTA_MAJOR_VERSION}.${D if(NOT DEFINED DISKQUOTA_LAST_RELEASE_PATH) foreach(so IN LISTS sql_files) string(REGEX REPLACE "^diskquota--([0-9]+)\.([0-9]+).sql$" "diskquota-\\1.\\2.so" so ${so}) - install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${DISKQUOTA_BINARY_NAME}.so \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/#postgresql/${so}\")") + install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${DISKQUOTA_BINARY_NAME}.so \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/postgresql/${so}\")") endforeach() endif()