8.6 Changing Mastership

When you create an object in a replicated VOB, your current replica is the new object's master. You can transfer mastership of the object to another replica, using the chmaster command or the Properties Browser (Windows). Some examples of when this is appropriate:

Mastership changes are communicated among replicas by the standard synchronization mechanism. The general procedure for changing mastership is as follows:

  1. Change mastership of one or more objects to another replica or request mastership of a branch or branch type.

  2. Export and send an update packet from the old master replica to the new master replica. (The reqmaster command does this automatically.)

  3. Import the update packet at the new master replica.

Until the update packet containing the mastership change is imported at the new master replica, mastership is "in the packet" and the replicas in the VOB family have different information about which replica masters the object.

For example, the administrator at the sanfran_hub replica transfers mastership of the bugfix branch to the bangalore replica, and then exports an update packet. At this point:

When you complete the mastership transfer by importing the update packet at bangalore, developers at bangalore are able to create new versions on the branch.

Notes on mastership changes:

The following sections describe how to change mastership of ClearCase objects. These procedures use the command line. For information about using the Properties Browser on Windows to transfer mastership of a ClearCase object, see the MultiSite online help:

  1. Click Start > Programs > Rational ClearCase Administration > MultiSite Help.

  2. On the Contents tab of the Help Contents Window, click Administrator Tasks > To change mastership of a ClearCase object.

Transferring Mastership of a Type Object

When you create a type object, it is mastered by the replica where you create it. Except for elements, instances of an unshared type can be created only at the master replica. Elements can be created at any replica, regardless of which replica masters the element type. Instances of shared types can be created at any replica (for more information, see Type Object Mastership).

NOTE: If you transfer mastership of a branch type to another replica, mastership of explicitly mastered branches of that type is not transferred, even if the same replica masters the branch type and the branch. To give such branches default mastership, see the procedure in Removing Explicit Mastership of a Branch.

To transfer mastership of a type object:

  1. Determine which replica masters the type object:

  2. multitool describe lbtype:TOKYO_BASE@/vobs/dev
    label type "TOKYO_BASE"
    created 15-Aug-00.14:20:26 by Susan Goechs (susan.user@minuteman)
    master replica: boston_hub@/vobs/dev
    ...

  3. At the master replica, enter a chmaster command:

  4. MINUTEMAN% multitool chmaster -c "transfer to sanfran_hub" \
    sanfran_hub@/vobs/dev lbtype:TOKYO_BASE@/vobs/dev

    Changed mastership of label type "TOKYO_BASE" to "sanfran_hub@/vobs/dev"

  5. At the old master replica, export an update packet to the new master replica's site:

  6. MINUTEMAN% multitool syncreplica -export -fship sanfran_hub@/vobs/dev
    Generating synchronization packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_26-Aug-00.18.15.57_74 30_1
    - shipping order file is /usr/atria/shipping/ms_ship/outgoing/sh_o_sync_boston_hub_26-Aug-00.18.15. 57_7430_1
    Attempting to forward/deliver generated packets...
    -- Forwarded/delivered packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_26-Aug-00.18.15.57_74 30_1

  7. At the new master replica, import the packet:

  8. BAGUETTE% multitool syncreplica -import -receive
    Applied sync. packet /usr/atria/shipping/ms_ship/incoming/sync_boston_hub_26-Aug-00.18.15.57_74 30_1 to VOB /net/goldengate/vobstg/dev.vbs

  9. At the new master replica, verify that mastership has been received:

  10. BAGUETTE% multitool describe lbtype:TOKYO_BASE@/vobs/dev
    label type "TOKYO_BASE"
    created 15-Aug-00.14:20:26 by Susan Goechs (susan.user@minuteman)
    master replica: sanfran_hub@/vobs/dev
    ...

Transferring Mastership of a Replica Object

When you create a new replica, its replica object is mastered by the replica at which you enter the mkreplica -export command. Mastership of the replica object affects replica-modification activities (renaming the replica, changing its properties, or deleting it). You must perform these activities at the replica that masters the replica object.

