Fixing System Clock Discrepancies

The sections below describe schemes for dealing with discrepancies between system clocks in the AccuRev client-server environment. We begin with the more desirable scheme: automatic, smooth clock adjustment. Then we describe the less desirable scheme: manual, sudden clock adjustment.

Automatic, Gradual Convergence of System Clocks

An optimal scheme for synchronizing machines’ system clocks has these attributes:

  • All machines in the network participate in the scheme, so the entire network is kept synchronized.

  • Each machine’s system clock is adjusted automatically (perhaps requiring some initial installation or configuration task).

  • System clock adjustments can be made smoothly: for example, a discrepancy of 10 seconds can be gradually eliminated over the span of a few minutes by a minor speed-up or slow-down of a machine’s clock. Presumably, such adjustments are imperceptible to human users and won’t cause any “surprises” in time-sensitive applications.

Synchronization systems fitting this description are typically based on the standard Network Time Protocol (NTP) or its variant, the Simple Network Time Protocol (SNTP). For example, the Windows Time Service is available on recent versions of Windows. It provides a complete solution if all machines in your network are running Windows. For a more general, multi-platform solution, see the Network Time Protocol (http://www.ntp.org).

AccuRev-Related Guidelines

Following are guidelines for using a gradual-convergence system in an AccuRev network:

  • Configure the system so that a single machine in the network acts as the time source that other machines synchronize with.

  • Ideally, have all AccuRev machines participate in the synchronization system.

  • If this isn’t possible, make sure that the AccuRev server machine participates in the synchronization system. (AccuRev itself will take care of synchronizing its client machines to the server machine; see the next section.)

The purpose of these guidelines is to ensure that no AccuRev client machine gets into a situation of synchronizing itself with two different, and possibly conflicting, machines: the AccuRev server machine and a separate time-source machine.

Back to top

Manual Synchronization Tools

A less desirable scheme for keeping system clocks synchronized is to occasionally type clock-adjustment commands manually on one or more of the machines. This method can be improved a bit by using scripts and scheduling tools such as cron (UNIX/Linux) and at (Windows). Only the root user (UNIX/Linux) or a user with administrator privileges (Windows) can set the system clock manually.

Setting the System Clock on the AccuRev Server Machine

On a UNIX/Linux machine, the date command changes the system clock. What time should you set the clock to? In many cases, you can use rsh or telnet to determine the time on another “time source” machine.

On a Windows machine, use the net time command to synchronize with a specified “time source” machine, or with the domain controller machine. To set the clock to a particular time, use the date command in a Command Prompt window, or double-click the digital clock in the Windows taskbar (lower-right corner of the screen).

Setting the System Clock on AccuRev Client Machines

The accurev synctime command changes a client machine’s system clock to match the clock on the AccuRev server machine. The GUI command is Tools > Synchronize Time.

Back to top