Jihye Seo created HDFS-16842: -------------------------------- Summary: DatanodeHttpServer cannot get the new configuration of the new nameservice even after refreshNamenodes is run Key: HDFS-16842 URL: https://issues.apache.org/jira/browse/HDFS-16842 Project: Hadoop HDFS Issue Type: Bug Components: datanode Affects Versions: 3.1.2 Reporter: Jihye Seo Fix For: 3.1.2
'refreshNamenodes' should be run when a new nameservice is added. However, a 'DatanodeHttpServer' cannot get the new configuration of the new nameservice even after 'refreshNamenodes' is run. Therefore, when a client tries to access the new namespace's data with a swebhdfs or REST API request, an error occurs as follows. {code:java} Does not contain a valid host:port authority: NEW_NAMESPACE{code} When 'refreshNamenodes' is executed, a Datanode object reads the new configuration file and updates its configuration with 'setConf(new Configuration)'. {code:java} public void refreshNamenodes() throws IOException { checkSuperuserPrivilege(); setConf(new Configuration()); refreshNamenodes(getConf()); }{code} On the other hand, the configuration of a DatanodeHttpServer object remains unchanged after the DatanodeHttpServer object is created. When a Datanode object is created, a DatanodeHttpServer is created by copying the Datanode's configuration. Since then, there's no way to update its configuration. {code:java} public DatanodeHttpServer(final Configuration conf, final DataNode datanode, final ServerSocketChannel externalHttpChannel) throws IOException { this.restCsrfPreventionFilter = createRestCsrfPreventionFilter(conf); this.conf = conf; ... } {code} This causes a DatanodeHttpServer to be unable to interpret a request for the new name service. Therefore, a DatanodeHttpServer also needs to update its configuration to handle a request for a new name service. I attached a patch based on the trunk. Thanks! -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org