Berkeley DB: DB_ENV->rep_set_clockskew
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++

FOOO

DB_ENV->rep_set_clockskew |

`

    #include <db.h>

    int
    DB_ENV->rep_set_clockskew(DB_ENV *env,
        u_int32_t fast_clock, u_int32_t slow_clock);

    int
    DB_ENV->rep_get_clockskew(DB_ENV *env,
        u_int32_t *fast_clockp, u_int32_t *slow_clockp);

Description: DB_ENV->rep_set_clockskew

The DB_ENV->rep_set_clockskew method sets the clock skew ratio among replication group members based on the fastest and slowest measurements among the group for use with master leases. Calling this method is optional, the default values for clock skew assume no skew. The user must also configure leases via the DB_ENV->rep_set_config method. Additionally, the user must also set the master lease timeout via the DB_ENV->rep_set_timeout method and the number of sites in the replication group via the DB_ENV->rep_set_nsites method. These methods may be called in any order. For a description of the clock skew values, see Clock skew. For a description of master leases, see Master leases.

These arguments can be used to express either raw measurements of a clock timing experiment or a percentage across machines. For instance a group of sites have a 2% variance, then fast_clock should be given as 102, and slow_clock should be set at 100. Or, for a 0.03% difference, you can use 10003 and 10000 respectively.

The database environment's replication subsystem may also be configured using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "rep_set_clockskew", one or more whitespace characters, and the clockskew specified in two parts: the fast_clock and the slow_clock. For example, "rep_set_clockskew 102 100". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

The DB_ENV->rep_set_clockskew method configures a database environment, not only operations performed using the specified DB_ENV handle.

The DB_ENV->rep_set_clockskew method may not be called after the DB_ENV->repmgr_start or DB_ENV->rep_start methods are called.

The DB_ENV->rep_set_clockskew method returns a non-zero error value on failure and 0 on success.

Parameters
fast_clock

- The value, relative to the slow_clock, of the fastest clock in the group of sites.

slow_clock

- The value of the slowest clock in the group of sites.

Errors

The DB_ENV->rep_set_clockskew method may fail and return one of the following non-zero errors:

EINVAL

- An invalid flag value or parameter was specified.

Description: DB_ENV->rep_get_clockskew

The DB_ENV->rep_get_clockskew method returns the current clock skew values.

The DB_ENV->rep_get_clockskew method may be called at any time during the life of the application.

The DB_ENV->rep_get_clockskew method returns a non-zero error value on failure and 0 on success.

Parameters
fast_clockp

- The fast_clockp parameter references memory into which the value for the fastest clock in the group of sites is copied.

slow_clockp

- The slow_clockp parameter references memory into which the value for the slowest clock in the group of sites is copied.

Class DB_ENV
See Also Replication and Related Methods`

Copyright (c) 1996,2008 Oracle. All rights reserved.