pkuwm commented on a change in pull request #1072:
URL: https://github.com/apache/helix/pull/1072#discussion_r437628014



##########
File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -1839,12 +1848,15 @@ protected void doRetry() {
     });
   }
 
-  private void checkDataSizeLimit(byte[] data) {
-    if (data != null && data.length > ZNRecord.SIZE_LIMIT) {
-      LOG.error(
-          "Data size larger than 1M, will not write to zk. Data (first 1k): " 
+ new String(data)
-              .substring(0, 1024));
-      throw new ZkClientException("Data size larger than 1M");
+  private void checkDataSizeLimit(String path, byte[] data) {
+    if (data == null) {
+      return;
+    }
+
+    int sizeLimit = ZNRecordUtil.getSerializerWriteSizeLimit();
+    if (data.length > sizeLimit) {
+      throw new ZkMarshallingError(

Review comment:
       Thanks for the input. Resolved.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to