kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject kafka git commit: KAFKA-1879; Log warning when receiving produce requests with acks > 1; patched by Gwen Shapira; reviewed by Jun Rao
Date Mon, 19 Jan 2015 22:07:56 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.8.2 1e640177f -> 059b09dec


KAFKA-1879; Log warning when receiving produce requests with acks > 1; patched by Gwen
Shapira; reviewed by Jun Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/059b09de
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/059b09de
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/059b09de

Branch: refs/heads/0.8.2
Commit: 059b09decf52e774fe7aadc00ca3ef715cd4016c
Parents: 1e64017
Author: Gwen Shapira <cshapi@gmail.com>
Authored: Mon Jan 19 14:07:51 2015 -0800
Committer: Jun Rao <junrao@gmail.com>
Committed: Mon Jan 19 14:07:51 2015 -0800

----------------------------------------------------------------------
 core/src/main/scala/kafka/server/KafkaApis.scala | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/059b09de/core/src/main/scala/kafka/server/KafkaApis.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/KafkaApis.scala b/core/src/main/scala/kafka/server/KafkaApis.scala
index 7def852..3d8eba6 100644
--- a/core/src/main/scala/kafka/server/KafkaApis.scala
+++ b/core/src/main/scala/kafka/server/KafkaApis.scala
@@ -194,6 +194,12 @@ class KafkaApis(val requestChannel: RequestChannel,
         (request.requestObj.asInstanceOf[ProducerRequest], None)
       }
 
+    if (produceRequest.requiredAcks > 1 || produceRequest.requiredAcks < -1) {
+      warn(("Client %s from %s sent a produce request with request.required.acks of %d, which
is now deprecated and will " +
+            "be removed in next release. Valid values are -1, 0 or 1. Please consult Kafka
documentation for supported " +
+            "and recommended configuration.").format(produceRequest.clientId, request.remoteAddress,
produceRequest.requiredAcks))
+    }
+
     val sTime = SystemTime.milliseconds
     val localProduceResults = appendToLocalLog(produceRequest, offsetCommitRequestOpt.nonEmpty)
     debug("Produce to local log in %d ms".format(SystemTime.milliseconds - sTime))


Mime
View raw message