> ## Documentation Index
> Fetch the complete documentation index at: https://www.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Technical Advisory 101963

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

Publication date: May 9, 2023

## Description

In the following circumstances, backups that include [revision history](https://www.cockroachlabs.com/docs/v22.2/take-backups-with-revision-history-and-restore-from-a-point-in-time) may record incorrect metadata. The presence of this incorrect metadata could cause a subsequent [`RESTORE`](https://www.cockroachlabs.com/docs/v22.2/restore) operation to write incorrect data:

* In a cluster running an impacted v22.2 or v22.1 version, a backup of an [`UPDATE`](https://www.cockroachlabs.com/docs/v22.2/update) -heavy workload captures more revision history for a given row than is specified by the `kv.bulk_sst.max_allowed_overage` [cluster setting](https://www.cockroachlabs.com/docs/v22.2/cluster-settings) ( `64 MiB` by default). A subsequent `RESTORE` operation may erroneously omit or include a row, or may restore an incorrect version of it.
* In a cluster running an impacted v22.2 version, the non-public cluster setting `admission.elastic_cpu.enabled` is set to `true`. A subsequent `RESTORE` operation may erroneously omit or include any key with revision history in the backup.

## Statement

This is resolved by a change in CockroachDB which ensures that `RESTORE` operations can correctly restore from backups that include this incorrect metadata.

The fix has been applied to maintenance releases of CockroachDB: <InternalLink version="releases" path="v22.2">v22.2.9</InternalLink>.

This fix will be applied to maintenance releases of CockroachDB: v22.1.20. Until that version is available, refer to [Mitigation](#mitigation) for a suggested workaround.

## Mitigation

Users of CockroachDB v22.2.0 to v22.2.8 are encouraged to upgrade to <InternalLink version="releases" path="v22.2">v22.2.9</InternalLink> or a later version. After the upgrade, `RESTORE` operations will succeed even if the backup includes incorrect revision history metadata. Until such an upgrade, avoid restoring backups with revision history on the earlier version, and do not change the `admission.elastic_cpu.enabled` cluster setting from its default.

When the maintenance release v22.1.20 is available, users of CockroachDB v22.1.0 to v22.1.19 are encouraged to upgrade to it. After the upgrade, `RESTORE` operations will succeed even if the backup includes incorrect revision history metadata. Until such an upgrade, avoid restoring a backup taken on an earlier version if it includes revision history.

## Impact

In specific circumstances, a `RESTORE` operation may restore incorrect data from a backup that contains incorrect metadata related to [revision history](https://www.cockroachlabs.com/docs/v22.2/take-backups-with-revision-history-and-restore-from-a-point-in-time). This vulnerability affects all of the following CockroachDB versions: v22.2.0 to v22.2.8 and v22.1.0 to 22.1.19.

Questions about any technical alert can be directed to our [support team](https://support.cockroachlabs.com/).
