13.4 Database or Storage Pool Inconsistencies

Under normal circumstances, the VOB database maintains a complete and uninterrupted record of all activity in the VOB's source pools. (Cleartext pools are caches and are expendable.) The VOB database reflects all additions (checkins, branch creation, element creation, and so on) and deletions (removal of versions, branches, and elements) in the pools. Each data container is referenced from the database.

NOTE: Derived objects (DOs) are a ClearCase feature that ClearCase LT does not use. ClearCase LT VOBs contain storage pools for these objects, but the pools are never used. checkvob examines these pools as part of its normal procedure, but they never contain any data on a ClearCase LT server.

In general, inconsistencies between the database and storage pools occur because of damage to the VOB database, to the storage pools, or to both. If the damage requires VOB restoration from backup, database or pool inconsistency occurs at restore time if the VOB has been backed up using the semi-live backup approach (database and pools were backed up at different times). That is why a vob_restore operation includes checkvob. In general, checkvob tries to make the pools match the database. If the pools are missing data, checkvob cannot re-create the data, and must adjust the database to compensate for the missing information.

Here are three scenarios:

In addition, system crashes or network failures can prevent cleartool operations from completing cleanup tasks. This often results in unreferenced data containers. Any aborted operation that fails to clean up properly can have the same effect, as can OS bugs and disk problems.

Given a time lapse between current instances of VOB database and storage pools, any operation that modifies storage pools can create database or source pool inconsistencies. checkvob can identify-and in most cases, fix-these kinds of data container problems:

Of these problems, missing containers is the most serious, as it may represent loss of data.


Problem

Found by checkvob

All pool kinds (source, DO, cleartext)


Bad pool roots (pool names, identity info)


Yes (-pool)


Source and DO pools only


Misprotected containers


Yes (-protections)


Missing containers


Yes (-data)


Unreferenced containers (debris)


Yes (-debris)


Corrupted containers


No


By default, checkvob prints detailed reports on one or more storage pools (-pool) or on specific file elements passed in the command line. With the -fix option, checkvob fixes as many problems as it can, adjusting data containers to match what is expected by the VOB database.

WARNING: Fixing problems detected with -data can update the VOB irreversibly. If version data is recorded in the database but missing from the storage pools, checkvob updates the VOB database by removing the version (rmver -data).

Updating the VOB Database

checkvob never updates the VOB database to reference newer pool data. If versions are stored in the pools but not recorded in the database, checkvob moves the unreferenced data containers to the pool's lost+found directory. That is, if pool storage is newer than the database, checkvob does not salvage the latest versions from the unreferenced pool containers and update the database. It uses the unreferenced containers to return the pool to the state expected by the database, and it moves the unreferenced containers (with the latest version data) to pool-dir\lost+found. These versions should be presumed lost. Contact Rational Technical Support for more information. (By contrast, barring unexpected events, any missing data that checkvob reports in this scenario can generally be attributed to rmver operations that were not recorded in the older database; and the fix processing that accepts this data loss is inconsequential.)

Although it does not add new version information to the VOB database, checkvob updates the VOB database in the following ways:

Requirements for Using checkvob

If you use a customized type manager, it must include the get_cont_info method; if it does not, checkvob cannot repair data containers managed by this type manager. See the type_manager reference page for more information.

checkvob requires operational vob_server and db_server processes on the ClearCase LT server where it executes. As shown in Figure 19, the vob_server, which runs as the VOB owner on UNIX and as the NT Authority\system identity on Windows, is the only process that can create or delete data containers. Similarly, the db_server mediates all VOB database access.

Figure 19 Pool Access Through vob_server and VOB Database Access Through db_server

To understand the checkvob results, you must understand how ClearCase type managers operate on data containers. For example, changes to a data container (checkin, in particular) always result in a new, renamed container, regardless of the applicable type manager. See the type_manager reference page for more details.

Running checkvob

To accept as lost any pool data added in the interval between the pool and database reference times, run checkvob -force -fix and supply an appropriate time interval (see Force-Fix Mode).

To accept the default data loss interval of one day, run checkvob -force -fix. Then, run checkvob without -force, and fix any remaining elements with missing containers manually (as prompted for).

Output Log for Pool Checking

The output from checkvob is captured in a log file directory created each time checkvob runs. The default location of the log directory is current-dir\checkvob.date-time, but you can move it with the -log option. A checkvob log directory's contents:

.\checkvob.11-Oct-99.18.30.45\
poolkind_source\transcript
poolkind_derived\transcript
poolkind_cleartext\transcript
summary

NOTE: The output log is a single summary file if you run checkvob on a single object.

Each transcript file contains a detailed report on check and fix processing for each existing pool kind. The summary file contains the header and tail sections from each transcript file.

