CockroachDB Technical Advisory 54418

We’ve published a new technical advisory for CockroachDB. Technical advisories report major issues with CockroachDB that may impact security or stability in production environments.
We encourage you to evaluate the advisory and consider upgrading.

Technical Advisory 54418: Incorrect behavior with large batch Upserts

Impact: All deployments running CockroachDB 20.1.4 and 20.1.5 are affected.

Description:

  • CockroachDB release 20.1.4 introduced a bug when handling UPSERT, UPSERT RETURNING, and INSERT … ON CONFLICT DO UPDATE SET x = excluded.x statements involving more than 10,000 rows.
  • Processing of a single UPSERT statement will halt without a visible error after reaching 10,000 rows. The reported number of affected rows will be incorrect, reported as 0.
  • Any single UPSERT … RETURNING statement will also return at most 10,000 rows.
  • This regression is critical as it may silently corrupt SQL data without remediation.

Mitigation:

  • Customers running versions 20.1.4 or 20.1.5 are strongly encouraged to upgrade to 20.1.6, available now.
  • All unaffected customers are urged to skip releases 20.1.4 and 20.1.5 or ensure their application code processes at most 10,000 rows per UPSERT statement.

Please find full details here.