From 954b050371777292407b57dce8d66fc511350019 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 21 Feb 2023 17:55:47 +0800 Subject: [PATCH] HDFS-16928. Both getCurrentEditLogTxid and getEditsFromTxid should be OperationCategory.WRITE --- .../apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java index b19bfc13acf65..00d9fd39feab7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java @@ -2368,7 +2368,7 @@ public void checkAccess(String path, FsAction mode) throws IOException { public long getCurrentEditLogTxid() throws IOException { String operationName = "getCurrentEditLogTxid"; checkNNStartup(); - namesystem.checkOperation(OperationCategory.READ); // only active + namesystem.checkOperation(OperationCategory.WRITE); // only active namesystem.checkSuperuserPrivilege(operationName); // if it's not yet open for write, we may be in the process of transitioning // from standby to active and may not yet know what the latest committed @@ -2398,7 +2398,7 @@ private static FSEditLogOp readOp(EditLogInputStream elis) public EventBatchList getEditsFromTxid(long txid) throws IOException { String operationName = "getEditsFromTxid"; checkNNStartup(); - namesystem.checkOperation(OperationCategory.READ); // only active + namesystem.checkOperation(OperationCategory.WRITE); // only active namesystem.checkSuperuserPrivilege(operationName); int maxEventsPerRPC = nn.getConf().getInt( DFSConfigKeys.DFS_NAMENODE_INOTIFY_MAX_EVENTS_PER_RPC_KEY,