|
@@ -231,10 +231,11 @@ func (ms *memberStorage) handleInsertRequest(distTable *DistributionTable, reque
|
|
|
}
|
|
|
|
|
|
if err == nil {
|
|
|
+ var loc uint64
|
|
|
|
|
|
|
|
|
|
|
|
- loc, err := sm.Insert(request.Value)
|
|
|
+ loc, err = sm.Insert(request.Value)
|
|
|
|
|
|
if err == nil {
|
|
|
|
|
@@ -301,14 +302,14 @@ func (ms *memberStorage) handleUpdateRequest(distTable *DistributionTable, reque
|
|
|
|
|
|
|
|
|
if !request.Transfer {
|
|
|
- err = sm.Update(transRec.loc, request.Value)
|
|
|
- newVersion = transRec.ver + 1
|
|
|
+ err = sm.Update(transRec.Loc, request.Value)
|
|
|
+ newVersion = transRec.Ver + 1
|
|
|
|
|
|
} else {
|
|
|
newVersion = toUInt64(request.Args[RPVer])
|
|
|
|
|
|
- if newVersion >= transRec.ver {
|
|
|
- err = sm.Update(transRec.loc, request.Value)
|
|
|
+ if newVersion >= transRec.Ver {
|
|
|
+ err = sm.Update(transRec.Loc, request.Value)
|
|
|
|
|
|
} else {
|
|
|
|
|
@@ -330,7 +331,7 @@ func (ms *memberStorage) handleUpdateRequest(distTable *DistributionTable, reque
|
|
|
|
|
|
|
|
|
|
|
|
- _, _, err = ms.at.SetTransClusterLoc(dsname, cloc, transRec.loc, newVersion)
|
|
|
+ _, _, err = ms.at.SetTransClusterLoc(dsname, cloc, transRec.Loc, newVersion)
|
|
|
|
|
|
if err == nil {
|
|
|
|
|
@@ -400,7 +401,7 @@ func (ms *memberStorage) handleFreeRequest(distTable *DistributionTable, request
|
|
|
|
|
|
|
|
|
|
|
|
- err = sm.Free(transRec.loc)
|
|
|
+ err = sm.Free(transRec.Loc)
|
|
|
|
|
|
if !request.Transfer {
|
|
|
|
|
@@ -461,7 +462,7 @@ func (ms *memberStorage) handleFetchRequest(distTable *DistributionTable,
|
|
|
if sm != nil {
|
|
|
var res []byte
|
|
|
|
|
|
- err = sm.Fetch(transRec.loc, &res)
|
|
|
+ err = sm.Fetch(transRec.Loc, &res)
|
|
|
|
|
|
if err == nil {
|
|
|
|
|
@@ -546,7 +547,7 @@ func (ms *memberStorage) handleRebalanceRequest(distTable *DistributionTable, re
|
|
|
|
|
|
|
|
|
|
|
|
- if tr.ver < ver {
|
|
|
+ if tr.Ver < ver {
|
|
|
|
|
|
|
|
|
|
|
@@ -563,11 +564,11 @@ func (ms *memberStorage) handleRebalanceRequest(distTable *DistributionTable, re
|
|
|
|
|
|
|
|
|
|
|
|
- if err = sm.Update(tr.loc, res); err == nil {
|
|
|
+ if err = sm.Update(tr.Loc, res); err == nil {
|
|
|
|
|
|
|
|
|
|
|
|
- _, _, err = ms.at.SetTransClusterLoc(smname, cloc, tr.loc, ver)
|
|
|
+ _, _, err = ms.at.SetTransClusterLoc(smname, cloc, tr.Loc, ver)
|
|
|
|
|
|
manager.LogDebug(ms.ds.MemberManager.Name(),
|
|
|
fmt.Sprintf("(Store): Rebalance updated %v location: %v", smname, cloc))
|
|
@@ -621,7 +622,7 @@ func (ms *memberStorage) handleRebalanceRequest(distTable *DistributionTable, re
|
|
|
|
|
|
manager.LogDebug(ms.ds.MemberManager.Name(),
|
|
|
fmt.Sprintf("(Store): Rebalance removes %v location: %v from member %v",
|
|
|
- smname, tr.loc, rsource))
|
|
|
+ smname, tr.Loc, rsource))
|
|
|
|
|
|
_, err = ms.ds.sendDataRequest(rsource, &DataRequest{RTFree, map[DataRequestArg]interface{}{
|
|
|
RPStoreName: smname,
|
|
@@ -662,15 +663,15 @@ func (ms *memberStorage) dump(smname string) string {
|
|
|
if val != nil {
|
|
|
tr := val.(*transferRec)
|
|
|
|
|
|
- args, _ := json.Marshal(tr.request.Args)
|
|
|
+ args, _ := json.Marshal(tr.Request.Args)
|
|
|
|
|
|
- vals, ok := tr.request.Value.([]byte)
|
|
|
+ vals, ok := tr.Request.Value.([]byte)
|
|
|
if !ok {
|
|
|
- vals, _ = json.Marshal(tr.request.Value)
|
|
|
+ vals, _ = json.Marshal(tr.Request.Value)
|
|
|
}
|
|
|
|
|
|
buf.WriteString(fmt.Sprintf("transfer: %v - %v %v %q\n",
|
|
|
- tr.members, tr.request.RequestType, string(args), vals))
|
|
|
+ tr.Members, tr.Request.RequestType, string(args), vals))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -724,8 +725,8 @@ func (ms *memberStorage) dump(smname string) string {
|
|
|
if strings.HasPrefix(key, fmt.Sprint(transPrefix, smname, "#")) {
|
|
|
key = string(key[len(fmt.Sprint(transPrefix, smname, "#")):])
|
|
|
|
|
|
- locmap[v.(*translationRec).loc] = fmt.Sprintf("%v (v:%v)",
|
|
|
- key, v.(*translationRec).ver)
|
|
|
+ locmap[v.(*translationRec).Loc] = fmt.Sprintf("%v (v:%v)",
|
|
|
+ key, v.(*translationRec).Ver)
|
|
|
}
|
|
|
}
|
|
|
|