Updated on 2025-08-22 GMT+08:00

Asynchronously Deleting HDFS Data

Scenario

When it comes to deleting large directories, the HDFS asynchronous deletion feature can be used to delete blocks asynchronously with traffic control. This can effectively shorten the lock holding time.

Notes and Constraints

This function is available in MRS 3.5.0 or later only.

Procedure

  1. Log in to FusionInsight Manager.

    For details about how to log in to FusionInsight Manager, see Accessing MRS FusionInsight Manager.

  2. Choose Cluster > Services > HDFS > Configurations > All Configurations.
  3. Enter the parameter name in the search box and modify the HDFS service-level parameter as you need.

    Table 1 Parameters for configuring HDFS asynchronous deletion

    Parameter

    Description

    Example Value

    dfs.namenode.block.deletion.async

    Whether to enable the asynchronous block deletion feature.

    • true: The function is enabled. Then, the block deletion is executed asynchronously.
    • false: The function is disabled. Then the deletion operation is performed synchronously, which may cause a delay.

    true

    dfs.namenode.block.deletion.lock.threshold.ms

    Maximum duration for continuously lock a directory or file. After asynchronous block deletion is enabled, the specified maximum value is applied. Unit: millisecond

    You can adjust the threshold based on the actual lock blocking status. For example, if the lock blocking time often exceeds the default value, you can increase the threshold to reduce unnecessary log records.

    50

    dfs.namenode.block.deletion.unlock.interval.ms

    Temporary unlock duration when the lock duration exceeds the maximum. Unit: millisecond

    10

  4. Save the configuration.
  5. Click the Instances tab, select all instances whose configurations have expired, choose More > Restart Instance, and restart the instances as prompted.