Skip to content

Commit 017b008

Browse files
authored
Added assess migration to live migration scripts (#1476)
1 parent ab086bd commit 017b008

5 files changed

+65
-5
lines changed

.github/workflows/mysql-migtests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
run-mysql-migration-tests:
1111
strategy:
1212
matrix:
13-
version: [2.21.0.0-b545, 2.18.7.0-b30, 2.20.3.0-b68]
13+
version: [2.21.0.0-b545, 2.18.7.0-b30, 2.20.2.2-b1]
1414
BETA_FAST_DATA_EXPORT: [0, 1]
1515
env:
1616
BETA_FAST_DATA_EXPORT: ${{ matrix.BETA_FAST_DATA_EXPORT }}

.github/workflows/pg-migtests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
run-pg-migration-tests:
1111
strategy:
1212
matrix:
13-
version: [2.21.0.0-b545, 2.18.7.0-b30, 2.20.3.0-b68]
13+
version: [2.21.0.0-b545, 2.18.7.0-b30, 2.20.2.2-b1]
1414
BETA_FAST_DATA_EXPORT: [0, 1]
1515
env:
1616
BETA_FAST_DATA_EXPORT: ${{ matrix.BETA_FAST_DATA_EXPORT }}

migtests/scripts/live-migration-fallb-run-test.sh

+21-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,22 @@ main() {
6060
step "Check the Voyager version installed"
6161
yb-voyager version
6262

63+
step "Assess Migration"
64+
if [ "${SOURCE_DB_TYPE}" = "postgresql" ]; then
65+
assess_migration
66+
67+
step "Validate Assessment Reports"
68+
# Checking if the assessment reports were created
69+
if [ -f "${EXPORT_DIR}/assessment/reports/assessmentReport.html" ] && [ -f "${EXPORT_DIR}/assessment/reports/assessmentReport.json" ]; then
70+
echo "Assessment reports created successfully."
71+
#TODO: Further validation to be added
72+
else
73+
echo "Error: Assessment reports were not created successfully."
74+
cat_log_file "yb-voyager-assess-migration.log"
75+
exit 1
76+
fi
77+
fi
78+
6379
step "Export schema."
6480
export_schema
6581
find ${EXPORT_DIR}/schema -name '*.sql' -printf "'%p'\n"| xargs grep -wh CREATE
@@ -80,7 +96,11 @@ main() {
8096

8197
step "Create target database."
8298
run_ysql yugabyte "DROP DATABASE IF EXISTS ${TARGET_DB_NAME};"
83-
run_ysql yugabyte "CREATE DATABASE ${TARGET_DB_NAME}"
99+
if [ "${SOURCE_DB_TYPE}" = "postgresql" ]; then
100+
run_ysql yugabyte "CREATE DATABASE ${TARGET_DB_NAME} with COLOCATION=TRUE"
101+
else
102+
run_ysql yugabyte "CREATE DATABASE ${TARGET_DB_NAME}"
103+
fi
84104

85105
if [ -x "${TEST_DIR}/add-pk-from-alter-to-create" ]
86106
then

migtests/scripts/live-migration-fallf-run-test.sh

+21-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ main() {
6868
step "Check the Voyager version installed"
6969
yb-voyager version
7070

71+
step "Assess Migration"
72+
if [ "${SOURCE_DB_TYPE}" = "postgresql" ]; then
73+
assess_migration
74+
75+
step "Validate Assessment Reports"
76+
# Checking if the assessment reports were created
77+
if [ -f "${EXPORT_DIR}/assessment/reports/assessmentReport.html" ] && [ -f "${EXPORT_DIR}/assessment/reports/assessmentReport.json" ]; then
78+
echo "Assessment reports created successfully."
79+
#TODO: Further validation to be added
80+
else
81+
echo "Error: Assessment reports were not created successfully."
82+
cat_log_file "yb-voyager-assess-migration.log"
83+
exit 1
84+
fi
85+
fi
86+
7187
step "Export schema."
7288
export_schema
7389
find ${EXPORT_DIR}/schema -name '*.sql' -printf "'%p'\n"| xargs grep -wh CREATE
@@ -88,7 +104,11 @@ main() {
88104

89105
step "Create target database."
90106
run_ysql yugabyte "DROP DATABASE IF EXISTS ${TARGET_DB_NAME};"
91-
run_ysql yugabyte "CREATE DATABASE ${TARGET_DB_NAME}"
107+
if [ "${SOURCE_DB_TYPE}" = "postgresql" ]; then
108+
run_ysql yugabyte "CREATE DATABASE ${TARGET_DB_NAME} with COLOCATION=TRUE"
109+
else
110+
run_ysql yugabyte "CREATE DATABASE ${TARGET_DB_NAME}"
111+
fi
92112

93113
if [ -x "${TEST_DIR}/add-pk-from-alter-to-create" ]
94114
then

migtests/scripts/live-migration-run-test.sh

+21-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ main() {
5959
step "Check the Voyager version installed"
6060
yb-voyager version
6161

62+
step "Assess Migration"
63+
if [ "${SOURCE_DB_TYPE}" = "postgresql" ]; then
64+
assess_migration
65+
66+
step "Validate Assessment Reports"
67+
# Checking if the assessment reports were created
68+
if [ -f "${EXPORT_DIR}/assessment/reports/assessmentReport.html" ] && [ -f "${EXPORT_DIR}/assessment/reports/assessmentReport.json" ]; then
69+
echo "Assessment reports created successfully."
70+
#TODO: Further validation to be added
71+
else
72+
echo "Error: Assessment reports were not created successfully."
73+
cat_log_file "yb-voyager-assess-migration.log"
74+
exit 1
75+
fi
76+
fi
77+
6278
step "Export schema."
6379
export_schema
6480
find ${EXPORT_DIR}/schema -name '*.sql' -printf "'%p'\n"| xargs grep -wh CREATE
@@ -79,7 +95,11 @@ main() {
7995

8096
step "Create target database."
8197
run_ysql yugabyte "DROP DATABASE IF EXISTS ${TARGET_DB_NAME};"
82-
run_ysql yugabyte "CREATE DATABASE ${TARGET_DB_NAME}"
98+
if [ "${SOURCE_DB_TYPE}" = "postgresql" ]; then
99+
run_ysql yugabyte "CREATE DATABASE ${TARGET_DB_NAME} with COLOCATION=TRUE"
100+
else
101+
run_ysql yugabyte "CREATE DATABASE ${TARGET_DB_NAME}"
102+
fi
83103

84104
if [ -x "${TEST_DIR}/add-pk-from-alter-to-create" ]
85105
then

0 commit comments

Comments
 (0)