[
https://issues.apache.org/jira/browse/HDFS-17072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17746168#comment-17746168
]
ASF GitHub Bot commented on HDFS-17072:
---------------------------------------
hfutatzhanghb commented on code in PR #5825:
URL: https://github.com/apache/hadoop/pull/5825#discussion_r1271685641
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java:
##########
@@ -776,4 +792,25 @@ private void accumulateTimeWaiting() {
perfTimer.reset().start();
}
}
+
+ /**
+ * Trigger an instant run of directory scanner if it's not running currently.
+ * @return
+ */
+ public String triggerDirectoryScanner() throws IOException {
+ if (reconcileRunning.get()) {
+ return "Trigger DirectoryScanner failed, beacause it's running. Please
try again later.";
+ }
+ try {
+ reconcile();
+ } catch (Exception e) {
+ // Log and reset reconcileRunning.
+ LOG.error(
+ "Exception during trigger DirectoryScanner execution, " +
+ "Try again later.", e);
+ reconcileRunning.set(false);
+ throw e;
+ }
Review Comment:
Nice suggestions. Have fixed it. Thanks~
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java:
##########
@@ -776,4 +792,25 @@ private void accumulateTimeWaiting() {
perfTimer.reset().start();
}
}
+
+ /**
+ * Trigger an instant run of directory scanner if it's not running currently.
+ * @return
+ */
+ public String triggerDirectoryScanner() throws IOException {
+ if (reconcileRunning.get()) {
+ return "Trigger DirectoryScanner failed, beacause it's running. Please
try again later.";
Review Comment:
have fixed. Thanks a lot ~
##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientDatanodeProtocol.proto:
##########
@@ -146,6 +146,16 @@ message TriggerBlockReportRequestProto {
message TriggerBlockReportResponseProto {
}
+message TriggerDirectoryScannerRequestProto {
+}
+
+/**
+ * result - execution reulst.
Review Comment:
Thanks @tomscut a lot, have fixed.
> DFSAdmin: add a triggerDirectoryScanner command
> ------------------------------------------------
>
> Key: HDFS-17072
> URL: https://issues.apache.org/jira/browse/HDFS-17072
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: datanode
> Affects Versions: 3.4.0
> Reporter: farmmamba
> Assignee: farmmamba
> Priority: Major
> Labels: pull-request-available
>
> Like -triggerBlockReport, I think we should add a command named
> -triggerVolumeScanner to manually trigger volume scanner run immediately.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]