Global types and mastership

Restrictions on the creation of global types prevent creation of conflicting types at multiple sites.

About this task

You can create a local copy of a global type only if the global type is mastered by a replica at the current site. If the global type is not mastered at the current site, you can create instances of the type in a local replica only if the replica already contains a local copy of the type. This restriction applies even if your current replica masters the object to which you are attaching the instance of the type.

If a VOB at your site does not contain a local copy of the type, you must take this action:
  1. Create a local copy at the site that masters the type.
  2. Export an update packet from the replica at the mastering site to the replica at your site.
  3. Import the packet at your site.

For example (see Replication requirements of administrative VOB hierarchies), an engineer at your site (San Francisco) tries to apply the RELEASE-2.1 label to a version in the \dev VOB. The command fails because the label type is a global type mastered at a different site and no local copy exists in \dev.

cleartool mklabel –nc RELEASE-2.1 \dev\file.txt
cleartool: Error: Type must be mastered in original replica "SFO" to use copy type.
cleartool: Error: Unable to create label "RELEASE-2.1" on
"\dev\file.txt" version "/main/3".

To create a local copy of the type in the replica at your site, use the following procedure.

Procedure

  1. Determine the tag of the administrative VOB where the global type is defined.

    cleartool describe vob:\dev
    versioned object base "\dev"
    ...
      Hyperlinks:
        AdminVOB -> vob:\admin

  2. Determine which replica of the administrative VOB masters the type.
    The following command describes a global type in a replicated VOB. Note that because the master replica of the type is in a different VOB family than the replica in which you enter the command, the output includes, in addition to the replica name, a master replica line that displays the VOB tag of the master replica.

    cleartool describe –long lbtype:RELEASE-2.1@\admin
    label type "RELEASE-2.1"
      created 03-Aug-02.12:29:00 by Pete Sharon (pds.user@argon)
      master replica: BOS@\admin
      instance mastership: shared
      owner: pds
      group: user
      scope: global
      constraint: one version per branch
      Hyperlinks:
        GlobalDefinition@43@\admin <- lbtype:RELEASE-2.1@\admin

  3. At the site where the type is mastered, create a local copy of the type.

    cleartool cptype –c "forced local copy" lbtype:RELEASE-2.1@\admin \
    lbtype:RELEASE-2.1@\dev

    Copied type "RELEASE-2.1".

  4. At the site where the type is mastered, export an update packet to the replica at your site.

    multitool syncreplica –export –fship SFO@\dev

  5. At your site, import the update packet.

    multitool syncreplica –import –receive

Results

After the packet is imported, you can create the label:

cleartool mklabel –nc RELEASE-2.1 \dev\file.txt
Created label "RELEASE-2.1" on "\dev\file.txt" version "/main/3".