Skip to content

Commit

Permalink
chore(ingestion): remove KAFKA_PRODUCER_WAIT_FOR_ACK option (#17806)
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello authored Oct 5, 2023
1 parent 0d6218f commit 676259c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion plugin-server/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export function getDefaultConfig(): PluginsServerConfig {
KAFKA_CONSUMPTION_SESSION_TIMEOUT_MS: 30_000,
KAFKA_TOPIC_CREATION_TIMEOUT_MS: isDevEnv() ? 30_000 : 5_000, // rdkafka default is 5s, increased in devenv to resist to slow kafka
KAFKA_PRODUCER_MAX_QUEUE_SIZE: isTestEnv() ? 0 : 1000,
KAFKA_PRODUCER_WAIT_FOR_ACK: true, // Turning it off can lead to dropped data
KAFKA_MAX_MESSAGE_BATCH_SIZE: isDevEnv() ? 0 : 900_000,
KAFKA_FLUSH_FREQUENCY_MS: isTestEnv() ? 5 : 500,
APP_METRICS_FLUSH_FREQUENCY_MS: isTestEnv() ? 5 : 20_000,
Expand Down
1 change: 0 additions & 1 deletion plugin-server/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export interface PluginsServerConfig {
KAFKA_CONSUMPTION_SESSION_TIMEOUT_MS: number
KAFKA_TOPIC_CREATION_TIMEOUT_MS: number
KAFKA_PRODUCER_MAX_QUEUE_SIZE: number
KAFKA_PRODUCER_WAIT_FOR_ACK: boolean
KAFKA_MAX_MESSAGE_BATCH_SIZE: number
KAFKA_FLUSH_FREQUENCY_MS: number
APP_METRICS_FLUSH_FREQUENCY_MS: number
Expand Down
2 changes: 1 addition & 1 deletion plugin-server/src/utils/db/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pgTypes.setTypeParser(1184 /* types.TypeId.TIMESTAMPTZ */, (timeStr) =>
export async function createKafkaProducerWrapper(serverConfig: PluginsServerConfig): Promise<KafkaProducerWrapper> {
const kafkaConnectionConfig = createRdConnectionConfigFromEnvVars(serverConfig)
const producer = await createKafkaProducer({ ...kafkaConnectionConfig, 'linger.ms': 0 })
return new KafkaProducerWrapper(producer, serverConfig.KAFKA_PRODUCER_WAIT_FOR_ACK)
return new KafkaProducerWrapper(producer)
}

export async function createHub(
Expand Down
4 changes: 1 addition & 3 deletions plugin-server/src/utils/db/kafka-producer-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ import { DependencyUnavailableError, MessageSizeTooLarge } from './error'
export class KafkaProducerWrapper {
/** Kafka producer used for syncing Postgres and ClickHouse person data. */
public producer: HighLevelProducer
private readonly waitForAck: boolean

constructor(producer: HighLevelProducer, waitForAck: boolean) {
constructor(producer: HighLevelProducer) {
this.producer = producer
this.waitForAck = waitForAck
}

async produce({
Expand Down

0 comments on commit 676259c

Please sign in to comment.