public static List<TDataNodeLocation> getReadableDataNodeLocations() {
    try (final ConfigNodeClient client =
        ConfigNodeClientManager.getInstance().borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
      final TGetDataNodeLocationsResp showDataNodesResp = client.getReadableDataNodeLocations();
      if (showDataNodesResp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
        throw new IoTDBRuntimeException(
            "An error occurred when executing getReadableDataNodeLocations():"
                + showDataNodesResp.getStatus().getMessage(),
            QUERY_PROCESS_ERROR.getStatusCode());
      }
      return showDataNodesResp.getDataNodeLocationList();
    } catch (final ClientManagerException | TException e) {
      throw new IoTDBRuntimeException(
          "An error occurred when executing getReadableDataNodeLocations():" + e.getMessage(),
          QUERY_PROCESS_ERROR.getStatusCode());
    }
  }
DataNode in these states is readable: Running, ReadOnly, Removing
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/DataNodeLocationSupplierFactory.java