Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting a column from enum to varchar does not work correctly while waiting for cut over to complete #1056

Closed
marnixgb opened this issue Nov 23, 2021 · 1 comment

Comments

@marnixgb
Copy link

marnixgb commented Nov 23, 2021

Source table has enum columns populated with TEXT entries of the form :

pay_id enum('AMEX','PAYPAL','CASH','CHEQUE') NOT NULL,

Gh-ost execution :

Define the target DB, table name and the alter string

mdb="live"
mtable="payments"
malter="CHANGE pay_id pay_id VARCHAR(255) NOT NULL"
file="gh-ost-updates$(date +%Y%m%d)"

gh-ost
--max-load=Threads_running=25
--critical-load=Threads_running=1000
--chunk-size=1000
--max-lag-millis=1500
--conf=/root/.my.cnf
--host=127.0.0.1
--database="$mdb"
--table="$mtable"
--verbose
--alter="$malter"
--allow-master-master
--allow-on-master
--cut-over=default
--exact-rowcount
--concurrent-rowcount
--default-retries=120
--panic-flag-file=/tmp/ghost.$mtable.panic.flag
--postpone-cut-over-flag-file=/tmp/ghost.$mtable.postpone.flag
--execute
| tee -i "$file-$mtable.sql.log"

Records that are already in place in the source table that gh-ost acts on are put into the target table correctly, eg

A source record with the column enumerated as AMEX would appear in the target table as the string "AMEX"

Records that are inserted into source table during the gh-ost operation (between the start of the gh-ost operation and the cutover) will appear in the target table tokenised, eg

An inserted record with column enumerated as AMEX would appear in the target table as string "1", PAYPAL would appear "2" etc

@marnixgb
Copy link
Author

Duplicate of #642 - sorry, I'll upgrade to latest and test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant