Generates or applies update packets
Product | Command type |
---|---|
MultiSite | multitool subcommand |
Platform |
---|
UNIX |
Windows |
Export an update packet:
Import an update packet:
Synchronization of an existing VOB replica with one or more replicas at other sites is a two-phase process:
At one site, a syncreplica -export command creates an update packet that contains changes that have occurred in the VOB replica at that site (and perhaps other replicas, as well).
At another site, a syncreplica -import command applies the changes in the update packet to its replica of the same VOB.
Step #2 occurs at all sites that receive the packet.
All changes that have occurred in the current VOB replica since the last update generated for the destination replicas. (Changes already sent to the destination replicas are excluded from the packet).
Changes that have occurred in other replicas, which the current replica has received in previous update packets from those replicas, but has not already passed on to the destination replicas.
In all cases, syncreplica -export creates a single logical update packet for use at all the specified destinations; the packet can be used to update only those particular replicas.
MultiSite is designed for efficient updating of replicas. syncreplica -export attempts to exclude from an update packet operations that have been sent previously. (However, there is no harm in sending an operation multiple times to the same replica; the first operation is imported and subsequent identical operations are ignored.)
The VOB replica is not locked during the export phase; in fact, the syncreplica -export command fails if the VOB is locked. Therefore, you must not schedule synchronizations during VOB backups (when the VOB must be locked). See also RETRYING SYNCHRONIZATION WHEN THE VOB IS LOCKED.
syncreplica -export stores temporary files in the directory specified by the TMPDIR environment variable on UNIX and the TMP environment variable on Windows. If you use the sync_export_list script to export update packets, you can use the -workdir option to specify the directory.
An update packet is applied to the appropriate replica on the host on which you import it, unless you restrict processing with the -invob argument. syncreplica consults the VOB registry in the current region to determine the locations of these replicas' storage directories. Thus, you do not have to specify particular replicas or storage locations.
The import process applies update packets in the correct order. Therefore, you can specify packets in any order on the command line.
The VOB replica is not locked during the import phase. Synchronization fails if the VOB is locked. See also RETRYING SYNCHRONIZATION WHEN THE VOB IS LOCKED.
syncreplica -import stores temporary files in the directory specified by the TMPDIR environment variable on UNIX and the TMP environment variable on Windows. If you use the sync_receive script to import update packets, you can use the -workdir option to specify the directory.
syncreplica -import refuses to process an update packet in the following situations:
The update packet contains changes that depend on other changes that have not yet been applied to this replica. This usually means that an update packet destined for this replica has not been sent or was lost during transport.
Problems were encountered processing an earlier physical packet in a multiple-part logical packet.
In any of these cases, syncreplica -import displays an explanatory message.
In some cases, syncreplica -import begins to apply operations to a replica, but fails with an error message. For example, another process may have locked the VOB, causing the import to fail. After the VOB is unlocked, you can run syncreplica -import to process the entire update packet again.
There is no harm in importing update packets that have already been processed successfully; the same change will not be made twice. Thus, even importing an entire update packet multiple times causes no error and does no harm.
For more information about update failures, see Chapter 10, Troubleshooting MultiSite Operations.
If a single invocation of syncreplica -import applies a packet successfully to all target replicas on the host, the update packet is deleted when the command completes its work. If the packet is processed with multiple syncreplica -import -invob commands, it is not deleted.
If a VOB replica is ownership-preserving, syncreplica -import maintains the consistency of ownership and permissions information for elements mastered by the VOB family's ownership-preserving replicas. For each such element, an error occurs if the element's group is not on the group list of the importing replica (on UNIX) or is not the same as the group of the importing replica (on Windows).
If a VOB replica is not ownership-preserving, changes to ownership and permissions of existing elements are ignored during import. New elements are assigned to the owner of the VOB at the current site, and the group of all new elements is the primary group of the owner of the VOB. (This is true even if the root user or a member of the ClearCase administrators group imports the packet.) Permissions set when the element is created are preserved, but subsequent permissions changes are ignored. Ownership and permissions changes made at non-ownership-preserving replicas are not propagated to other replicas.
Data containers from the update packets are placed in storage pools according to the standard element assignments. If the pool assignment for a new element cannot be determined, the element is assigned to the VOB's default source pool.
ClearCase triggers do not fire in response to changes made during packet import.
syncreplica resolves naming conflicts among type objects created at different replicas. For more information, see Conflict Resolution.
syncreplica does not inform any views (not even the view from which you enter the command) of the updates to replicas. All active views see updates within a few seconds, through their normal VOB-polling routines. You can force a view to recognize VOB updates by entering a cleartool setcs -current command.
By default, synchronization exports and imports fail if the VOB is locked. To allow syncreplica to retry a synchronization when it encounters a lock, set the CLEARCASE_VOBLOCKWAIT environment variable to the amount of time (in minutes) for syncreplica to keep trying to write to the VOB. During that time, syncreplica retries the write operation every minute. If the time elapses and the VOB is still locked, syncreplica exits with an error.
NOTE: The syncreplica command waits only if it detects the lock before it starts processing oplogs. If an administrator locks the VOB during oplog processing, syncreplica exits with an error.
Identities: You must have one of the following identities:
VOB owner
root (UNIX)
Member of the ClearCase administrators group (Windows)
Locks: An error occurs if one or more of these objects are locked: VOB.
Mastership: No mastership restrictions.
The following sections describe the options and arguments for use with syncreplica -export.
SPECIFYING THE UPDATE PACKET SIZE. Default: When you do not specify -maxsize, the default packet size depends on the shipping method you use:
Packets created with -ship or -fship are no larger than the maximum packet size specified in the shipping.conf file (UNIX) or the MultiSite Control Panel (Windows).
Packets created with -out are no larger than 2 GB.
Packets created with -tape have no default size limit.
500k | 500 kilobytes |
20m | 20 megabytes |
1.5g | 1.5 gigabytes |
EVENT RECORDS AND COMMENTS. Default: Creates one or more event records, with commenting controlled by the standard ClearCase user profile (default: -nc). See EVENT RECORDS AND COMMENTS in the multitool reference page. To edit a comment, use cleartool chevent.
DISPOSITION OF THE UPDATE PACKET. Default: None. You must specify how the update packets created by syncreplica -export are to be stored and/or transmitted to other sites.
HANDLING PACKET-DELIVERY FAILURES. Default: If a packet cannot be delivered, it is sent through the store-and-forward facility back to the administrator at the site of the originating replica. A mail message is sent to the store-and-forward administrator. This occurs after repeated attempts to deliver the packet have all failed, and the allotted time has expired; it can also occur when the destination host is unknown or a data file does not exist. The store-and-forward configuration settings specify the expiration period and the e-mail address of the administrator.
date | := | day-of-week | long-date |
time | := | h[h]:m[m][:s[s]] [UTC [ [ + | - ]h[h][:m[m] ] ] ] |
day-of-week | := | today |yesterday |Sunday | ... |Saturday |Sun | ... |Sat |
long-date | := | d[d]-month[-[yy]yy] |
month | := | January |... |December |Jan |... |Dec |
SPECIFYING THE DESTINATION REPLICAS. Default: None.
replica-name | Name of the replica (displayed with lsreplica) | |
vob-selector | VOB family of the replica; can be omitted if the current working directory is within the VOB. Specify vob-selector in the form [vob:]pname-in-vob | |
pname-in-vob | Pathname of the VOB-tag (whether or not the VOB is mounted) or of any file-system object within the VOB (if the VOB is mounted) |
The following sections describe the options and arguments for use with syncreplica -import.
RESTRICTING THE UPDATE TO A PARTICULAR VOB. Default: Updates all replicas that are on the current host and are specified in the update packets. With -tape, you must specify a VOB replica to be updated.
pname-in-vob | Pathname of the VOB-tag (whether or not the VOB is mounted) or of any file-system object within the VOB (if the VOB is mounted) |
EVENT RECORDS AND COMMENTS. Default: Creates one or more event records, with commenting controlled by the standard ClearCase user profile (default: -nc). See EVENT RECORDS AND COMMENTS in the multitool reference page. To edit a comment, use cleartool chevent.
SPECIFYING THE LOCATION OF THE UPDATE PACKETS. Default: None.
Generate an update packet to be sent to replica boston_hub. Store the packet in a file in directory c:\tmp.
multitool syncreplica -export -out c:\tmp\boston_hub_packet1 boston_hub@\dev
Generating synchronization packet c:\tmp\boston_hub_packet1
Similar to preceding example, but place the packet file in a storage bay, for shipping at some later time by the store-and-forward facility.
multitool syncreplica -export -ship boston_hub@\dev
Generating synchronization packet c:\Program Files\Rational\ClearCase\var
\shipping\ms_ship\outgoing\sync_bangalore_19-May-99.09.33.02_3447_1
- shipping order file is c:\Program
Files\Rational\ClearCase\var\shipping\ms_ship\outgoing\sh_o_sync_bangalore
_19-May-99.09.33.02_3447_1
Similar to preceding example, but ship the packet immediately.
multitool syncreplica -export -fship boston_hub@\vob2
Generating synchronization packet c:\Program Files\Rational\ClearCase\var
\shipping\ms_ship\outgoing\sync_bangalore_19-May-99.09.33.02_3447_1
- shipping order file is c:\Program
Files\Rational\ClearCase\var\shipping\ms_ship\outgoing\sh_o_sync_bangalore
_19-May-99.09.33.02_3447_1
Attempting to forward/deliver generated packets...
-- Forwarded/delivered packet c:\Program Files\Rational\ClearCase\var
\shipping\ms_ship\sync_bangalore_19-May-99.09.33.02_3447_1
Process an incoming update packet in directory /usr/tmp.
multitool syncreplica -import /usr/tmp/boston_hub_packet1
Applied sync. packet /usr/tmp/boston_hub_packet1 to VOB
/net/minuteman/vobstg/dev.vbs
Process all incoming update packets in the current host's storage bays.
multitool syncreplica -import -receive
Applied sync. packet c:\Program Files\Rational\ClearCase\var
\shipping\ms_ship\incoming\sync_boston_hub_19-May-99.09.45.01_7634_1
to VOB \\ramohalli\vobs\dev.vbs
mkorder, mkreplica, MultiSite Control Panel, shipping.conf, sync_export_list
Chapter 10, Troubleshooting MultiSite Operations
Feedback on the documentation in this site? We welcome any comments!
Copyright © 2001 by Rational Software Corporation. All rights reserved. |