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

Updates to cloud migration files to fix syntax issues #1380

Merged
merged 4 commits into from
Jul 17, 2020

Conversation

eiffel777
Copy link
Contributor

Not all of the sql statements in cloud-migration-8-5-1_9-0-0.sql were being run because of syntax issues. This adds '//' between the statements so they run. The queries were also running a slower than expected so indexes were added the speed this up. The indexes are removed at the end of the file. The decreased the time from around 10 minutes to around 2 minutes.

Also in testing I found that that the section during the upgrade that shows incorrect sessions due to the bug in #1344 was returning multiple rows for each incorrect session due to not having the right join parameters. Adding a join on resource_id fixes this.

Tests performed

Tested in docker manually and with a copy of modw_cloud from production.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@eiffel777 eiffel777 added bug Bugfixes Category:Cloud Cloud Realm labels Jul 17, 2020
@eiffel777 eiffel777 added this to the 9.0.0 milestone Jul 17, 2020
@eiffel777 eiffel777 self-assigned this Jul 17, 2020
@jtpalmer
Copy link
Contributor

Why don't you replace all the ; with //?

@jtpalmer
Copy link
Contributor

@jtpalmer
Copy link
Contributor

I'm still not clear on what works and what doesn't but the wrong statement count is reported unless the delimiter is used everywhere:

2020-07-17 16:20:29 [notice] Processing SQL file '/etc/xdmod/etl/etl_sql.d/migrations/cloud-migration-8-5-1_9-0-0.sql' using delimiter '//' containing 14 statements
2020-07-17 16:20:29 [notice] Finished Processing 14 SQL statements
2020-07-17 16:20:29 [notice] (action: xdmod.migration-8_5_1-9_0_0.DeleteCloudAutoincrementColumns (ETL\Maintenance\ExecuteSql), start_time: 1595002829.2376, end_time: 1595002829.3798, elapsed_time: 0.14219)

@eiffel777
Copy link
Contributor Author

@jtpalmer I didn't know(or forgot) that I could set the delimiter. I changed the delimiter to a semicolon. I think all the queries ran before but the wrong count was displayed.

@eiffel777 eiffel777 merged commit c61ee1e into ubccr:xdmod9.0 Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugfixes Category:Cloud Cloud Realm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants