IBM Support

Changing element types in a replicated VOB

Question & Answer


Question

Why are you unable to change the properties of IBM® Rational® ClearCase® element types in a MultiSite® replicated VOB after their creation and how can you create a new element type with the properties you desire using the same element type name?

Cause

In a replicated VOB modifying an element type is prohibited in order to avoid divergence issues.


SCENARIO 1: Changing unused element types in a replicated VOB

You are unable to change the properties of a ClearCase element type in a MultiSite replicated VOB after its creation and wish to create a new element type using the same element type name provided the element type has not been used.


Example
    You created a new element type in a replicated VOB with incorrect parameters.

    Note: Although the example is run on Windows, the same is true on UNIX and Linux.

    Create a new element type in a replicated VOB

    • GUI


    Note: The default Merge type was used.



    • Command Line
    M:\dynamic_view\multisite\filez>cleartool mkeltype -ordinary -supertype file -mergetype user -nc test_eltype
    Created element type "test_type".


    Ooops. You meant to create the element type using the Merge type Never or you attempted to create a custom element type from the GUI.


    Attempts to change the element type results in an error due to this restriction:
    • GUI

    • Command Line
    M:\dynamic_view\multisite\filez>cleartool mkeltype -replace -supertype file -mergetype never -nc test_type
    cleartool: Error: Can't redefine element types when VOB is replicated.
    cleartool: Error: Unable to replace definition of element type "test_type".


    Review technote 1145660 for more details.



    Attempts to remove the element type results in an error due to this restriction:

    • GUI

    • Command Line
    M:\dynamic_view\multisite\filez>cleartool rmtype eltype:test_eltype
    cleartool: Error: Can't delete element types when VOB is replicated.
    cleartool: Error: Unable to remove element type "test_eltype".

    Note: The ClearCase MultiSite Administrator's Guide and the ClearCase Reference Guide on the topic of rmtype (cleartool man rmtype) document that the removal of element types in a replicated VOB is prohibited in order to avoid divergence.


SCENARIO 2: Changing used element types in a replicated VOB

You are unable to change the properties of a ClearCase element type in a MultiSite replicated VOB after its creation (and use) and wish to create a new element type using the same element type name. Information about the steps necessary to change existing elements in the VOB to use the newly created element type are also discussed.



Example
You wish to change the properties of an existing element type in your replica family.

Example: Changing the Merge type behavior from User to Never.


Note:
Although the example below is run on Windows, the same is true on UNIX and Linux.

View the properties of the existing element type in a replicated VOB.

  • GUI



  • Note: The default Merge type was used.


  • Command Line

  • M:\dynamic_view\multisite\filez>cleartool describe eltype:test_eltype
    element type "test_eltype"
    created 02-Mar-07.11:23:33 by jdoe.clearuser@HOST1
    master replica: home@\multisite
    owner: DOM\jdoe
    group: DOM\clearuser
    scope: this VOB (ordinary type)
    type manager: whole_copy (inherited from type "file")
    supertype: file
    meta-type of element: file element
    mergetype: user

View the properties of some element in the VOB using this element type.


  • GUI

  • Command Line

  • M:\dynamic_view\multisite\filez>cleartool describe file999.txt
    version "file999.txt@@\main\1"
    created 07-Jul-06.08:12:41 by jdoe.clearuser@HOST1
    "created by clearfsimport"
    Element Protection:
    User : DOM\jdoe : r--
    Group: DOM\clearuser : r--
    Other: : r--
    element type: test_eltype
    predecessor version: \main\0
    Labels:
    FILEZ


You want to create the element type using the Merge type Never.



Attempts to change the element type results in an error due to this restriction:
  • GUI

  • Command Line

  • M:\dynamic_view\multisite\filez>cleartool mkeltype -replace -supertype file -mergetype never -nc test_type
    cleartool: Error: Can't redefine element types when VOB is replicated.
    cleartool: Error: Unable to replace definition of element type "test_type".


    Review technote 1145660 for more details.

Answer

The only alternative is to create a new element type that has the features you wish to utilize.




FOR SCENARIO 1:

IMPORTANT: The assumption here is that the element type was created in a replicated VOB incorrectly. Attempts to make any corrections after the element type is created will fail due to the restriction. This workaround assumes that the element type has not yet been used.

** If you have already used the element type in your replicated VOB and wish to change the element type properties, follow the instructions in Scenario 2.


WORKAROUND:

The following workaround can be used to create a new element type in a replicated VOB using the same name of an existing element type.

  1. Rename the <incorrect> element type

    Note:
    Review the ClearCase Command Reference Guide on the topic of rename (cleartool man rename) for more information.

  2. Lock -obsolete the <incorrect> element type

    Note:
    Review the ClearCase Command Reference Guide on the topic of lock (cleartool man lock) for more information.

  3. Create the new element type with the same name

    Note:
    Review the ClearCase Command Reference Guide on the topic of mkeltype (cleartool man mkeltype) for more information.

  4. Replicate to ALL sites in the family

    Note:
    Review the MultiSite Command Reference Guide on the topic of syncreplica (multitool man syncreplica) for more information.
Example


    1) RENAME
    • GUI



    • Command Line
    M:\dynamic_view\multisite\filez>cleartool rename eltype:test_eltype test_eltype_old
    Renamed element type from "test_eltype" to "test_eltype_old".


    2) LOCK
    • GUI



    • Command Line
    M:\dynamic_view\multisite\filez>cleartool lock -obsolete eltype:test_eltype_old
    Locked element type "test_eltype_old".


    3) CREATE NEW ELEMENT TYPE

    Note:
    You must create custom element types from the command line.

    Any element type created from the GUI will use only the default configuration:
    • Ordinary
    • Supertype of file
    • Type Manager merge method
    • Command Line
    M:\dynamic_view\multisite\filez>cleartool mkeltype -ordinary -supertype file -mergetype never -nc test_eltype
    Created element type "test_eltype".

    Note: You can verify the Properties from the GUI once created:


    4) SYNCHRONIZE WITH SIBLING REPLICAS


FOR SCENARIO 2:

IMPORTANT: The assumption here is that the element type was created in a replicated VOB correctly, was associated to elements and then later changes needed to be made. Attempts to make any corrections after the element type is created will fail due to the restriction. This workaround assumes that the element type is currently in use.

** If you have NOT already used the element type in your replicated VOB and wish to change the element type properties, follow the instructions in Scenario 1.



WORKAROUND:

The following workaround can be used to create a new element type in a replicated VOB using the same name of an existing element type while re-associating the new element type to the existing elements.

  1. Rename the element type

    Note: Review the ClearCase Command Reference Guide on the topic of rename (cleartool man rename) for more information.

  2. Create the new element type with the same name with necessary features (for example Never Merge)

    Note: Review the ClearCase Command Reference Guide on the topic of mkeltype (cleartool man mkeltype) for more information.

    IMPORTANT: If you choose to use a different name than the one already in use, you may need to take additional action to update your magic file to reflect the element type in order to correctly associate the new type to files upon creation. Review technote 1122471 for more information.

  3. Change the element type of the existing elements to the new element type using the cleartool find command.

    Note:
    Review the ClearCase Command Reference Guide on the topic of chtype (cleartool man chtype) and find (cleartool man find) for more information.

    Find Example: (top = Windows | bottom = UNIX/Linux)

    cleartool find . -all -element eltype(<old-eltype-name>) -exec "cleartool chtype test_type \"%CLEARCASE_PN%\""


    cleartool find . -all -element eltype(<old-eltype-name>) -exec 'cleartool chtype test_type $CLEARCASE_PN'

  4. Lock -obsolete the old element type

    Note:
    Review the ClearCase Command Reference Guide on the topic of lock (cleartool man lock) for more information.

  5. Replicate to ALL sites in the family

    Note:
    Review the MultiSite Administrators Guide on the topic of syncreplica (multitool man syncreplica) for more information.

Example
1) RENAME
  • GUI



  • Command Line

  • M:\dynamic_view\multisite\filez>cleartool rename eltype:test_eltype test_eltype_old
    Renamed element type from "test_eltype" to "test_eltype_old".


2) CREATE NEW ELEMENT TYPE

IMPORTANT:
You must create custom element types from the command line.

Any element type created from the GUI will use only the default configuration:
  • Ordinary
  • Supertype of file
  • Type Manager merge method
  • Command Line

  • M:\dynamic_view\multisite\filez>cleartool mkeltype -ordinary -supertype file -mergetype never -nc test_eltype
    Created element type "test_eltype".
    Note: You can verify the Properties from the GUI once created:



3) CHANGE THE ELEMENT TYPE OF EXISTING ELEMENTS

Note:
There is no method to find or change the element types all at one time from the GUI.
  • Command Line

Preview list of element types:

M:\dynamic_view\multisite\filez>cleartool find . -all -element eltype(test_eltype_old) -print
M:\dynamic_view\multisite\filez\file999.txt@@


Execute change:

M:\dynamic_view\multisite\filez>cleartool find . -all -element eltype(test_eltype_old) -exec "cleartool chtype test_eltype \"%CLEARCASE_PN%\""
Changed type of element "M:\dynamic_view\multisite\filez\file999.txt" to "test_eltype".


4) LOCK OLD ELEMENT TYPE
  • GUI



  • Command Line

  • M:\dynamic_view\multisite\filez>cleartool lock -obsolete eltype:test_eltype_old
    Locked element type "test_eltype_old".


5) SYNCHRONIZE WITH SIBLING REPLICAS

[{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"VOB","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.0;7.0.1;7.1;7.1.1;7.1.2","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21148740