Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "k/proto: use log-level warn for missmatch crc" #23348

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/v/cluster/rm_stm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,11 @@ ss::future<result<kafka_result>> rm_stm::do_idempotent_replicate(
ss::lw_shared_ptr<available_promise<>> enqueued,
ssx::semaphore_units& units,
producer_previously_known known_producer) {
if (rand() % 10 > 5) {
units.return_all();
vlog(_ctx_log.warn, "timed out: {}", bid);
co_return cluster::errc::timeout;
}
// Check if the producer bumped the epoch and reset accordingly.
if (bid.pid.epoch > producer->id().epoch()) {
producer->reset_with_new_epoch(bid.pid.epoch);
Expand Down
2 changes: 1 addition & 1 deletion src/v/kafka/protocol/kafka_batch_adapter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void kafka_batch_adapter::verify_crc(int32_t expected_crc, iobuf_parser in) {
if (unlikely((uint32_t)expected_crc != crc.value())) {
valid_crc = false;
vlog(
klog.warn,
klog.error,
"Cannot validate Kafka record batch. Missmatching CRC. Expected:{}, "
"Got:{}",
expected_crc,
Expand Down
2 changes: 1 addition & 1 deletion tests/java/verifiers/src/main/java/idempotency/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void produceLoop() {
String kv = Long.toString(counter);
ProducerRecord<String, String> record
= new ProducerRecord<>(this.params.topic, kv, kv);
idempotentProducer.send(record).get();
idempotentProducer.send(record);
} catch (Exception e) {
ex = e;
logger.error("Exception in produce loop: ", e);
Expand Down
36 changes: 36 additions & 0 deletions tests/rptest/tests/crc_failure_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2022 Redpanda Data, Inc.
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.md
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0

import time
from rptest.services.cluster import cluster
from rptest.clients.types import TopicSpec
from rptest.tests.end_to_end import EndToEndTest
from rptest.services.redpanda import RESTART_LOG_ALLOW_LIST, RedpandaService
from rptest.transactions.verifiers.idempotency_load_generator import PausableIdempotentProducer


class ShutdownTest(EndToEndTest):
@cluster(num_nodes=4, log_allow_list=RESTART_LOG_ALLOW_LIST)
def crc_failure_repro_test(self):
self.topic = TopicSpec(partition_count=1, replication_factor=3)
rp_conf = {
'enable_leader_balancer': False,
'auto_create_topics_enabled': True
}
self.redpanda = RedpandaService(self.test_context,
3,
extra_rp_conf=rp_conf)
self.redpanda.start()
workload_svc = PausableIdempotentProducer(self.test_context,
self.redpanda)
workload_svc.start()
workload_svc.start_producer(self.topic.name,
self.topic.partition_count)
time.sleep(3 * 60)
workload_svc.stop_producer()