Skip to content

Commit e892d8d

Browse files
author
Mate Szalay-Beko
committed
Merge remote-tracking branch 'apache/master' into ZOOKEEPER-3188
2 parents 6f2ab75 + ef3649f commit e892d8d

3 files changed

Lines changed: 21 additions & 12 deletions

File tree

zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,15 +1384,23 @@ the variable does.
13841384
set to no, ZooKeeper will not require updates to be synced to
13851385
the media.
13861386

1387-
* *jute.maxbuffer:* :
1388-
(Java system property:**jute.maxbuffer**)
1389-
This option can only be set as a Java system property.
1387+
* *jute.maxbuffer* :
1388+
(Java system property:**jute.maxbuffer**).
1389+
- This option can only be set as a Java system property.
13901390
There is no zookeeper prefix on it. It specifies the maximum
1391-
size of the data that can be stored in a znode. The default is
1392-
0xfffff, or just under 1M. If this option is changed, the system
1393-
property must be set on all servers and clients otherwise
1394-
problems will arise. This is really a sanity check. ZooKeeper is
1395-
designed to store data on the order of kilobytes in size.
1391+
size of the data that can be stored in a znode. The unit is: byte. The default is
1392+
0xfffff(1048575) bytes, or just under 1M.
1393+
- If this option is changed, the system property must be set on all servers and clients otherwise
1394+
problems will arise.
1395+
- When *jute.maxbuffer* in the client side is greater than the server side, the client wants to write the data
1396+
exceeds *jute.maxbuffer* in the server side, the server side will get **java.io.IOException: Len error**
1397+
- When *jute.maxbuffer* in the client side is less than the server side, the client wants to read the data
1398+
exceeds *jute.maxbuffer* in the client side, the client side will get **java.io.IOException: Unreasonable length**
1399+
or **Packet len is out of range!**
1400+
- This is really a sanity check. ZooKeeper is designed to store data on the order of kilobytes in size.
1401+
In the production environment, increasing this property to exceed the default value is not recommended for the following reasons:
1402+
- Large size znodes cause unwarranted latency spikes, worsen the throughput
1403+
- Large size znodes make the synchronization time between leader and followers unpredictable and non-convergent(sometimes timeout), cause the quorum unstable
13961404

13971405
* *jute.maxbuffer.extrasize*:
13981406
(Java system property: **zookeeper.jute.maxbuffer.extrasize**)

zookeeper-docs/src/main/resources/markdown/zookeeperProgrammers.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,10 +1305,11 @@ following reference
13051305
and the password to unlock the file.
13061306
13071307
* *jute.maxbuffer* :
1308-
It specifies the maximum size of the incoming data from the server. The default value is 4194304
1309-
Bytes , or just 4 MB. This is really a sanity check. The ZooKeeper server is designed to store and send
1308+
In the client side, it specifies the maximum size of the incoming data from the server. The default is 0xfffff(1048575) bytes,
1309+
or just under 1M. This is really a sanity check. The ZooKeeper server is designed to store and send
13101310
data on the order of kilobytes. If incoming data length is more than this value, an IOException
1311-
is raised.
1311+
is raised. This value of client side should keep same with the server side(Setting **System.setProperty("jute.maxbuffer", "xxxx")** in the client side will work),
1312+
otherwise problems will arise.
13121313
13131314
* *zookeeper.kinit* :
13141315
Specifies path to kinit binary. Default is "/usr/bin/kinit".

zookeeper-server/src/main/java/org/apache/zookeeper/client/ZKClientConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class ZKClientConfig extends ZKConfig {
5757
*/
5858
@SuppressWarnings("deprecation")
5959
public static final String SECURE_CLIENT = ZooKeeper.SECURE_CLIENT;
60-
public static final int CLIENT_MAX_PACKET_LENGTH_DEFAULT = 4096 * 1024; /* 4 MB */
60+
public static final int CLIENT_MAX_PACKET_LENGTH_DEFAULT = 0xfffff; /* 1 MB */
6161
public static final String ZOOKEEPER_REQUEST_TIMEOUT = "zookeeper.request.timeout";
6262
public static final String ZOOKEEPER_SERVER_PRINCIPAL = "zookeeper.server.principal";
6363
/**

0 commit comments

Comments
 (0)