Figure 20 shows a summary log file. This output was generated with a command like the following, on a VOB with one missing data container:

cleartool checkvob -pool -fix \\saturn\vobstore\src.vbs

Figure 20 checkvob Output Log: Summary File

Figure 21 shows a condensed transcript file for source pool check and fix processing. This output was generated with a command like the following, on a VOB with one missing data container:

cleartool checkvob -fix -force -pool -source \\saturn\vobstore\src.vbs

Figure 21 checkvob Output Log: Condensed Transcript File

Overview of checkvob Processing

The following sections describe checkvob actions.

Individual File Element Processing

When run in fix mode (-fix) against individual file-system objects (no -pool option), checkvob writes output like the following to standard output and also to log-dir\transcript. For example:

=================================================================
Processing element "\vob_src\open.c@@".
The element is now locked.
Checking status of 1 referenced containers in pool "s\sdft"...
...
fix processing output
Initial container status: 0 missing, 0 misprotected.
Final container status: 0 missing, 0 misprotected.
The element is now unlocked.
=================================================================

File element processing:

  1. Check the element for -data (missing container) and -protection problems.

  2. If fix mode (-fix), fix protection and missing container problems:

  3. NOTE: Fix processing is blocked if the VOB, source pool, or element is locked.

    1. Lock the element.

    2. Fix missing protection problems.

    3. Fix missing data container problems by scanning the pool for missing or misplaced containers and reconstructing containers as necessary.

    4. Update the VOB database to reference the reconstructed containers.

    5. For missing version data, update the VOB database to dereference lost versions with the equivalent of rmver -data.

    6. Apply minor events to element's event history.

    7. Move alternate (unreferenced) containers for this element to pool's lost+found directory.

    8. Unlock the element.

Pool Mode (-pool Option) Processing: Overview

When run with the -pool option, checkvob examines some or all of the VOB's source, DO, and cleartext pools.

