trafodion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberta Marton <roberta.mar...@esgyn.com>
Subject RE: Metadata changes?
Date Wed, 13 Jan 2016 17:35:14 GMT
There is a procedure for making a metadata changes.  It does require a
metadata version update.  If you plan to do an upgrade, I would like to add
a security change, if possible, at the same time.

I have done this successfully but it has been awhile.

The upgrade steps are documented in ../sql/sqlcomp/CmpSeabaseDDLupgrade.h.
I have included them here with a few adjustments for your enjoyment:

Steps needed to upgrade metadata:

The current metadata version is at 1.1 (the metadata version is different
than the product version).
Version information is stored in "_MD_".VERSIONS.

Current version information (described in CmpSeabaseDDLincludes.h):
METADATA_MAJOR_VERSION = 1,
METADATA_OLD_MAJOR_VERSION = 3,
METADATA_MINOR_VERSION = 1,
METADATA_UPDATE_VERSION = 0,
METADATA_OLD_MINOR_VERSION = 0,
METADATA_OLD_UPDATE_VERSION = 0,

Assume upgrade is being done from v1.1 to v1.2:

Let's assume that the metadata table COLUMNS is being changed.

CmpSeabaseDDLmd.h
   -- move current definition of metadata table that is being changed
     to START_OLD_MD_v11 section.
   -- Change name to *_OLD_MD.  (Ex: SEABASE_COLUMNS_OLD_MD)
   -- Change definition name to seabaseOldMDv11* (Ex:
seabaseOldMDv11ColumnsDDL)
   -- modify current definition to reflect new definition(Ex:
seabaseColumnsDDL)

CmpSeabaseDDLupgrade.h
-- in struct allMDupgradeInfo,
   modify entry for  the table whose definition is being changed
       -- add old defn, insert/select col list, added/dropped col flag, etc.
  -- see struct MDUpgradeInfo for details on what fields need to be
modified.

CmpSeabaseDDLincludes.h
-- modify enum METADATA_MAJOR/MINOR, OLD_MAJOR/MINOR versions as follows:
METADATA_MAJOR_VERSION = 1,
METADATA_OLD_MAJOR_VERSION = 1,
METADATA_MINOR_VERSION = 2,
METADATA_UPDATE_VERSION = 0,
METADATA_OLD_MINOR_VERSION = 1,
METADATA_OLD_UPDATE_VERSION = 0,

CmpSeabaseDDLcommon.cpp and other files:
-- modify insert/select statements that access the changed metadata table.

CmpSeabaseDDLupgrade.cpp
-- In method CmpSeabaseMDupgrade::executeSeabaseMDupgrade
  -- modify CUSTOMIZE_NEW_MD case if something specified need to be done.
    Ex: update new sql_data_type field in COLUMNS table

The command to run is initialize trafodion, upgrade.  (Personally, I would
like to change this command to be more reflective of the operation)
You can also add special options to the initialize trafodion command to test
your upgrade operation prior to making the version change.
For example, "initialize trafodion, create schema objects;" was used to test
adding schema objects to the metadata.

To test, you might want to take a snapshot of your old metadata.  Make the
change.
If you want to retest, just restore the snapshot to get the metadata back to
where it was originally.

    Roberta

-----Original Message-----
From: Dave Birdsall [mailto:dave.birdsall@esgyn.com]
Sent: Tuesday, January 12, 2016 3:53 PM
To: dev@trafodion.incubator.apache.org
Subject: Metadata changes?

Hi,



I’m designing a feature that involves a small metadata change.



What are the rules for changing metadata in Trafodion? Is there a versioning
scheme I need to be aware of? Also, automatic upgrade of metadata to
consider?



Thanks,



Dave

Mime
View raw message