Description
In CockroachDB to and to , aRESTORE of an incremental backup may include rows that should not be restored, in a narrow set of circumstances relating to an ongoing IMPORT INTO job. This has been fixed in CockroachDB patch versions v22.1.9 and v21.2.17, available in .
This issue primarily affects incremental backups taken after an IMPORT INTO operation is reverted. For this issue to occur, the following series of conditions need to occur:
- First, a table must be backed up, typically as part of a full-cluster backup, while it is offline and being written to by an ongoing
IMPORT INTOjob. Rows which are being written to the table by the in-progressIMPORT INTOjob are included in this backup. - Next, that
IMPORT INTOjob must fail or be canceled. This failure or cancellation triggers the roll-back process, which reverts rows which it had written, and then brings the table back online. - After the
IMPORT INTOrollback completes and the table is back online, an incremental backup must be taken of the table. This incremental backup is appended to the original backup that was taken while the table was offline. - When this incremental backup is restored using an affected CockroachDB version, rows which were initially written by the
IMPORTand backed up, but then later reverted when theIMPORT INTOwas canceled before the incremental backup, will incorrectly appear in the restored table.
IMPORT INTO job cancellation, it is unaffected.
The technical details can be found in the following GitHub issues:
- #88042
- #88043
Statement
The fix has been applied to the maintenance release of CockroachDB and CockroachDB .Mitigation
Users of CockroachDB to are encouraged to upgrade to or a later version. Users of CockroachDB to are encouraged to upgrade to or a later version. If aRESTORE must be run using prior versions, Cockroach Labs recommends that where possible, you restore only to full backups. If you must restore to an incremental backup taken on an affected version, restore only tables on which IMPORT INTO did not run or succeeded.
The best mitigation, however, is to upgrade to v22.1.9 or v21.2.17 as soon as possible.
Impact
ARESTORE of an incremental backup may include rows that should not be restored, in a narrow set of circumstances relating to an ongoing IMPORT INTO job. Versions affected include v22.1.0 to v22.1.8 and v21.2.0 to v21.2.16.
Please reach out to the support team if more information or assistance is needed.
