Whamcloud - gitweb
LU-10383 hsm: ignore compound_id 49/30949/5
authorJohn L. Hammond <john.hammond@intel.com>
Mon, 18 Dec 2017 15:24:33 +0000 (09:24 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 9 Apr 2018 19:48:11 +0000 (19:48 +0000)
Ignore request compound ids in the HSM coordinator. Compound ids
prevent batching of CDT to CT requests and degrade HSM
performance. Use CT/archive id compatabiliy when deciding which HSM
actions to put in a request.

Test-Parameters: trivial testlist=sanity-hsm
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I38513f3b75313eb78bfb9811ab4e40e3e2b904c7
Reviewed-on: https://review.whamcloud.com/30949
Tested-by: Jenkins
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/doc/llapi_hsm_copytool_register.3
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/mdt/mdt_coordinator.c
lustre/mdt/mdt_hsm_cdt_actions.c
lustre/mdt/mdt_hsm_cdt_agent.c
lustre/mdt/mdt_hsm_cdt_client.c
lustre/mdt/mdt_hsm_cdt_requests.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lib.c

index 04fe5d6..22e5047 100644 (file)
@@ -90,7 +90,7 @@ hsm_action_item\fP:
 struct hsm_action_list {
    __u32 hal_version;
    __u32 hal_count;         /* number of hai\(aqs to follow */
-   __u64 hal_compound_id;   /* returned by coordinator */
+   __u64 hal_compound_id;   /* obsolete and may be ignored */
    __u64 hal_flags;
    __u32 hal_archive_id;    /* which archive backend */
    __u32 padding1;
index c4c2f53..8f90c54 100644 (file)
@@ -2768,7 +2768,7 @@ struct llog_agent_req_rec {
                                                 * agent_req_status */
        __u32                   arr_archive_id; /**< backend archive number */
        __u64                   arr_flags;      /**< req flags */
-       __u64                   arr_compound_id;        /**< compound cookie */
+       __u64                   arr_compound_id; /**< compound cookie, ignored */
        __u64                   arr_req_create; /**< req. creation time */
        __u64                   arr_req_change; /**< req. status change time */
        struct hsm_action_item  arr_hai;        /**< req. to the agent */
index 65f718a..5eb01f5 100644 (file)
@@ -1871,7 +1871,7 @@ static inline char *hai_dump_data_field(const struct hsm_action_item *hai,
 struct hsm_action_list {
        __u32 hal_version;
        __u32 hal_count;       /* number of hai's to follow */
-       __u64 hal_compound_id; /* returned by coordinator */
+       __u64 hal_compound_id; /* returned by coordinator, ignored */
        __u64 hal_flags;
        __u32 hal_archive_id; /* which archive backend */
        __u32 padding1;
index b240afe..02efdb7 100644 (file)
@@ -101,21 +101,21 @@ void mdt_hsm_dump_hal(int level, const char *prefix,
        struct hsm_action_item  *hai;
        char                     buf[12];
 
-       CDEBUG(level, "%s: HAL header: version %X count %d compound %#llx"
+       CDEBUG(level, "%s: HAL header: version %X count %d"
                      " archive_id %d flags %#llx\n",
               prefix, hal->hal_version, hal->hal_count,
-              hal->hal_compound_id, hal->hal_archive_id, hal->hal_flags);
+              hal->hal_archive_id, hal->hal_flags);
 
        hai = hai_first(hal);
        for (i = 0; i < hal->hal_count; i++) {
                sz = hai->hai_len - sizeof(*hai);
                CDEBUG(level, "%s %d: fid="DFID" dfid="DFID
-                      " compound/cookie=%#llx/%#llx"
+                      " cookie=%#llx"
                       " action=%s extent=%#llx-%#llx gid=%#llx"
                       " datalen=%d data=[%s]\n",
                       prefix, i,
                       PFID(&hai->hai_fid), PFID(&hai->hai_dfid),
-                      hal->hal_compound_id, hai->hai_cookie,
+                      hai->hai_cookie,
                       hsm_copytool_action2name(hai->hai_action),
                       hai->hai_extent.offset,
                       hai->hai_extent.length,
@@ -157,6 +157,8 @@ static int mdt_cdt_waiting_cb(const struct lu_env *env,
        struct coordinator *cdt = &mdt->mdt_coordinator;
        struct hsm_scan_request *request;
        struct hsm_action_item *hai;
+       size_t hai_size;
+       u32 archive_id;
        int i;
 
        /* Are agents full? */
@@ -177,12 +179,15 @@ static int mdt_cdt_waiting_cb(const struct lu_env *env,
                }
        }
 
-       /* first search whether the request is found in the list we
-        * have built. */
+       hai_size = cfs_size_round(larr->arr_hai.hai_len);
+       archive_id = larr->arr_archive_id;
+
+       /* Can we add this action to one of the existing HALs in hsd. */
        request = NULL;
        for (i = 0; i < hsd->hsd_request_count; i++) {
-               if (hsd->hsd_request[i].hal->hal_compound_id ==
-                   larr->arr_compound_id) {
+               if (hsd->hsd_request[i].hal->hal_archive_id == archive_id &&
+                   hsd->hsd_request[i].hal_used_sz + hai_size <=
+                   LDLM_MAXREQSIZE) {
                        request = &hsd->hsd_request[i];
                        break;
                }
@@ -204,57 +209,42 @@ static int mdt_cdt_waiting_cb(const struct lu_env *env,
                /* allocates hai vector size just needs to be large
                 * enough */
                request->hal_sz = sizeof(*request->hal) +
-                       cfs_size_round(MTI_NAME_MAXLEN + 1) +
-                       2 * cfs_size_round(larr->arr_hai.hai_len);
-               OBD_ALLOC(hal, request->hal_sz);
+                       cfs_size_round(MTI_NAME_MAXLEN + 1) + 2 * hai_size;
+               OBD_ALLOC_LARGE(hal, request->hal_sz);
                if (!hal)
                        RETURN(-ENOMEM);
 
                hal->hal_version = HAL_VERSION;
                strlcpy(hal->hal_fsname, hsd->hsd_fsname, MTI_NAME_MAXLEN + 1);
-               hal->hal_compound_id = larr->arr_compound_id;
                hal->hal_archive_id = larr->arr_archive_id;
                hal->hal_flags = larr->arr_flags;
                hal->hal_count = 0;
                request->hal_used_sz = hal_size(hal);
                request->hal = hal;
                hsd->hsd_request_count++;
-               hai = hai_first(hal);
-       } else {
-               /* request is known */
-               /* we check if record archive num is the same as the
-                * known request, if not we will serve it in multiple
-                * time because we do not know if the agent can serve
-                * multiple backend a use case is a compound made of
-                * multiple restore where the files are not archived
-                * in the same backend */
-               if (larr->arr_archive_id != request->hal->hal_archive_id)
-                       RETURN(0);
+       } else if (request->hal_sz < request->hal_used_sz + hai_size) {
+               /* Not enough room, need an extension */
+               void *hal_buffer;
+               int sz;
 
-               if (request->hal_sz < request->hal_used_sz +
-                   cfs_size_round(larr->arr_hai.hai_len)) {
-                       /* Not enough room, need an extension */
-                       void *hal_buffer;
-                       int sz;
-
-                       sz = 2 * request->hal_sz;
-                       OBD_ALLOC(hal_buffer, sz);
-                       if (!hal_buffer)
-                               RETURN(-ENOMEM);
-                       memcpy(hal_buffer, request->hal, request->hal_used_sz);
-                       OBD_FREE(request->hal, request->hal_sz);
-                       request->hal = hal_buffer;
-                       request->hal_sz = sz;
-               }
+               sz = min_t(int, 2 * request->hal_sz, LDLM_MAXREQSIZE);
+               LASSERT(request->hal_used_sz + hai_size < sz);
 
-               hai = hai_first(request->hal);
-               for (i = 0; i < request->hal->hal_count; i++)
-                       hai = hai_next(hai);
+               OBD_ALLOC_LARGE(hal_buffer, sz);
+               if (!hal_buffer)
+                       RETURN(-ENOMEM);
+
+               memcpy(hal_buffer, request->hal, request->hal_used_sz);
+               OBD_FREE_LARGE(request->hal, request->hal_sz);
+               request->hal = hal_buffer;
+               request->hal_sz = sz;
        }
 
+       hai = hai_first(request->hal);
+       for (i = 0; i < request->hal->hal_count; i++)
+               hai = hai_next(hai);
+
        memcpy(hai, &larr->arr_hai, larr->arr_hai.hai_len);
-       hai->hai_cookie = larr->arr_hai.hai_cookie;
-       hai->hai_gid = larr->arr_hai.hai_gid;
 
        request->hal_used_sz += cfs_size_round(hai->hai_len);
        request->hal->hal_count++;
@@ -680,7 +670,7 @@ static int mdt_coordinator(void *data)
                /* Allocate a temporary array to store the cookies to
                 * update, and their status. */
                updates_sz = updates_cnt * sizeof(*updates);
-               OBD_ALLOC(updates, updates_sz);
+               OBD_ALLOC_LARGE(updates, updates_sz);
                if (updates == NULL) {
                        CERROR("%s: Cannot allocate memory (%d o) "
                               "for %d updates\n",
@@ -729,14 +719,14 @@ static int mdt_coordinator(void *data)
                                       mdt_obd_name(mdt), rc, update_idx);
                }
 
-               OBD_FREE(updates, updates_sz);
+               OBD_FREE_LARGE(updates, updates_sz);
 
 clean_cb_alloc:
                /* free hal allocated by callback */
                for (i = 0; i < hsd.hsd_request_count; i++) {
                        struct hsm_scan_request *request = &hsd.hsd_request[i];
 
-                       OBD_FREE(request->hal, request->hal_sz);
+                       OBD_FREE_LARGE(request->hal, request->hal_sz);
                }
        }
 
@@ -1033,10 +1023,6 @@ int mdt_hsm_cdt_init(struct mdt_device *mdt)
        cdt->cdt_policy = CDT_DEFAULT_POLICY;
        cdt->cdt_active_req_timeout = 3600;
 
-       /* Initialize cdt_compound_id here to allow its usage for
-        * delayed requests from RAoLU policy */
-       atomic_set(&cdt->cdt_compound_id, ktime_get_real_seconds());
-
        /* by default do not remove archives on last unlink */
        cdt->cdt_remove_archive_on_last_unlink = false;
 
@@ -1268,8 +1254,7 @@ int mdt_hsm_add_hal(struct mdt_thread_info *mti,
                                GOTO(out, rc);
                }
 
-               car = mdt_cdt_alloc_request(hal->hal_compound_id,
-                                           hal->hal_archive_id, hal->hal_flags,
+               car = mdt_cdt_alloc_request(hal->hal_archive_id, hal->hal_flags,
                                            uuid, hai);
                if (IS_ERR(car))
                        GOTO(out, rc = PTR_ERR(car));
@@ -1797,7 +1782,6 @@ static int hsm_cancel_all_actions(struct mdt_device *mdt)
                obd_uuid2fsname(hal->hal_fsname, mdt_obd_name(mdt),
                                MTI_NAME_MAXLEN);
                hal->hal_fsname[MTI_NAME_MAXLEN] = '\0';
-               hal->hal_compound_id = car->car_compound_id;
                hal->hal_archive_id = car->car_archive_id;
                hal->hal_flags = car->car_flags;
                hal->hal_count = 0;
index 2dada63..93c4a05 100644 (file)
@@ -175,7 +175,7 @@ void dump_llog_agent_req_rec(const char *prefix,
        sz = larr->arr_hai.hai_len - sizeof(larr->arr_hai);
        CDEBUG(D_HSM, "%slrh=[type=%X len=%d idx=%d] fid="DFID
               " dfid="DFID
-              " compound/cookie=%#llx/%#llx"
+              " cookie=%#llx"
               " status=%s action=%s archive#=%d flags=%#llx"
               " create=%llu change=%llu"
               " extent=%#llx-%#llx gid=%#llx datalen=%d"
@@ -185,7 +185,7 @@ void dump_llog_agent_req_rec(const char *prefix,
               larr->arr_hdr.lrh_len, larr->arr_hdr.lrh_index,
               PFID(&larr->arr_hai.hai_fid),
               PFID(&larr->arr_hai.hai_dfid),
-              larr->arr_compound_id, larr->arr_hai.hai_cookie,
+              larr->arr_hai.hai_cookie,
               agent_req_status2name(larr->arr_status),
               hsm_copytool_action2name(larr->arr_hai.hai_action),
               larr->arr_archive_id,
@@ -250,16 +250,14 @@ int cdt_llog_process(const struct lu_env *env, struct mdt_device *mdt,
  * add an entry in agent llog
  * \param env [IN] environment
  * \param mdt [IN] PDT device
- * \param compound_id [IN] global id associated with the record
  * \param archive_id [IN] backend archive number
  * \param hai [IN] record to register
  * \retval 0 success
  * \retval -ve failure
  */
-int mdt_agent_record_add(const struct lu_env *env,
-                        struct mdt_device *mdt,
-                        __u64 compound_id, __u32 archive_id,
-                        __u64 flags, struct hsm_action_item *hai)
+int mdt_agent_record_add(const struct lu_env *env, struct mdt_device *mdt,
+                        __u32 archive_id, __u64 flags,
+                        struct hsm_action_item *hai)
 {
        struct obd_device               *obd = mdt2obd_dev(mdt);
        struct coordinator              *cdt = &mdt->mdt_coordinator;
@@ -276,7 +274,6 @@ int mdt_agent_record_add(const struct lu_env *env,
        larr->arr_hdr.lrh_len = sz;
        larr->arr_hdr.lrh_type = HSM_AGENT_REC;
        larr->arr_status = ARS_WAITING;
-       larr->arr_compound_id = compound_id;
        larr->arr_archive_id = archive_id;
        larr->arr_flags = flags;
        larr->arr_req_create = ktime_get_real_seconds();
@@ -559,7 +556,7 @@ static int hsm_actions_show_cb(const struct lu_env *env,
                   llh->lgh_hdr->llh_cat_idx, hdr->lrh_index,
                   PFID(&larr->arr_hai.hai_fid),
                   PFID(&larr->arr_hai.hai_dfid),
-                  larr->arr_compound_id, larr->arr_hai.hai_cookie,
+                  0ULL /* compound_id */, larr->arr_hai.hai_cookie,
                   hsm_copytool_action2name(larr->arr_hai.hai_action),
                   larr->arr_archive_id,
                   larr->arr_flags,
index b7c8ce0..f863eca 100644 (file)
@@ -310,7 +310,6 @@ int mdt_hsm_find_best_agent(struct coordinator *cdt, __u32 archive,
 int mdt_hsm_send_action_to_each_archive(struct mdt_thread_info *mti,
                                    struct hsm_action_item *hai)
 {
-       __u64 compound_id;
        struct hsm_agent *ha;
        __u32 archive_mask = 0;
        struct coordinator *cdt = &mti->mti_mdt->mdt_coordinator;
@@ -328,13 +327,10 @@ int mdt_hsm_send_action_to_each_archive(struct mdt_thread_info *mti,
                                continue;
                        archive_mask |= (1 << ha->ha_archive_id[i]);
 
-                       /* XXX: instead of creating one request record per
-                        * new action, it could make sense to gather
-                        * all for the same archive_id as one compound
-                        * request/id, like in mdt_hsm_add_actions() ?? */
-                       compound_id = atomic_inc_return(&cdt->cdt_compound_id);
+                       /* XXX: it could make sense to gather all
+                        * actions for the same archive_id like in
+                        * mdt_hsm_add_actions() ?? */
                        rc = mdt_agent_record_add(mti->mti_env, mti->mti_mdt,
-                                                 compound_id,
                                                  ha->ha_archive_id[i], 0,
                                                  hai);
                        if (rc) {
@@ -361,7 +357,7 @@ int mdt_hsm_send_action_to_each_archive(struct mdt_thread_info *mti,
 }
 
 /**
- * send a compound request to the agent
+ * send a HAL to the agent
  * \param mti [IN] context
  * \param hal [IN] request (can be a kuc payload)
  * \param purge [IN] purge mode (no record)
@@ -511,7 +507,7 @@ int mdt_hsm_agent_send(struct mdt_thread_info *mti,
 
                        /* incompatible request, we abort the request */
                        /* next time coordinator will wake up, it will
-                        * make the same compound with valid only
+                        * make the same HAL with valid only
                         * records */
                        fail_request = true;
                        rc = mdt_agent_record_update(mti->mti_env, mdt,
@@ -533,10 +529,10 @@ int mdt_hsm_agent_send(struct mdt_thread_info *mti,
                }
        }
 
-       /* we found incompatible requests, so the compound cannot be send
+       /* we found incompatible requests, so the HAL cannot be sent
         * as is. Bad records have been invalidated in llog.
         * Valid one will be reschedule next time coordinator will wake up
-        * So no need the rebuild a full valid compound request now
+        * So no need the rebuild a full valid HAL now
         */
        if (fail_request)
                GOTO(out_buf, rc = 0);
index c8f4d1e..8e388b7 100644 (file)
@@ -293,9 +293,6 @@ static int mdt_hsm_register_hal(struct mdt_thread_info *mti,
        int                      rc, i;
        struct md_hsm            mh;
        bool                     is_restore = false;
-       __u64                    compound_id;
-
-       compound_id = atomic_inc_return(&cdt->cdt_compound_id);
 
        hai = hai_first(hal);
        for (i = 0; i < hal->hal_count; i++, hai = hai_next(hai)) {
@@ -371,7 +368,7 @@ static int mdt_hsm_register_hal(struct mdt_thread_info *mti,
                 * or we use the default if none found in lma
                 * this works also for archive because the default value is 0
                 * /!\ there is a side effect: in case of restore on multiple
-                * files which are in different backend, the initial compound
+                * files which are in different backend, the initial
                 * request will be split in multiple requests because we cannot
                 * warranty an agent can serve any combinaison of archive
                 * backend
@@ -404,8 +401,8 @@ record:
                 */
                OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_HSM_CDT_DELAY, cfs_fail_val);
                /* record request */
-               rc = mdt_agent_record_add(mti->mti_env, mdt, compound_id,
-                                         archive_id, flags, hai);
+               rc = mdt_agent_record_add(mti->mti_env, mdt, archive_id, flags,
+                                         hai);
                if (rc)
                        GOTO(out, rc);
        }
index 98bb7c4..a68f4fe 100644 (file)
@@ -103,13 +103,13 @@ void dump_requests(char *prefix, struct coordinator *cdt)
        down_read(&cdt->cdt_request_lock);
        list_for_each_entry(car, &cdt->cdt_request_list, car_request_list) {
                CDEBUG(D_HSM, "%s fid="DFID" dfid="DFID
-                      " compound/cookie=%#llx/%#llx"
+                      " cookie=%#llx"
                       " action=%s archive#=%d flags=%#llx"
                       " extent=%#llx-%#llx"
                       " gid=%#llx refcount=%d canceled=%d\n",
                       prefix, PFID(&car->car_hai->hai_fid),
                       PFID(&car->car_hai->hai_dfid),
-                      car->car_compound_id, car->car_hai->hai_cookie,
+                      car->car_hai->hai_cookie,
                       hsm_copytool_action2name(car->car_hai->hai_action),
                       car->car_archive_id, car->car_flags,
                       car->car_hai->hai_extent.offset,
@@ -280,7 +280,6 @@ static void mdt_cdt_init_request_tree(struct cdt_req_progress *crp)
 
 /** Allocate/init an agent request and its sub-structures.
  *
- * \param compound_id [IN]
  * \param archive_id [IN]
  * \param flags [IN]
  * \param uuid [IN]
@@ -288,8 +287,8 @@ static void mdt_cdt_init_request_tree(struct cdt_req_progress *crp)
  * \retval car [OUT] success valid structure
  * \retval car [OUT]
  */
-struct cdt_agent_req *mdt_cdt_alloc_request(__u64 compound_id, __u32 archive_id,
-                                           __u64 flags, struct obd_uuid *uuid,
+struct cdt_agent_req *mdt_cdt_alloc_request(__u32 archive_id, __u64 flags,
+                                           struct obd_uuid *uuid,
                                            struct hsm_action_item *hai)
 {
        struct cdt_agent_req *car;
@@ -300,7 +299,6 @@ struct cdt_agent_req *mdt_cdt_alloc_request(__u64 compound_id, __u32 archive_id,
                RETURN(ERR_PTR(-ENOMEM));
 
        atomic_set(&car->car_refcount, 1);
-       car->car_compound_id = compound_id;
        car->car_archive_id = archive_id;
        car->car_flags = flags;
        car->car_canceled = 0;
@@ -581,7 +579,7 @@ static int mdt_hsm_active_requests_proc_show(struct seq_file *s, void *v)
                   " data=[%s] canceled=%d uuid=%s done=%llu\n",
                   PFID(&car->car_hai->hai_fid),
                   PFID(&car->car_hai->hai_dfid),
-                  car->car_compound_id, car->car_hai->hai_cookie,
+                  0ULL /* compound_id */, car->car_hai->hai_cookie,
                   hsm_copytool_action2name(car->car_hai->hai_action),
                   car->car_archive_id, car->car_flags,
                   car->car_hai->hai_extent.offset,
index 8289384..26bb09e 100644 (file)
@@ -136,8 +136,6 @@ struct coordinator {
        __u64                    cdt_policy;         /**< policy flags */
        enum cdt_states          cdt_state;           /**< state */
        struct mutex             cdt_state_lock;      /**< cdt_state lock */
-       atomic_t                 cdt_compound_id;     /**< compound id
-                                                      * counter */
        __u64                    cdt_last_cookie;     /**< last cookie
                                                       * allocated */
        struct rw_semaphore      cdt_llog_lock;       /**< protect llog
@@ -508,7 +506,6 @@ struct cdt_agent_req {
        struct hlist_node        car_cookie_hash;  /**< find req by cookie */
        struct list_head         car_request_list; /**< to chain all the req. */
        atomic_t                 car_refcount;     /**< reference counter */
-       __u64                    car_compound_id;  /**< compound id */
        __u64                    car_flags;        /**< request original flags */
        struct obd_uuid          car_uuid;         /**< agent doing the req. */
        __u32                    car_archive_id;   /**< archive id */
@@ -911,8 +908,8 @@ int cdt_llog_process(const struct lu_env *env, struct mdt_device *mdt,
                     llog_cb_t cb, void *data, u32 start_cat_idx,
                     u32 start_rec_idx, int rw);
 int mdt_agent_record_add(const struct lu_env *env, struct mdt_device *mdt,
-                        __u64 compound_id, __u32 archive_id,
-                        __u64 flags, struct hsm_action_item *hai);
+                        __u32 archive_id, __u64 flags,
+                        struct hsm_action_item *hai);
 int mdt_agent_record_update(const struct lu_env *env, struct mdt_device *mdt,
                            struct hsm_record_update *updates,
                            unsigned int updates_count);
@@ -951,8 +948,8 @@ extern struct cfs_hash_ops cdt_request_cookie_hash_ops;
 extern struct cfs_hash_ops cdt_agent_record_hash_ops;
 extern const struct file_operations mdt_hsm_active_requests_fops;
 void dump_requests(char *prefix, struct coordinator *cdt);
-struct cdt_agent_req *mdt_cdt_alloc_request(__u64 compound_id, __u32 archive_id,
-                                           __u64 flags, struct obd_uuid *uuid,
+struct cdt_agent_req *mdt_cdt_alloc_request(__u32 archive_id, __u64 flags,
+                                           struct obd_uuid *uuid,
                                            struct hsm_action_item *hai);
 void mdt_cdt_free_request(struct cdt_agent_req *car);
 int mdt_cdt_add_request(struct coordinator *cdt, struct cdt_agent_req *new_car);
index aa0c25c..d2aeb80 100644 (file)
@@ -859,7 +859,6 @@ int mdt_handle_last_unlink(struct mdt_thread_info *info, struct mdt_object *mo,
                .hai_cookie = 0,
                .hai_gid = 0,
        };
-       __u64 compound_id;
        int archive_id;
 
         ENTRY;
@@ -929,7 +928,6 @@ int mdt_handle_last_unlink(struct mdt_thread_info *info, struct mdt_object *mo,
         * file is unlinked, file is archived, so create remove request
         * for copytool!
         * If CDT is not running, requests will be logged for later. */
-       compound_id = atomic_inc_return(&cdt->cdt_compound_id);
        if (ma->ma_hsm.mh_arch_id != 0)
                archive_id = ma->ma_hsm.mh_arch_id;
        else
@@ -937,8 +935,8 @@ int mdt_handle_last_unlink(struct mdt_thread_info *info, struct mdt_object *mo,
 
        hai.hai_fid = *mdt_object_fid(mo);
 
-       rc = mdt_agent_record_add(info->mti_env, info->mti_mdt,
-                                 compound_id, archive_id, 0, &hai);
+       rc = mdt_agent_record_add(info->mti_env, info->mti_mdt, archive_id, 0,
+                                 &hai);
        if (rc)
                CERROR("%s: unable to add HSM remove request for "DFID
                       ": rc=%d\n", mdt_obd_name(info->mti_mdt),