A self-mastering replica masters its own replica object. A replica must be self-mastering for you to perform some administrative operations on it (for example, raising the feature level). If each site has its own MultiSite administrator, having self-mastering replicas simplifies replica maintenance because each replica can be maintained at its own site. However, you may want to master all replica objects at a hub replica. In this case, you can transfer mastership to individual sites at the request of the site administrator, and then transfer mastership back to the hub replica after the administrative operation has been completed.

To transfer mastership of a replica object:

  1. Determine which replica masters the replica object, and the host name of the replica's VOB server:

  2. multitool describe replica:sanfran_hub@/vobs/dev
    replica "sanfran_hub"
    created 16-Aug-00.09:49:36 by Susan Goechs (susan.user@minuteman)
    replica type: unfiltered
    master replica: boston_hub@/vobs/dev
    owner: susan
    group: user
    host: "goldengate"
    ...

  3. At the master replica, enter a chmaster command:

  4. MINUTEMAN% multitool chmaster -c "make sanfran_hub replica self-mastering" \
    sanfran_hub@/vobs/dev replica:sanfran_hub@/vobs/dev

    Changed mastership of replica "sanfran_hub" to "sanfran_hub@/vobs/dev"

  5. At the old master replica, export an update packet to the new master replica:

  6. MINUTEMAN% multitool syncreplica -export -fship sanfran_hub@/vobs/dev
    Generating synchronization packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_16-Aug-00.16.15.57_63 89_1
    - shipping order file is /usr/atria/shipping/ms_ship/outgoing/sh_o_sync_boston_hub_16-Aug-00.16.15. 57_6389_1
    Attempting to forward/deliver generated packets...
    -- Forwarded/delivered packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_16-Aug-00.16.15.57_63 89_1

  7. At the new master replica, import the packet:

  8. GOLDENGATE% multitool syncreplica -import -receive
    Applied sync. packet /usr/atria/shipping/ms_ship/incoming/sync_boston_hub_16-Aug-00.16.15.57_63 89_1 to VOB /net/goldengate/vobstg/dev.vbs

  9. At the new master replica, verify that mastership has been received:

  10. GOLDENGATE% multitool describe replica:sanfran_hub@/vobs/dev
    replica "sanfran_hub"
    created 16-Aug-00.09:49:36 by Susan Goechs (susan.user@minuteman)
    replica type: unfiltered
    master replica: sanfran_hub@/vobs/dev
    ...

Transferring Mastership of a VOB

When you replicate a VOB for the first time, the VOB is mastered by the original replica. You must perform the following operations at the VOB's master replica:

To transfer mastership of a VOB to another replica, follow these steps:

  1. At the master replica, enter a chmaster command:

  2. MINUTEMAN% multitool chmaster sanfran_hub vob:/vobs/dev
    Changed mastership of versioned object base "/vobs/dev" to "sanfran_hub".

  3. At the old master replica, export an update packet to the new master replica's site:

  4. MINUTEMAN% multitool syncreplica -export -fship sanfran_hub@/vobs/dev
    Generating synchronization packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_20-Sep-00.17.35.45_22 513_1
    - shipping order file is /usr/atria/shipping/ms_ship/outgoing/sh_o_sync_boston_hub_20-Sep-00.17.35. 45_22513_1
    Attempting to forward/deliver generated packets...
    -- Forwarded/delivered packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_20-Sep-00.17.35.45_22 513_1

  5. At the new master replica, import the packet:

  6. GOLDENGATE% multitool syncreplica -import -receive
    Applied sync. packet /usr/atria/shipping/ms_ship/incoming/sync_boston_hub_20-Sep-00.17.35.45_22 513_1 to VOB /net/goldengate/vobstg/dev.vbs

  7. At the new master replica, verify that mastership has been received:

  8. GOLDENGATE% multitool describe -fmt "%n\t%[master]p\n" vob:/vobs/dev
    /vobs/dev sanfran_hub@/vobs/dev

Transferring Mastership of an Element

When you create a new element, it is mastered by the replica in which you create it. You must perform the following element operations at the element's master replica:

