--- ./source/private_module/rep_rm/om/reprm_om.c	2018-03-23 07:58:10.000000000 +0000
+++ ./source/private_module/rep_rm/om/reprm_om.c.hotpatch	2020-01-17 06:54:35.000000000 +0000
@@ -11451,72 +11451,76 @@
     REPRM_PAIR_LOCK_PARAM_S lockParam = {0};
     RSS_TASK_PARAM_S taskParam = {0};
     bool isPrimary;
+    VSTORE_PAIR_BASEINFO_S vstorePairInfo = {0};
 
     smoothParam = (REPRM_SMOOTH_PARAM_S *)context;    
     commParam = &smoothParam->commParam;
     
+    if (0 != smoothParam->commParam.vstorePairId && INVALID_VALUE64 != smoothParam->commParam.vstorePairId)
+	{
+    	result = getRepVstoreBaseInfo(smoothParam->commParam.vstorePairId, &vstorePairInfo);
+		if (RETURN_OK != result)
+		{        
+			DBG_LogError(REPRM_LOG_ID_NEW, "Get vstore(%llx) baseInfo fail, localId(%u).", 
+			    smoothParam->commParam.vstorePairId, smoothParam->commParam.localIndex);
+		}
+	}
+		
     if(RETURN_OK != ret)
     {
-        DBG_LogError(REPRM_LOG_ID_NEW, "Lock pair failed when smooth,localId(%u).",
-                smoothParam->commParam.localIndex);
-        reprmVstPutDLMLockByLocalId(smoothParam->commParam.localIndex, smoothParam->commParam.dlmLockFlag);
+        DBG_LogError(REPRM_LOG_ID_NEW, "Lock pair failed when smooth,localId(%u), vstPairId(0x%llx), lockFlag(%u).",
+            smoothParam->commParam.localIndex, smoothParam->commParam.vstorePairId, smoothParam->commParam.dlmLockFlag);
+		reprmVstPutDlmLock(vstorePairInfo.localPairId, &smoothParam->commParam.dlmLockFlag, DLM_MODE_SHARED);
         handleRepRmRpcFwdMsgMstErr(context, RETURN_ERROR);
         return;
     }
-
     DBG_LogInfo(REPRM_LOG_ID_NEW, 
         "Smooth lock pair success, localId(%u), opcode(%u).", 
         smoothParam->commParam.localIndex, smoothParam->commParam.opCode);
-    
     setReprmPairLockKey(commParam->localIndex, commParam->localDsId, &lockParam);
-
-    /* жǷǹ,ȡʧܣѾfsٴƽ */
     dsId = getRepRmPairLocalResId(commParam->localIndex);  
     if (INVALID_VALUE32 == dsId)
     {
+        DBG_LogError(REPRM_LOG_ID_NEW, "This is not workctrol,pairId(%llx),localId(%u).", 
+                     commParam->pairId, commParam->localIndex);
         UNLOCK_REPRM_3DC_PAIR(&lockParam);
-        reprmVstPutDLMLockByLocalId(smoothParam->commParam.localIndex, smoothParam->commParam.dlmLockFlag);
+		reprmVstPutDlmLock(vstorePairInfo.localPairId, &smoothParam->commParam.dlmLockFlag, DLM_MODE_SHARED);
         handleRepRmRpcFwdMsgMstErr(context, RETURN_ERROR);
         return;
     }
-    
-    /*ж־λ*/
     if(!isRepRmPairExist(commParam->localIndex))
