adoroszlai commented on code in PR #9319: URL: https://github.com/apache/ozone/pull/9319#discussion_r2576889673
########## hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHAWithFollowerRead.java: ########## @@ -0,0 +1,49 @@ +/* + * 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.hadoop.ozone.shell; + +import org.apache.hadoop.hdds.conf.OzoneConfiguration; +import org.apache.hadoop.ozone.OzoneConfigKeys; +import org.apache.hadoop.ozone.om.ratis.OzoneManagerRatisServerConfig; +import org.apache.ratis.server.RaftServerConfigKeys; +import org.junit.jupiter.api.BeforeAll; + +/** + * This class tests Ozone sh shell command with FollowerRead. + * Inspired by TestS3Shell + */ +public class TestOzoneShellHAWithFollowerRead extends TestOzoneShellHA { + + @BeforeAll + @Override + public void init() throws Exception { + OzoneConfiguration conf = new OzoneConfiguration(); + + OzoneManagerRatisServerConfig omHAConfig = + conf.getObject(OzoneManagerRatisServerConfig.class); + omHAConfig.setReadOption(RaftServerConfigKeys.Read.Option.LINEARIZABLE.name()); + + conf.setFromObject(omHAConfig); + conf.setBoolean(OzoneConfigKeys.OZONE_HBASE_ENHANCEMENTS_ALLOWED, true); + conf.setBoolean("ozone.client.hbase.enhancements.allowed", true); + conf.setBoolean("ozone.om.ha.raft.server.read.leader.lease.enabled", true); Review Comment: - I don't see the new config `ozone.om.allow.leader.non.linearizable.read` ever being set to `true`. - Test time increased by more than 1000% compared to base class: ``` Tests run: 31, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 63.63 s -- in org.apache.hadoop.ozone.shell.TestOzoneShellHA Tests run: 31, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 716.9 s -- in org.apache.hadoop.ozone.shell.TestOzoneShellHAWithFollowerRead ``` - OM checks `isAllowLeaderNonLinearizableRead()` for every request, so the test does not need a completely new cluster for `ozone.om.allow.leader.non.linearizable.read=true`. ########## hadoop-hdds/common/src/main/resources/ozone-default.xml: ########## @@ -664,6 +664,15 @@ allow group public LIST access. </description> </property> + <property> + <name>ozone.om.allow.leader.non.linearizable.read</name> + <value>false</value> + <tag>OM, HA, PERFORMANCE</tag> + <description> + Allow leader to handler requests directly, no need to check the leadership + for every request. + </description> + </property> Review Comment: I would be nice to introduce this new setting in `OmConfig` (see HDDS-12298) instead. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
