jackjlli commented on code in PR #8506:
URL: https://github.com/apache/pinot/pull/8506#discussion_r851392902


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/HelixZNodeSizeLimitTest.java:
##########
@@ -0,0 +1,91 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.pinot.integration.tests;
+
+import com.google.common.collect.ImmutableMap;
+import java.util.Map;
+import org.apache.helix.SystemPropertyKeys;
+import org.apache.pinot.common.utils.helix.HelixHelper;
+import org.apache.pinot.util.TestUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+
+/**
+ * This test is created to show the bug in Helix 0.9.8 that if a ZooKeeper 
IdealState is larger than 1MB after
+ * compression, it cannot be updated anymore. Somehow this test can also make 
sure in future we will support
+ * large IdealStates
+ */
+public class HelixZNodeSizeLimitTest extends BaseClusterIntegrationTest {
+  @BeforeClass
+  public void setUp()
+      throws Exception {
+    // This line of code has to be executed before the 
org.apache.helix.manager.zk.zookeeper.ZkClient.WRITE_SIZE_LIMIT
+    // is initialized. The code is in
+    // 
https://github.com/apache/helix/blob/helix-0.9.9/helix-core/src/main/java/org/
+    // apache/helix/manager/zk/zookeeper/ZkClient.java#L89
+    // Not sure how this works but this below line executes before 
ZkClient.WRITE_SIZE_LIMIT is created
+    System.setProperty(SystemPropertyKeys.JUTE_MAXBUFFER, "4000000");
+    TestUtils.ensureDirectoriesExistAndEmpty(_tempDir);
+
+    // Start Zookeeper
+    startZk();
+    startController();
+    startBroker();
+    startServer();
+    addSchema(createSchema());
+    addTableConfig(createOfflineTableConfig());
+  }
+
+  @AfterClass(alwaysRun = true)
+  public void tearDown()
+      throws Exception {
+    stopServer();
+    stopBroker();
+    stopController();
+    stopZk();
+  }
+
+  @Test
+  public void testUpdateIdealState() {
+    // In Helix 0.9.8, we get error logs like below:
+    // 13:03:51.576 ERROR [ZkBaseDataAccessor] [main] Exception while setting 
path:
+    // /HelixZNodeSizeLimitTest/IDEALSTATES/mytable_OFFLINE
+    //  org.apache.helix.HelixException: Data size larger than 1M
+    //  at 
org.apache.helix.manager.zk.zookeeper.ZkClient.checkDataSizeLimit(ZkClient.java:1513)
 ~[helix-core-0.9.8
+    //  .jar:0.9.8]
+    //  at 
org.apache.helix.manager.zk.zookeeper.ZkClient.writeDataReturnStat(ZkClient.java:1406)
 ~[helix-core-0.9.8
+    //  .jar:0.9.8]
+    String tableNameWithType = getTableName() + "_OFFLINE";
+    
System.setProperty(SystemPropertyKeys.ZK_SERIALIZER_ZNRECORD_WRITE_SIZE_LIMIT_BYTES,
 "4000000");
+    // The updated IdealState after compression is roughly 2MB
+    HelixHelper.updateIdealState(_helixManager, tableNameWithType, idealState 
-> {

Review Comment:
   @dongxiaoman Yes, the integration of Helix 1.0+ will be done in this 
quarter, roughly 1~2 months. The PR will be ready only after it's fully tested 
and deployed in LinkedIn. And I agree that we should keep that unit test into 
the code. I'll put it to the same PR. Thanks again!



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to