For each kind of pool (source, DO, cleartext):

  1. Check pool roots. Check pool names, locations, and pool identity information (each pool must have a pool_id file, which stores the pool's OID). These problems cannot be fixed with checkvob and must be directed to Rational Technical Support.

  2. For source pools, check the installed type managers for checkvob support (get_cont_info method).

For source and DO pools only:

  1. Scan VOB database for missing (referenced, but not found) or misprotected containers.

  2. Generate a list of problem VOB objects.

  3. If -fix is specified, process each problem VOB object as described in Individual File Element or DO Processing.

  4. Scan for unreferenced data containers.

  5. If -fix is specified, move each unreferenced container to the pool's lost+found directory.

Force-Fix Mode

If you use the -force -fix options, checkvob prevents you from unintentionally accepting data loss:

To silently accept (fix) all missing data containers without regard for creation time, use a very old date-time. The default time interval for allowed data loss is "since yesterday at 00:00:00." If you supply a date older than one week, checkvob forces you to confirm it.

checkvob log files do not capture the time-interval dialogue from -force -fix operations.

See the description of the date-time argument in the lshistory reference page for a list of acceptable values.

Pool Setup Mode

checkvob -setup -fix -pool is run by reformatvob when you upgrade a ClearCase LT server to a new ClearCase LT release. If this part of the reformatvob operation fails, you must run checkvob -setup -fix manually. This command must complete successfully to enable checkvob processing in the VOB's storage pools (which is a prerequisite to using the vob_snapshot utility successfully.)

checkvob -setup -fix -pool does the following:

VOB, pool, or element locks prevent setup processing. In this case, do the following:

  1. (Pool or VOB locks only) Log on as the VOB owner or a privileged user.

  2. Replace the VOB lock:

  3. cleartool unlock vob:vob-pname
    cleartool lock -nusers userid-that-will-run-checkvob vob:vob-pname

  4. Replace pool locks:

  5. cleartool lock -replace -nusers userid-that-will-run-checkvob locked-pools

  6. Replace element locks:

  7. cleartool lock -replace -nusers userid-that-will-run-checkvob locked-elements

  8. Rerun checkvob -setup -fix manually.

Descriptions of Storage Pool Problems

The following sections describe how storage pool problems arise and how checkvob fixes them.

Notes on problem descriptions:

Source or Cleartext Pool: Bad Pool Roots

Description

Misnamed or misidentified pools.

Cause

rename pool in the interval between database and storage pool reference times.

Fix Processing

Unless pool names and IDs match VOB database expectations exactly, abort processing for this pool kind (source or cleartext) and skip to the next pool kind.

Exception: If, for any pool, the only inconsistency is a missing pool_id file, create the pool_id file.

Source Pool: Misprotected Container on Windows

Description

FAT file system: incorrect RO attribute.
NTFS file system: incorrect RO attribute or ACL.

Cause

User copied or restored pools or containers without preserving protection information.

Fix Processing

Reset container's RO attribute and ACL as necessary. If the VOB owner's rights to pool contents are insufficient, checkvob reports, but cannot fix, container ACLs. If checkvob cannot repair protection problems, you must take the following steps:

  1. Log on as a member of the ClearCase administrators group.

  2. In Windows Explorer, click File > Properties. On the Security tab, take ownership of all files and directories in the VOB's storage directory tree.

  3. NOTE: If you have identified only a small number of affected files, take ownership of these files only, to avoid a time-consuming checkvob operation in Step #6.

  4. For all files and directories in the VOB storage directory, use the Security tab to grant full rights to the clearcase and vob-owner accounts.

  5. Log out. Log on as VOB owner.

  6. Take ownership of all files and directories in the VOB storage directory tree.

  7. Run checkvob to fix protections on storage pools:

  8. cleartool checkvob -force -fix -protection -pool c:\vobstore\myvob.vbs

Missing and Unreferenced Data Containers

checkvob works to reconcile the contents of VOB storage with the information in the VOB database. This reconciliation requires checkvob to categorize data containers based on their relationship to this information. There are two categories:

Whenever the VOB database and storage pools have different reference times (one is older than the other), checkvob is likely to find both missing and unreferenced containers. For example, consider a container whose location has changed as a result of a rename operation on a pool: it stores the data that the database is trying to reference, but at the wrong location in the storage pool. checkvob reports a missing container and an unreferenced container. Note that in fix mode, checkvob resolves these simple location problems.

Source Pool: Missing Container

Description

The VOB database references a source pool data container that does not exist at the expected location. A container is considered missing if it does not appear under the exact name and location recorded in the VOB database.

Causes

Fix Processing

During fix mode processing, checkvob uses the following algorithm to fix missing containers by scanning all storage pools for alternate containers from which to reconstruct missing data containers.

  1. Scan pools for alternate containers.

  2. In a previous pass over the pools, checkvob found all referenced containers. It now scans for unreferenced containers for that element, looking for alternate containers that can be used to reconstruct a replacement for the missing container by rebinding the alternate container to take the place of the missing one. There are two types of rebind operations:

    Optimized rebind: find alternates maintained by the right type manager.

    1. Find best match: identical, superset, or subset.

    2. identical-container with correct contents (user ran chpool during interval between pool and database reference times).

      superset-container with superset of versions expected by database. This is common when the pool is newer than the database.

      subset-container with subset of versions expected by database. This is common when the database is newer than the pool.

    3. Clone and prune best match. Create a new container and copy the best alternate's contents. Delete extra version data from the new container.

    Nonoptimized rebind: alternate containers with the right type manager not available (no "best match" found).

    1. Construct container one version at a time from whatever sources are available: containers maintained by other type managers and cleartext pools.

  3. If container reconstruction is incomplete, collect and report a list of missing versions.

  4. If -force is not specified, prompt user to accept fix.

  5. If -force is specified, safety features prevent some kinds of inadvertent data loss. See Force-Fix Mode for details.

  6. If -force is in effect, or if user accepted fix prompt, update VOB database:

    1. Adjust database to reference reconstructed containers.

    2. With the equivalent of rmver -data, adjust the database to dereference lost version data.

  7. Move all of the element's alternate containers to pool's lost+found directory.

  8. NOTE: Because (unreferenced) alternate containers are moved to lost+found now, rather than during checkvob's subsequent debris processing pass, you have an opportunity to reclaim disk space from lost+found if the disk fills up during reconstruction. Reconstruction can consume substantial disk space.

Source Pool: Unreferenced Container (Debris)

Description

Source pool includes a data container that is not referenced by the VOB database. Such containers are tentatively classified as debris, but must pass several tests before being moved to the applicable pool's lost+found directory.

Causes

Fix Processing

checkvob usually moves an unreferenced container to the applicable pool's lost+found subdirectory (vob-storage-dir\s\sdft\lost+found, by default). It leaves in place unreferenced containers that fit into these categories:

NOTE: When the pool is newer than the database and includes more recent versions not recorded in the (older) database, checkvob does not salvage versions from the unreferenced containers and update the database. It uses the unreferenced containers to return the pool to the state expected by the database, and it moves the unreferenced containers (with the latest version data) to pool-dir\lost+found. These versions should be presumed lost. Contact Rational Technical Support for more information.

Source Pool: Corrupted Container

Description

File truncated and similar conditions

Cause

Unexpected events

Fix Processing

None. checkvob does not find or fix corrupted data containers. A container with the right pathname is considered healthy.