Skip to content

Commit 8a78d2b

Browse files
Merge pull request #34469 from patrickwwbutler/patrick/kafka_progress
Update Kafka Progress Topic config to avoid long startups
2 parents 2e07b38 + 0ccfcb8 commit 8a78d2b

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

doc/user/content/serve-results/sink/kafka.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ running `CREATE SINK`, observe the following guidance:
7070
| Progress topic | Compaction | We recommend enabling compaction to avoid accumulating unbounded state. Disabling compaction may cause performance issues, but will not cause correctness issues.
7171
| Progress topic | Retention | **Must be disabled.** Enabling retention can cause Materialize to violate its [exactly-once guarantees](/sql/create-sink/kafka#exactly-once-processing).
7272
| Progress topic | Tiered storage | We recommend disabling tiered storage to allow for more aggressive data compaction. Fully compacted data requires minimal storage, typically only tens of bytes per sink, making it cost-effective to maintain directly on local disk.
73+
| Progress topic | Segment bytes. | Defaults to 128 MiB. We recommend going no higher than 256 MiB to avoid
74+
slow startups when creating new sinks, as they must process the entire progress topic on startup.
7375
{{< warning >}}
7476
{{% kafka-sink-drop %}}
7577
{{</ warning >}}

src/sql/src/plan/statement/ddl/connection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ impl ConnectionOptionExtracted {
334334
}).transpose()?,
335335
topic_config: btreemap! {
336336
"cleanup.policy".to_string() => "compact".to_string(),
337+
"segment.bytes".to_string() => "134217728".to_string(), // 128 MB
337338
},
338339
},
339340
options: BTreeMap::new(),

test/testdrive/kafka-sink-topic-config.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ $ kafka-verify-topic topic=testdrive-kafka-progress-${testdrive.seed} topic-conf
105105
FORMAT JSON
106106
ENVELOPE UPSERT
107107

108-
$ kafka-verify-topic topic=testdrive-kafka-progress-${testdrive.seed} topic-config={"cleanup.policy": "compact"} replication-factor=1 partition-count=1
108+
$ kafka-verify-topic topic=testdrive-kafka-progress-${testdrive.seed} topic-config={"cleanup.policy": "compact", "segment.bytes": "134217728"} replication-factor=1 partition-count=1

0 commit comments

Comments
 (0)