-    {        
+    {    
+        DBG_LogError(REPRM_LOG_ID_NEW, "Pair has not started service,pairId(%llx),localId(%u).", 
+                     commParam->pairId, commParam->localIndex);
         UNLOCK_REPRM_3DC_PAIR(&lockParam);
         reprmVstPutDLMLockByLocalId(smoothParam->commParam.localIndex, smoothParam->commParam.dlmLockFlag);
         handleRepRmRpcFwdMsgMstErr(context, RETURN_ERROR);
         return;
     }
-
-    /* ̵̨ʱֻ˷Ѿ˺̨ */
     getRepRmSvcStatus(commParam->localIndex, &svcStatus);
     if(REPRM_PAIR_SVC_START != svcStatus
         && REPRM_PAIR_SVC_START_BGR != svcStatus)
     {
-        DBG_LogError(REPRM_LOG_ID_NEW, "Pair has not started service,pairId(%llx).", 
-                     commParam->pairId);
+        DBG_LogError(REPRM_LOG_ID_NEW, "Pair has not started service,pairId(%llx),localId(%u).", 
+                     commParam->pairId, commParam->localIndex);
         UNLOCK_REPRM_3DC_PAIR(&lockParam);
-        reprmVstPutDLMLockByLocalId(smoothParam->commParam.localIndex, smoothParam->commParam.dlmLockFlag);
+		reprmVstPutDlmLock(vstorePairInfo.localPairId, &smoothParam->commParam.dlmLockFlag, DLM_MODE_SHARED);
         handleRepRmRpcFwdMsgMstErr(context, RETURN_ERROR);
         return; 
     }     
 
-    /*յӶ˷ƽ*/
     getRepRmPairisPrimary(commParam->localIndex, &isPrimary);
     if (!isPrimary)/*˫*/
     {
-        /*oplogԭundo,Ȼƽ*/
         if (checkSmoothUndoSwapRoleLog(commParam->localIndex))
         {
             handleRepRmSmthSwapRoleLog(smoothParam);
             return;
         }
-        /*Զƽ*/
         else
         {
-            DBG_LogWarning(REPRM_LOG_ID_NEW, "Start slv smooth,pairId(%llx).", 
-                         commParam->pairId);            
+            DBG_LogWarning(REPRM_LOG_ID_NEW, "Start slv smooth,pairId(%llx),localId(%u).", 
+                           commParam->pairId, commParam->localIndex);            
             smoothRepRmPair(commParam->localIndex, repRmReceiveSlvSmthCallback, NULL);
             UNLOCK_REPRM_3DC_PAIR(&lockParam);
             reprmVstPutDLMLockByLocalId(smoothParam->commParam.localIndex, smoothParam->commParam.dlmLockFlag);
@@ -11525,9 +11529,6 @@
         }
     }
 
-    //startRepExecFlowTrace(smoothParam->commParam.localIndex, REP_OPCODE_SMOOTH, MY_PID);
-
-    /* task */
     setReprmParentTaskParam(NULL, &taskParam);
     setReprmBaseTaskParam(REPRM_TASK_OPCODE_SMOOTH, REPRM_TASK_LEVEL_THIRD,
                           smoothParam, FALSE, &taskParam);
@@ -11537,14 +11538,13 @@
     if(RETURN_OK != result)
     {
         DBG_LogError(REPRM_LOG_ID_NEW, 
-                    "Gen smooth task failed,Pair(localId(%u), result(%u)).", 
+                    "Gen smooth task failed,Pair(localId(%u), result(%d)).", 
                         smoothParam->commParam.localIndex, result);
         UNLOCK_REPRM_3DC_PAIR(&lockParam);
         reprmVstPutDLMLockByLocalId(smoothParam->commParam.localIndex, smoothParam->commParam.dlmLockFlag);
         handleRepRmRpcFwdMsgMstErr(context, RETURN_ERROR);
         return ;
     }
-        
     return ;
 }
 
@@ -11675,23 +11675,25 @@
     REPRM_CONTEXT_PARAM_U *baseDbPar = NULL;
     uint64_t pairId = INVALID_VALUE64;
     uint32_t rmtArrId = INVALID_VALUE32;
-
+    uint64_t vstorePairId = INVALID_VALUE64;
+	uint32_t vstoreLocalId = INVALID_VALUE32;
     smoothParam = (REPRM_SMOOTH_PARAM_S *)outData; 
-
-    /* ֶ,ڹͳһ */
     smoothParam->commParam.msgId = msgId;
     smoothParam->commParam.rmtClusterId = srcArrayId;
     smoothParam->commParam.ibcSn= ibcSn;
     smoothParam->commParam.isPrimary = TRUE;
-
-    /* 1ȶȡpair info*/
     getRepRmPairAndArrId(smoothParam->commParam.localIndex, &pairId, &rmtArrId);
     if ((INVALID_VALUE64 != pairId) && (INVALID_VALUE32 != rmtArrId))
     {
+        getRepRmPairVstorePairId(smoothParam->commParam.localIndex, &vstorePairId, &vstoreLocalId);
+		if (INVALID_VALUE64 != vstorePairId && 0 != vstorePairId)
+		{
+			smoothParam->commParam.vstorePairId = vstorePairId;
+			smoothParam->commParam.vstoreLocalId = vstoreLocalId;
+		}
         handleRepRmMstSmooth(pairId, rmtArrId, smoothParam);
         return;
     }
-    /* 2pairInfoȡʧܶccdb */
     baseDbPar = (REPRM_CONTEXT_PARAM_U*)RSF_GET_FREE_NODE(REPRM_ASYNC_CONTEXT_PARTITION, PID_REPRM);
     if(NULL == baseDbPar)
     {
@@ -11700,10 +11702,8 @@
         return ;
     }
     memset(baseDbPar, 0 ,sizeof(REPRM_CONTEXT_PARAM_U));
-
     getRepRmBaseDbInfo(smoothParam->commParam.localIndex, getSmoothMstPairExistCallback, 
                 baseDbPar, smoothParam);
-    
     return;
 }    
 
