> ## 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 122372

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: September 3, 2024

## Description

In all versions of CockroachDB v23.1, v23.2.0 to v23.2.9, v24.1.0 to v24.1.3, and testing versions of v24.2 through v24.2.0-beta.3, [changefeeds](https://www.cockroachlabs.com/docs/v24.2/change-data-capture-overview) could emit events on the same row out of order in some cases, which violates [changefeed ordering guarantees](https://www.cockroachlabs.com/docs/v24.2/changefeed-messages#per-key-ordering). This issue was caused by a [bug in the sarama Kafka client library](https://github.com/IBM/sarama/issues/2619), a third-party library that CockroachDB uses to talk to Kafka clusters. The bug manifested when a workload had mutations to the same key in rapid succession, because it was possible for [sarama](https://github.com/IBM/sarama) to re-order the messages if it encountered a retryable Kafka error.

To resolve this issue, CockroachDB now uses a new version of the Kafka sink that uses [franz-go](https://github.com/twmb/franz-go), a different third-party Kafka client library that does not have this bug. The new Kafka sink can be enabled using the cluster setting [`changefeed.new_kafka_sink.enabled`](https://www.cockroachlabs.com/docs/v24.2/show-cluster-setting).

## Statement

This is resolved by a fix in CockroachDB which replaces the Kafka client library [sarama](https://github.com/IBM/sarama) with [franz-go](https://github.com/twmb/franz-go).

The fix has been applied to maintenance releases of CockroachDB v23.2.10, v24.1.4, and v24.2.0-rc.1.

## Mitigation

Users of CockroachDB v23.1, v23.2.0 to v23.2.9, v24.1.0 to v24.1.3, and testing versions of v24.2 through v24.2.0-beta.3 are encouraged to upgrade to <InternalLink version="releases" path="v23.2#v23-2-10">v23.2.10</InternalLink>, <InternalLink version="releases" path="v24.1#v24-1-4">v24.1.4</InternalLink>, <InternalLink version="releases" path="v24.2#v24-2-0">v24.2.0</InternalLink>, or a later version, and enable the cluster setting [`changefeed.new_kafka_sink.enabled`](https://www.cockroachlabs.com/docs/v24.2/show-cluster-setting):

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
SET CLUSTER SETTING changefeed.new_kafka_sink.enabled = true;
```

`changefeed.new_kafka_sink.enabled` will be enabled by default in versions v24.2.1, v24.3, and all later versions.

## Impact

Changefeeds could emit events on the same row out of order in some cases, violating the [changefeed ordering guarantee](https://www.cockroachlabs.com/docs/v24.2/changefeed-messages#per-key-ordering). Versions affected include CockroachDB v23.1, v23.2.0 to v23.2.9, v24.1.0 to v24.1.3, and testing versions of v24.2 through v24.2.0-beta.3.

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