[
https://issues.apache.org/jira/browse/HDFS-16686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17582986#comment-17582986
]
ASF GitHub Bot commented on HDFS-16686:
---------------------------------------
snmvaughan commented on code in PR #4724:
URL: https://github.com/apache/hadoop/pull/4724#discussion_r951462510
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java:
##########
@@ -80,16 +82,38 @@ public static void runCmd(DFSAdmin dfsadmin, boolean
success,
}
}
+ @Rule
+ public TemporaryFolder folder= new TemporaryFolder();
+
+ /**
+ * Create a default HDFS configuration which has test-specific data
directories. This is
+ * intended to protect against interactions between test runs that might
corrupt results. Each
+ * test run's data is automatically cleaned-up by JUnit.
+ *
+ * @return a default configuration with test-specific data directories
+ */
+ public Configuration getHdfsConfiguration() throws IOException {
+ Configuration conf = new HdfsConfiguration();
+
+ // Override the file system locations with test-specific temporary folders
+ conf.set(DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY,
+ folder.newFolder("dfs/name").toString());
+ conf.set(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_DIR_KEY,
+ folder.newFolder("dfs/namesecondary").toString());
+ conf.set(DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY,
+ folder.newFolder("dfs/data").toString());
+
+ return conf;
+ }
+
/**
* Test DFSAdmin Upgrade Command.
*/
@Test
public void testDFSAdminRollingUpgradeCommands() throws Exception {
// start a cluster
- final Configuration conf = new HdfsConfiguration();
- MiniDFSCluster cluster = null;
- try {
- cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0).build();
+ final Configuration conf = getHdfsConfiguration();
Review Comment:
These changes were made because the tests kept failing in the upstream test
run, but run fine locally. The upstream test runs are executed in parallel
resulting in flaky behavior.
The change to all of these tests if a switch from a local HDFS configuration
to a shared mechanism called `getHdfsConfiguration()`. The shared mechanism
has the added benefit of using a `TemporaryFolder` to ensure that all test
clusters have their own disk space per test . This avoids any interaction by
parallel tests, or picking up left-overs from pervious tests.
> GetJournalEditServlet fails to authorize valid Kerberos request
> ---------------------------------------------------------------
>
> Key: HDFS-16686
> URL: https://issues.apache.org/jira/browse/HDFS-16686
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: journal-node
> Environment: Running in Kubernetes using Java 11 in an HA
> configuration. JournalNodes run on separate pods and have their own Kerberos
> principal "jn/<hostname>@<realm>".
> Reporter: Steve Vaughan
> Assignee: Steve Vaughan
> Priority: Major
> Labels: pull-request-available
>
> GetJournalEditServlet uses request.getRemoteuser() to determine the
> remoteShortName for Kerberos authorization, which fails to match when the
> JournalNode uses its own Kerberos principal (e.g. jn/<hostname>@<realm>).
> This can be fixed by using the UserGroupInformation provided by the base
> DfsServlet class using the getUGI(request, conf) call.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]