Skip to content

mysql update warnings#212

Merged
yadvr merged 2 commits intoapache:4.15from
shapeblue:mysql-update
Jul 5, 2021
Merged

mysql update warnings#212
yadvr merged 2 commits intoapache:4.15from
shapeblue:mysql-update

Conversation

@DaanHoogland
Copy link
Copy Markdown
Contributor

This adds a mysql specific upgrade notes page

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@rhtyd @andrijapanicsb I'm not sure if this is working and enough but please chime in
@blueorangutan docbuild

Comment thread source/upgrading/MySQL.rst Outdated
Comment thread source/upgrading/MySQL.rst Outdated
Comment thread source/upgrading/MySQL.rst Outdated
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Apr 28, 2021

cc @DaanHoogland @andrijapanicsb I've added some suggestions

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

tnx @rhtyd will look tonight.

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan docbuild

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@andrijapanicsb can you add a comment on what we should say more about versions? tnx

@andrijapanicsb
Copy link
Copy Markdown
Contributor

I can't Daan - we've seen this ONCE reported by we-know-who - and I think this PR is not making any use to anyone but the one being affected by the specific MySQL 5.6 issue (we didn't see an issue on 5.5, nor 5.7, so I think this must be some bug on that specific 5.6 or similar (did you do any tests with other versions? if not I can do, various 5.5 and up version, running 4.14, then upgrading to 4.15, if the effort is justified (and I think it's not, but I'm happy to invest time))

Furthermore, this kind of warning is SO WIDE in nature, we are saying it's possible to miss any SQL update in MANY different cases (we are giving one example) but this is not true, as we would have seen issues left, right and centre.

I know this is counter-productive, but I would propose dropping this PR completely, IMO, unless we are aware of a VERY specific case which needs to be documented.

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

I've checked that the default gets applied with "MySQL [5.5.5-10.3.25-MariaDB-0ubuntu0.20.04.1]" and "5.5.68-MariaDB". In my local "MySQL [5.7.28-log]" it gets applied as well. I am not aware of the precise matrix and wouldn't mind if i had the time to explore it; i don't want to make the time right now. I'd say we enter the data we have and let the community evolve the knowledge here over time.

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan docbuild

@PaulAngus
Copy link
Copy Markdown
Member

Can someone add a link to where this potential issue was reported please.

I agree with Andrija, this is a scary message that basically says: upgrading may or may not trash your database, and that the Admin needs to check their schema, looking for a non-specific problem, and then apply a non-specific fix.

If there is an issue, it's our job to ensure that the MySQL upgrade statements work, not the end-users.

Worst case, we should check that the schema changes are applied correctly as we go (not a bad idea to do this as a standard procedure for all schema updates). We can then retry with the alternate syntax, or just fail fast.

@andrijapanicsb
Copy link
Copy Markdown
Contributor

This was a one-time issue that our British friends have occurred when upgrading their test env from 4.13 to 4.15 while using a specific version of MySQL 5.6.xx - the SQL statement silently failed and the upgrade succeeded (SQL that failed was "ALTER TABLE nics MODIFY COLUMN update_time timestamp DEFAULT CURRENT_TIMESTAMP;" - this is the SQL statement required to support MySQL 8, but I've also seen this being required to be manually executed on MySQL 5.7.latest even with ACS 4.14 (Oracle backported something from 8.x to 5.7.latest)

The British friends issue is what triggered Daan writing this statement, but that alone I think is not enough.
The issue I saw is more worrying, that even MySQL 5.7.latest needs this manual fix for older version of ACS.

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@PaulAngus I like your suggestion but I think that is out of scope. Also you and @andrijapanicsb have a point about not giving to vague instructions. I have no exact version matrix and can not make the description more precise. I'll keep this open but convert to draft so we can extend it if we have more info.

@DaanHoogland DaanHoogland marked this pull request as draft April 29, 2021 13:21
@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan docbuild

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Doc build preview: http://qa.cloudstack.cloud/docs/WIP-PROOFING/pr/212. (SL-JID 51)

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Apr 30, 2021

The issue has been fixed in https://github.com/apache/cloudstack/pull/4068/files for users using ACS 4.15 with a fresh installed env with MySQL8, or users who upgrade to MySQL8 prior to upgrading to ACS 4.15.

The specific issue of nics update_time column issue would still affect anyone who may upgrade CloudStack 4.15+ first and then later decide to upgrade their MySQL to 8+ (or as Andrija found newer minor version of MySQL 5.7.xxx). The root cause is a limitation/issue with older MySQL version which don't run the query (the query effectively doesn't change the column type). Since we can never know when a user may decide to upgrade to MySQL8/5.7.xxx and it's a MySQL issue, we can document it to say the users upgrading to certain MySQL versions can fix the nics exception issue by running the query (it doesn't require restarting of mgmt server or MySQL server, just fixing the column type before doing any nic/network/vm operations).