To transfer mastership of an element to another replica, follow these steps:

  1. At the master replica, enter a chmaster command:

  2. MINUTEMAN% multitool chmaster bangalore tests.txt@@
    Changed mastership of file element "tests.txt@@" to "bangalore"

  3. At the old master replica, export an update packet to the new master replica's site:

  4. MINUTEMAN% multitool syncreplica -export -fship bangalore@/vobs/dev
    Generating synchronization packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_07-Dec-00.18.15.57_59 78_1
    - shipping order file is /usr/atria/shipping/ms_ship/outgoing/sh_o_sync_boston_hub_07-Dec-00.18.15. 57_5978_1
    Attempting to forward/deliver generated packets...
    -- Forwarded/delivered packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_07-Dec-00.18.15.57_59 78_1

  5. At the new master replica, import the packet:

  6. RAMOHALLI> multitool syncreplica -import -receive
    Applied sync. packet C:\Program Files\Rational\ClearCase\var\shipping\ms_ship\incoming\sync_boston_hub_07- Dec-00.18.15.57_5978_1 to VOB \\ramohalli\vobs\dev.vbs

  7. At the new master replica, verify that mastership has been received:

  8. RAMOHALLI> multitool describe -fmt "%n\t%[master]p\n" tests.txt@@
    tests.txt@@ bangalore@\dev

Transferring Mastership of a Branch

This section describes how to change mastership of a branch using the chmaster command. For information about enabling use of the reqmaster command, see Chapter 9, Implementing Requests for Mastership.

Transferring Branch Mastership

To transfer mastership of a branch to another replica:

  1. At the master replica, enter a chmaster command:

  2. MINUTEMAN% multitool chmaster -c "bugfix at bangalore" bangalore Makefile@@/main
    Changed mastership of branch "Makefile@@/main" to "bangalore"

  3. At the old master replica, export an update packet to the new master replica's site:

  4. MINUTEMAN% multitool syncreplica -export -fship bangalore@/vobs/dev
    Generating synchronization packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_10-Dec-00.18.15.57_30 56_1
    - shipping order file is /usr/atria/shipping/ms_ship/outgoing/sh_o_sync_boston_hub_10-Dec-00.18.15. 57_3056_1
    Attempting to forward/deliver generated packets...
    -- Forwarded/delivered packet /usr/atria/shipping/ms_ship/outgoing/sync_boston_hub_10-Dec-00.18.15.57_30 56_1

  5. At the new master replica, import the packet:

  6. RAMOHALLI> multitool syncreplica -import -receive
    Applied sync. packet C:\Program Files\Rational\ClearCase\var\shipping
    \ms_ship\incoming\sync_boston_hub_10-Dec-00.18.15.57_3056_1 to VOB \\ramohalli\vobs\dev.vbs

  7. At the new master replica, verify that mastership has been received:

  8. RAMOHALLI> multitool describe -fmt "%n\t%[master]p\n" Makefile@@\main
    Makefile@@\main bangalore@\dev

Removing Explicit Mastership of a Branch

As described in Default and Explicit Branch Mastership, a branch can have default or explicit mastership. After you follow the steps in Transferring Branch Mastership, the branch has explicit mastership. When you transfer mastership of a branch type to another replica, mastership is transferred for all branches with default mastership, but not for branches with explicit mastership.

To return mastership of a branch to the replica that masters the branch type:

  1. At the replica that masters the branch, enter a chmaster -default command:

  2. RAMOHALLI> multitool chmaster -default Makefile@@\main
    Changed mastership of branch "Makefile@@\main" to "default"

  3. Determine which replica masters the branch type:

  4. RAMOHALLI> multitool describe -fmt "%n\t%[master]p\n" brtype:main
    main boston_hub@\dev

    If your current replica masters the branch type, stop here. If another replica masters the branch type, continue with Step #3.

  5. Export an update packet to the replica that masters the branch type:

  6. RAMOHALLI> multitool syncreplica -export -fship boston_hub@\dev
    Generating synchronization packet C:\Program Files\Rational\ClearCase\var\shipping\ms_ship\outgoing\sync_bangalore_11-D ec-00.18.15.57_9476_1
    - shipping order file is /usr/atria/shipping/ms_ship/outgoing/sh_o_sync_bangalore_11-Dec-00.18.15.5 7_9476_1
    Attempting to forward/deliver generated packets...
    -- Forwarded/delivered packet /usr/atria/shipping/ms_ship/outgoing/sync_bangalore_11-Dec-00.18.15.57_947 6_1

  7. At the replica that masters the branch type, import the packet:

  8. MINUTEMAN% multitool syncreplica -import -receive
    Applied sync. packet /usr/atria/shipping/ms_ship/incoming/sync_bangalore_11-Dec-00.18.15.57_947 6_1 to VOB /net/minuteman/vobstg/dev.vbs

  9. At the replica that masters the branch type, verify that the branch has default mastership:

  10. MINUTEMAN% multitool describe Makefile@@/main
    branch "Makefile@@/main"
    created 27-Aug-00.13:41:21 by Gail Smith (gail.user@boston20)
    branch type: main
    master replica: boston_hub@/vobs/dev (defaulted)

