Commit Graph

5 Commits

Author SHA1 Message Date
Stephen Finucane 1f5bbf0bd1 db: Remove use of 'bind' arguments
Resolve the following RemovedIn20Warning warnings:

  The MetaData.bind argument is deprecated and will be removed in
  SQLAlchemy 2.0.

  The ``bind`` argument for schema methods that invoke SQL against an
  engine or connection will be required in SQLAlchemy 2.0.

We are also able to resolve the following RemovedIn20Warning warning,
since the migration away from the bind parameter requires updating these
calls.

  The autoload parameter is deprecated and will be removed in version
  2.0.  Please use the autoload_with parameter, passing an engine or
  connection.

Similarly, we can also resolve the following RemovedIn20Warning warning,
since the calls we're updating here are the only ones affected by this
deprecation:

  The insert.values parameter will be removed in SQLAlchemy 2.0.  Please
  refer to the Insert.values() method.

Change-Id: Ic956980a03e1a0e1b6f90c492d8a03a64ea275cc
2023-07-24 17:47:39 +01:00
Abhishek Kekane 14e8a7b53b Triggers shouldn't be execute in offline migration
Recently this change [1] in glance-manage db_sync is internally
using Expand, Migrate and Contract. EMC is explicitly used for
online migration for which glance uses triggers to sync data
between old columns and new columns. DB Sync is used for
offline migartion for which adding triggers is not required.

Made provision to execute triggers explicitly in case of
online migration (EMC pattern) and skip the same in
case of offline migration (db sync).

[1] https://review.openstack.org/#/c/433934/

Closes-Bug: #1749640
Change-Id: I816c73405dd61d933182ad5efc24445a0add4eea
2018-02-21 03:40:13 +00:00
shilpa.devharakar f268df1cbc Modify glance manage db sync to use EMC
Modified 'glance-manage db_sync' operation to use
expand, migrate and contract operations.
Added test queens scripts for testing purpose only.

This patch removes use of "monolithic" upgrade scripts
and resolve the issue while upgrading from ocata to pike.

Co-Authored-By: Shilpa Devharakar <Shilpa.Devharakar@nttdata.com>
Closes-Bug: #1723001

Change-Id: I2653560d637a6696f936b49e87f16326fd601dfe
2018-02-05 17:00:57 +05:30
Alexander Bashmakov 15817166ab Fix experimental E-M-C migrations
Two closely related issues were discovered in the code which prevent
the experimental E-M-C (rolling upgrade) migration feature introduced
in Ocata from working: a malformed select statement in the ocata
community images data migration (missing function parentheses)
and an incorrect revision dependency in the DB migration (should be
'ocata_expand01' instead of 'expand'. Also added a test for the case
where the Glance database is new/empty which illuminated this bug.

Closes-Bug: 1670409
Change-Id: I40ffaaa3fa2bae7a555a86d9f31422d79fb9bb19
2017-03-06 21:45:56 +00:00
Hemanth Makkapati 9859df2d1f Add expand/migrate/contract migrations for CI
This patch adds equivalent expand/migrate/contract migration scripts for
Community Images. The expand migration
'ocata_expand01_add_visibility.py' creates a new migration branch 'expand'
from the last known migration i.e., 'mitaka02'. Similarly, the contract
migration 'ocata_contract01_drop_is_public.py' creates another new
migration branch called 'contract' from the last known migration.

The data migration 'ocata_migrate01_community_images.py' migrates
all rows in the database at once. There is possibility of performance
degradation while the data migrations are running.

Change-Id: I34f5623d6804e9fe594e6b5b196ea4a162578196
Partially-Implements: blueprint database-strategy-for-rolling-upgrades
Co-Authored-By: Hemanth Makkapati <hemanth.makkapati@rackspace.com>
Depends-On: Ie839e0f240436dce7b151de5b464373516ff5a64
2017-02-02 00:16:04 +00:00