Whamcloud - gitweb
LU-7079 ptlrpc: imp_peer_committed_transno should increase 61/16161/5
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Tue, 1 Sep 2015 14:28:46 +0000 (17:28 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 4 Sep 2015 05:16:06 +0000 (05:16 +0000)
imp_peer_committed_transno should not decrease as this can
confuse the users if imp_peer_committed_transno is used to
check commit status.

Change-Id: I8a1fdc651d837987bbe9aecc859b36849f9ee0a7
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/16161
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osp/osp_sync.c
lustre/ptlrpc/client.c

index f0d785a..4b6d68a 100644 (file)
@@ -937,7 +937,6 @@ static void osp_sync_process_committed(const struct lu_env *env,
        spin_unlock(&d->opd_syn_lock);
 
        while (!list_empty(&list)) {
        spin_unlock(&d->opd_syn_lock);
 
        while (!list_empty(&list)) {
-               struct llog_cookie *lcookie = NULL;
                struct osp_job_req_args *jra;
 
                jra = list_entry(list.next, struct osp_job_req_args, jra_link);
                struct osp_job_req_args *jra;
 
                jra = list_entry(list.next, struct osp_job_req_args, jra_link);
@@ -949,18 +948,18 @@ static void osp_sync_process_committed(const struct lu_env *env,
                body = req_capsule_client_get(&req->rq_pill,
                                              &RMF_OST_BODY);
                LASSERT(body);
                body = req_capsule_client_get(&req->rq_pill,
                                              &RMF_OST_BODY);
                LASSERT(body);
-               lcookie = &body->oa.o_lcookie;
                /* import can be closing, thus all commit cb's are
                 * called we can check committness directly */
                /* import can be closing, thus all commit cb's are
                 * called we can check committness directly */
-               if (req->rq_transno <= imp->imp_peer_committed_transno) {
-                       rc = llog_cat_cancel_records(env, llh, 1, lcookie);
+               if (req->rq_import_generation == imp->imp_generation) {
+                       rc = llog_cat_cancel_records(env, llh, 1,
+                                                    &body->oa.o_lcookie);
                        if (rc)
                                CERROR("%s: can't cancel record: %d\n",
                                       obd->obd_name, rc);
                } else {
                        if (rc)
                                CERROR("%s: can't cancel record: %d\n",
                                       obd->obd_name, rc);
                } else {
-                       DEBUG_REQ(D_HA, req, "not committed");
+                       DEBUG_REQ(D_ERROR, req, "imp_committed = "LPU64,
+                                 imp->imp_peer_committed_transno);
                }
                }
-
                ptlrpc_req_finished(req);
                done++;
        }
                ptlrpc_req_finished(req);
                done++;
        }
index 370c145..a791abf 100644 (file)
@@ -1283,6 +1283,7 @@ static int after_reply(struct ptlrpc_request *req)
         struct obd_device *obd = req->rq_import->imp_obd;
         int rc;
         struct timeval work_start;
         struct obd_device *obd = req->rq_import->imp_obd;
         int rc;
         struct timeval work_start;
+       __u64 committed;
         long timediff;
         ENTRY;
 
         long timediff;
         ENTRY;
 
@@ -1437,10 +1438,9 @@ static int after_reply(struct ptlrpc_request *req)
                 /*
                  * Replay-enabled imports return commit-status information.
                  */
                 /*
                  * Replay-enabled imports return commit-status information.
                  */
-                if (lustre_msg_get_last_committed(req->rq_repmsg)) {
-                        imp->imp_peer_committed_transno =
-                                lustre_msg_get_last_committed(req->rq_repmsg);
-                }
+               committed = lustre_msg_get_last_committed(req->rq_repmsg);
+               if (likely(committed > imp->imp_peer_committed_transno))
+                       imp->imp_peer_committed_transno = committed;
 
                ptlrpc_free_committed(imp);
 
 
                ptlrpc_free_committed(imp);