The other form of the chmaster -default command applies to branches that are explicitly mastered by the replica that masters the branch type. To give these branches default mastership, enter a chmaster -default command and specify the branch type:

MINUTEMAN% multitool chmaster -default brtype:main
Changed mastership of branch type "main" to "default"

Transferring Mastership of a Stream

The chmaster -stream command transfers mastership of a stream and its associated objects. For example, to transfer mastership of the stream v2.1.bl5 and its associated objects to the boston_hub replica:

multitool chmaster -stream boston_hub@/vobs/dev stream:v2.1.bl5@/vobs/dev

In some cases, you must manually change mastership of branch types or activities associated with a stream. The output of the chmaster command includes a list of these objects. The output may also include an instruction to run the chmaster -stream command with the -override option. This option transfers mastership of objects whose mastership was not transferred during the original invocation of the command.

CAUTION: Do not use -override unless the output of chmaster -stream indicates that you should do so.

Transferring Mastership of All Objects Mastered by a Replica

Before removing a replica, you must transfer mastership of all objects mastered by that replica. For detailed instructions, see Deleting a Replica.

The following example shows a partially successful chmaster -all command and describes how to fix it. In this example, the administrator at replica bangalore is transferring mastership to boston_hub.

RAMOHALLI> multitool chmaster -all -long boston_hub@\dev
Changed mastership of versioned object base \dev\
Changed mastership of directory element \dev\.@@
Changed mastership of directory element \dev\lost+found@@
...
multitool: Error: Branch type "bangalore_main" has branches (with default mastership) that have outstanding checkouts.
Changed mastership of branch type v1.0_bugfix
...
multitool: Error: Lock on label type "V1.0_BUGFIX" prevents operation "change master".
Changed mastership of label type BANGALORE_V2.0
...
Changed mastership of replica bangalore
multitool: Warning: Not all objects had mastership changed.

These errors prevent the successful completion of this chmaster command:

To fix these problems:

  1. Find the checkouts and either check in the files or cancel the checkouts:

  2. H:\dev> cleartool lscheckout -all
    03-Jun.17:28 jk checkout version "\dev\cmdsyn.c" from \main\bangalore_main\83 (unreserved)
    08-Jun.12:45 singh checkout version "\dev\etc\util\tool.c" from \main\bangalore_main\22 (unreserved)
    ...

    See the checkin, checkout and uncheckout reference pages.

  3. Unlock the type object.

  4. cleartool unlock lbtype:V1.0_BUGFIX@\dev
    Unlocked label type "V1.0_BUGFIX".

    Alternatively, enter a lock -replace -nusers command and add yourself to the -nusers list.

    cleartool lock -replace -nusers ms_admin lbtype:V1.0_BUGFIX@\dev
    Locked label type "V1.0_BUGFIX".

  5. Reenter the chmaster command.

  6. RAMOHALLI> multitool chmaster -all -long boston_hub@\dev
    Changed mastership of branch type bangalore_main
    Changed mastership of label type V1.0_BUGFIX
    Changed mastership of all objects.

Fixing an Accidental Mastership Change

If a mastership change is made in your replica by mistake, follow these steps to undo the change:

  1. At your replica, complete the transfer by sending an update packet to the new master replica.

  2. At the new master replica, complete these steps:

    1. Import the packet.

    2. Change mastership back to your replica.

    3. Export an update packet to your replica.

  3. At your replica, import the packet.