Commit reference: apache/cloudstack@d949302 (query seen in 4.14->4.15 upgrade path).

Comment thread source/upgrading/upgrade/MySQL.rst Outdated
@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan docbuild

1 similar comment
@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan docbuild

@yadvr yadvr marked this pull request as ready for review May 24, 2021 10:36
@yadvr yadvr changed the base branch from master to 4.15 May 24, 2021 10:36
@yadvr
Copy link
Copy Markdown
Member

yadvr commented May 24, 2021

@DaanHoogland can you rebase against 4.15 branch?

Changes are more specific now, LGTM. Let's also wait for other reviewers to give them lgtm.

@andrijapanicsb
Copy link
Copy Markdown
Contributor

@rhtyd this is still very confusing - can you please review my proposal above ^^^

@yadvr
Copy link
Copy Markdown
Member

yadvr commented May 25, 2021

@blueorangutan docbuild

@yadvr
Copy link
Copy Markdown
Member

yadvr commented May 25, 2021

@andrijapanicsb it's probably because the PR needs to be rebased against 4.15 branch cc @DaanHoogland
In the meanwhile can you explain what is confusing (if other than the branch/rebase issue)?

@andrijapanicsb
Copy link
Copy Markdown
Contributor

Users who may upgrade their MySQL server after upgrading to Apache
        CloudStack 4.15 or later, may need to run the following SQL query to
      
      
        fix an issue with "cloud.nics" table's column type which may lead to
      
      
        exception seen in the management server logs<!--EndFragment-->

This message is not complete/correct, because:

as I stated, I had this message reported by 2 users even when upgrading from older ACS versions to ACS 4.14 and MySQL 5.7.xx (parallel updates we do with users, so also MySQL is of a newer, 5.7.xx version) - we historically had this column type set in a certain way - and as of MySQL 5.7.xx and MySQL 8 - all ACS versions are "broken" in that regards - i.e. no VM's can be started - and

  1. in pre-4.15 used with MySQL 5..7.xx you still need to manually execute this statement to fix your 4.13, or 4.14 env, etc.
  2. in 4.15, this statement can fail (weird enough) during the upgrade, and again needs to be executed manually.

What I'm saying for both < 4.15 and >4.15 there are issues seen with MySQL 5.7.xx/8.x

Hope that makes sense, or we can discuss offline.

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

I do not have a clear understanding of the circumstances under which this may occur, but I believe you @andrijapanicsb , can you enter your correction as a comment/suggestion to the code, please?

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@rhtyd thos conflicts have to do with changes that should go in 4.16 and not in the 4.15 branch. Is something else merged that shouldn't have?

Copy link
Copy Markdown
Contributor

@andrijapanicsb andrijapanicsb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've shared my 2 cents - even 4.13 or older, with MySQL 5.7.latest will have the same cloud.nics issues - so I prefer to keep it in the way I wrote it - but this is democracy, so... feel free to decide.

I do not have a clear understanding of the circumstances under which this may occur, but I believe you @andrijapanicsb , can you enter your correction as a comment/suggestion to the code, please?

I already did @DaanHoogland (for some reason, I can not apply the suggestion, but also can't add you to the list of the Reviewers... your name doesn't pop up... ) - up to you to accept the suggestion in code/merge

Comment thread source/upgrading/upgrade/mysql.rst Outdated
Comment thread source/_global.rst Outdated

.. Latest version systemvm template name

.. |sysvm64-version| replace:: 4.15.0
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhtyd , I don't think this commit should be on the 4.15 branch, should it?

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 3, 2021

@DaanHoogland you need to rebase your branch against latest 4.15, this branch is out of sync

Co-authored-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Co-authored-by: Andrija Panic <45762285+andrijapanicsb@users.noreply.github.com>
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@apache apache deleted a comment from blueorangutan Jun 4, 2021
@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan docbuild

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Doc build preview: http://qa.cloudstack.cloud/docs/WIP-PROOFING/pr/212. (SL-JID 85)

@andrijapanicsb
Copy link
Copy Markdown
Contributor

@DaanHoogland can you advise WHERE can I see this mysql.rst page being included - I can't find it when browsing http://qa.cloudstack.cloud/docs/WIP-PROOFING/pr/212

thx

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@yadvr yadvr requested a review from andrijapanicsb June 4, 2021 09:35
@yadvr yadvr added this to the 4.15 milestone Jun 4, 2021
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 7, 2021

@andrijapanicsb are you lgtm with latest changes?

@andrijapanicsb
Copy link
Copy Markdown
Contributor

Yep, assuming the SQL is all correct (the fix) - I'm LGTM.

thx

@yadvr yadvr merged commit 8f8bfc5 into apache:4.15 Jul 5, 2021
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

Successfully merging this pull request may close these issues.

5 participants